-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1578 from yuanLeeMidori/issue-1507
Fix #1507: Port SearchHelp from Gatsby to Nextjs
- Loading branch information
Showing
1 changed file
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import { withStyles, makeStyles } from '@material-ui/core/styles'; | ||
import InfoOutlinedIcon from '@material-ui/icons/InfoOutlined'; | ||
|
||
import { Typography, Tooltip } from '@material-ui/core'; | ||
|
||
const useStyles = makeStyles(() => ({ | ||
infoButton: { | ||
marginTop: '7.5px', | ||
fontSize: '3rem', | ||
color: '#8BC2EB', | ||
}, | ||
})); | ||
|
||
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', | ||
}, | ||
}))(Tooltip); | ||
|
||
const SearchHelp = () => { | ||
const classes = useStyles(); | ||
return ( | ||
<HtmlTooltip | ||
title={ | ||
<> | ||
<Typography variant="h5">How to use search</Typography> | ||
<ul> | ||
<li> | ||
<b>' + '</b> | ||
{' signifies AND operator'} | ||
</li> | ||
<li> | ||
<b>' | '</b> | ||
{' signifies OR operator'} | ||
</li> | ||
<li> | ||
<b>' - '</b> | ||
{' negates a single token'} | ||
</li> | ||
<li> | ||
<b>“ ”</b> | ||
{' wraps a number of tokens to signify a phrase for searching'} | ||
</li> | ||
<li> | ||
<b>' * '</b> | ||
{' at the end of a term signifies a prefix query'} | ||
</li> | ||
<li> | ||
<b>' ( ' and ' ) '</b> | ||
{' signify precendence '} | ||
</li> | ||
<li> | ||
<b>' ~N '</b> | ||
{' after a word signifies edit distance (fuzziness)'} | ||
</li> | ||
<li> | ||
<b>' ~N '</b> | ||
{' after a phrase signifies slop amount'} | ||
</li> | ||
</ul> | ||
</> | ||
} | ||
> | ||
<InfoOutlinedIcon className={classes.infoButton} /> | ||
</HtmlTooltip> | ||
); | ||
}; | ||
|
||
export default SearchHelp; |