import makeStyles from "@material-ui/core/styles/makeStyles"; import React from "react"; import { useIntl } from "react-intl"; import { QuickSearchMode } from "./types"; const useStyles = makeStyles( theme => { const typography = { color: theme.palette.text.primary, fontSize: 24, lineHeight: 1.33 }; return { adornment: { ...typography, color: theme.palette.text.secondary, paddingRight: theme.spacing(1) }, input: { ...typography, background: "transparent", border: "none", outline: 0, padding: 0, width: "100%" }, root: { background: theme.palette.background.default, display: "flex", padding: theme.spacing(2, 3) } }; }, { name: "NavigatorInput" } ); interface NavigatorInputProps extends React.InputHTMLAttributes { mode: QuickSearchMode; } const NavigatorInput = React.forwardRef( (props, ref) => { const { mode, ...rest } = props; const classes = useStyles(props); const intl = useIntl(); return (
{mode !== "default" && ( {mode === "orders" ? "#" : mode === "customers" ? "@" : mode === "catalog" ? "$" : mode === "help" ? "?" : ">"} )}
); } ); NavigatorInput.displayName = "NavigatorInput"; export default NavigatorInput;