diff --git a/frontend-react/src/components/admin/AdminPage.tsx b/frontend-react/src/components/admin/AdminPage.tsx index 41bbae32f..a99a09ce6 100644 --- a/frontend-react/src/components/admin/AdminPage.tsx +++ b/frontend-react/src/components/admin/AdminPage.tsx @@ -14,7 +14,7 @@ import { useToast, Heading, Flex, Box } from "@chakra-ui/core" import Input from "../elements/Input" import Button from "../elements/Button" -const AdminPage: React.FC = ({}) => { +const AdminPage: React.FC = () => { const [updateTwitterForms, setUpdateTwitterForms] = useState< Partial >({}) diff --git a/frontend-react/src/components/elements/Alert.tsx b/frontend-react/src/components/elements/Alert.tsx index b8cd91c44..e1e2dfe81 100644 --- a/frontend-react/src/components/elements/Alert.tsx +++ b/frontend-react/src/components/elements/Alert.tsx @@ -4,12 +4,18 @@ import { Alert as ChakraAlert, AlertIcon, CloseButton } from "@chakra-ui/core" interface AlertProps { children: string | string[] status: "error" | "success" | "warning" | "info" + mt?: string onClose?: () => void } -const Alert: React.FC = ({ children, status, onClose }) => { +const Alert: React.FC = ({ + children, + status, + onClose, + mt = "2em", +}) => { return ( - + {children} {onClose && ( diff --git a/frontend-react/src/components/freeagents/FreeAgentsPage.tsx b/frontend-react/src/components/freeagents/FreeAgentsPage.tsx index 0fc2dd7af..006afd23f 100644 --- a/frontend-react/src/components/freeagents/FreeAgentsPage.tsx +++ b/frontend-react/src/components/freeagents/FreeAgentsPage.tsx @@ -27,6 +27,7 @@ import { FREE_AGENT_MATCHES, } from "../../graphql/queries/freeAgentMatches" import Matches from "./Matches" +import Alert from "../elements/Alert" const playstyleToEnum = { "Frontline/Slayer": "FRONTLINE", @@ -116,17 +117,35 @@ const FreeAgentsPage: React.FC = () => { return true } - const showModalButton = () => { - if (!userData!.user) return false + const getTopRightContent = () => { + if (!userData!.user) + return ( + + + Log in to make your own free agent post and start matching! + + + ) if (ownFAPost && ownFAPost.hidden) { const weekFromCreatingFAPost = parseInt(ownFAPost.createdAt) + 604800000 if (weekFromCreatingFAPost > Date.now()) { - return false + return ( + + + You need to wait a week after deleting your old free agent post + before making a new one + + + ) } } - return true + return ( + + + + ) } return ( @@ -147,11 +166,7 @@ const FreeAgentsPage: React.FC = () => { {showFilters ? "Hide filters" : "Show filters"} - {showModalButton() && ( - - - - )} + {getTopRightContent()}