diff --git a/frontend-react/src/components/elements/Alert.tsx b/frontend-react/src/components/elements/Alert.tsx index 23e6f8ed1..b8cd91c44 100644 --- a/frontend-react/src/components/elements/Alert.tsx +++ b/frontend-react/src/components/elements/Alert.tsx @@ -1,16 +1,25 @@ import React from "react" -import { Alert as ChakraAlert, AlertIcon } from "@chakra-ui/core" +import { Alert as ChakraAlert, AlertIcon, CloseButton } from "@chakra-ui/core" interface AlertProps { children: string | string[] status: "error" | "success" | "warning" | "info" + onClose?: () => void } -const Alert: React.FC = ({ children, status }) => { +const Alert: React.FC = ({ children, status, onClose }) => { return ( {children} + {onClose && ( + + )} ) } diff --git a/frontend-react/src/components/xsearch/Top500BrowserPage.tsx b/frontend-react/src/components/xsearch/Top500BrowserPage.tsx index de8e428c6..7327618ad 100644 --- a/frontend-react/src/components/xsearch/Top500BrowserPage.tsx +++ b/frontend-react/src/components/xsearch/Top500BrowserPage.tsx @@ -22,6 +22,7 @@ import Pagination from "../common/Pagination" import Top500Forms from "./Top500Forms" import PageHeader from "../common/PageHeader" import Button from "../elements/Button" +import Alert from "../elements/Alert" interface Placement { id: string @@ -85,8 +86,8 @@ const Top500BrowserPage: React.FC = () => { }) const handleClear = () => { - setForms({}) - setQuery({}, "replace") + setForms({ page: 1 }) + setQuery({ page: 1 }, "replace") } const handleFormChange = (value: Object) => { @@ -106,8 +107,20 @@ const Top500BrowserPage: React.FC = () => { + {forms.unique_id && ( + + Viewing placements by player with the id {forms.unique_id} + + )} - +