diff --git a/src/web/src/components/SearchHelp.tsx b/src/web/src/components/SearchHelp.tsx index f811e93785..5cd2a688c0 100644 --- a/src/web/src/components/SearchHelp.tsx +++ b/src/web/src/components/SearchHelp.tsx @@ -1,72 +1,72 @@ -import { withStyles, makeStyles } from '@material-ui/core/styles'; -import InfoOutlinedIcon from '@material-ui/icons/InfoOutlined'; +import { makeStyles } from '@material-ui/core/styles'; +import { Typography, Theme } from '@material-ui/core'; -import { Typography, Tooltip } from '@material-ui/core'; - -const useStyles = makeStyles(() => ({ - infoButton: { - marginTop: '7.5px', - fontSize: '3rem', - color: '#8BC2EB', +const useStyles = makeStyles((theme: Theme) => ({ + root: { + overflow: 'visible', + maxWidth: '785px', + marginLeft: 'auto', + marginRight: 'auto', + paddingTop: 0, }, -})); - -const HtmlTooltip = withStyles((theme) => ({ - tooltip: { - backgroundColor: '#f5f5f9', - color: 'rgba(0, 0, 0, 0.87)', - maxWidth: 500, - fontSize: theme.typography.pxToRem(22.5), - border: '1px solid #dadde9', + list: { + fontFamily: 'Times New Roman', + fontSize: '1.7rem', + lineHeight: '3rem', + color: theme.palette.text.disabled, + listStyleType: 'none', + [theme.breakpoints.down('xs')]: { + paddingLeft: theme.spacing(4), + paddingRight: theme.spacing(4), + paddingTop: 0, + paddingBottom: theme.spacing(6), + lineHeight: '2.5rem', + }, }, -}))(Tooltip); +})); const SearchHelp = () => { const classes = useStyles(); return ( - - How to use search - - - } - > - - +
+ +
); }; diff --git a/src/web/src/components/SearchPage.tsx b/src/web/src/components/SearchPage.tsx index 2ad5ec3e45..9f7b981c2d 100644 --- a/src/web/src/components/SearchPage.tsx +++ b/src/web/src/components/SearchPage.tsx @@ -5,6 +5,7 @@ import { useRouter } from 'next/router'; import SearchResults from './SearchResults'; import SearchBar from './SearchBar'; import BackToTopButton from './BackToTopButton'; +import SearchHelp from './SearchHelp'; type FilterProp = { filter: 'post' | 'author'; @@ -40,11 +41,14 @@ const SearchPage = () => { // form submit only. These are used in the , and the user can change them. const [text, setText] = useState(''); const [filter, setFilter] = useState('post'); + const [showHelp, setShowHelp] = useState(true); // Form was submitted, so go ahead and sync to URL, (re)triggering search. function onSubmitHandler(event: FormEvent) { event.preventDefault(); router.push(`/search?text=${text}&filter=${filter}`); + // On form submit, hide help list + setShowHelp(false); } useEffect(() => { @@ -63,8 +67,10 @@ const SearchPage = () => { onFilterChange={(value: FilterProp['filter']) => setFilter(value)} onSubmit={onSubmitHandler} /> -
+ {showHelp && + + } );