import { useContext, useState } from 'react' import { alpha, makeStyles } from '@material-ui/core/styles' import AppBar from '@material-ui/core/AppBar' import Toolbar from '@material-ui/core/Toolbar' import Typography from '@material-ui/core/Typography' import SearchIcon from '@material-ui/icons/Search' import InputBase from '@material-ui/core/InputBase' import Link from './Link' import HelpOutlineIcon from '@material-ui/icons/HelpOutline' import ImageSearchIcon from '@material-ui/icons/ImageSearch' import { IconButton } from '@material-ui/core' import Switch from '@material-ui/core/Switch' import { useRouter } from 'next/router' import MoreIcon from '@material-ui/icons/MoreVert' import MenuItem from '@material-ui/core/MenuItem' import Menu from '@material-ui/core/Menu' import { DataContext } from "./DataContext" const useStyles = makeStyles((theme) => ({ app_bar: { backgroundColor: "#606ca9" }, root: { flexGrow: 1, marginBottom: '10px', marginRight: "0px" }, tool_bar: { paddingRight: "6px", }, search: { position: 'relative', borderRadius: theme.shape.borderRadius, backgroundColor: alpha(theme.palette.common.white, 0.15), '&:hover': { backgroundColor: alpha(theme.palette.common.white, 0.25), }, marginRight: theme.spacing(2), marginLeft: "0px", width: 'auto', }, searchIcon: { padding: theme.spacing(0, 2), height: '100%', position: 'absolute', pointerEvents: 'none', display: 'flex', alignItems: 'center', justifyContent: 'center', }, inputRoot: { color: 'inherit', }, switch: { display: "inline-flex", alignItems: "center" }, inputInput: { padding: theme.spacing(1, 1, 1, 0), // vertical padding + font size from searchIcon paddingLeft: `calc(1em + ${theme.spacing(4)}px)`, transition: theme.transitions.create('width'), width: '100%', [theme.breakpoints.up('md')]: { width: '30ch', }, }, sub: { verticalAlign: "baseline", position: 'relative', top: "0.5em", left: "0.05em", }, sectionDesktop: { display: 'none', [theme.breakpoints.up('sm')]: { display: 'flex', }, }, sectionMobile: { display: 'flex', [theme.breakpoints.up('sm')]: { display: 'none', }, }, Logo: { marginRight: "16px", display: "inherit", [theme.breakpoints.down(350)]: { display: 'none', } } })) function Search(props: { semanticModeChecked: boolean }) { const placeholders = ["tag1&&(tag2||tag3)", "a picture of a winter forest"] const classes = useStyles() const router = useRouter() const [tags, setTags] = useState(router.query.q || '') const searchPlaceholer = placeholders[Number(router.query.semantic || Number(props.semanticModeChecked))] const handleKeyPress = (e: React.KeyboardEvent) => { if (e.keyCode === 13 || e.which === 13) { router.push(`${process.env.domain}/search?q=${encodeURIComponent((tags as string))}&semantic=${Number(props.semanticModeChecked).toString()}`) } } return (
setTags(e.target.value)} onKeyPress={(e) => handleKeyPress(e)} classes={{ root: classes.inputRoot, input: classes.inputInput, }} inputProps={{ 'aria-label': 'search' }} value={tags} />
) } // eslint-disable-next-line @typescript-eslint/no-explicit-any function MobileMenu(props: any) { const classes = useStyles() return (

Search syntax

tags semanticbeta

Reverse Image Search

use ipfs
) } export default function DenseAppBar() { const dataContext = useContext(DataContext) const classes = useStyles() const router = useRouter() const mobileMenuId = 'menu-mobile' const [mobileMoreAnchorEl, setMobileMoreAnchorEl] = useState(null) const [semanticModeChecked, setSemanticModeChecked] = useState(Boolean(Number(router.query.semantic)) || false) const toggleSemanticModeChecked = () => { setSemanticModeChecked(!semanticModeChecked) } const handleMobileMenuOpen = (event: React.MouseEvent) => { setMobileMoreAnchorEl(event.currentTarget) } const handleMobileMenuClose = () => { setMobileMoreAnchorEl(null) } const isMobileMenuOpen = Boolean(mobileMoreAnchorEl) return (
Scenery
tags semanticbeta
) }