diff --git a/src/components/App/index.tsx b/src/components/App/index.tsx index 2ca49e69..cb13d895 100644 --- a/src/components/App/index.tsx +++ b/src/components/App/index.tsx @@ -10,6 +10,7 @@ import { Breadcrumbs } from '../Breadcrumbs' import { IBreadcumbsPart } from 'src/types' import { useRouter } from 'next/router' import { route } from 'next/dist/next-server/server/router' +import { useMobile } from 'src/hooks/useMobile' const Navigation = dynamic(() => import('../Navigation').then(mod => mod.Navigation), { ssr: false, @@ -23,6 +24,7 @@ export interface IAppProps { } export const App: React.FC = props => { + const hideBreadcrumbs = useMobile() const router = useRouter() const wide = props.wide ?? false const blockStyle = { @@ -35,8 +37,8 @@ export const App: React.FC = props => { header={(
- {!props.breadcrumbs ? null : ( - + {hideBreadcrumbs || !props.breadcrumbs ? null : ( + = props => { - const isMobile = useScreenType(['phone', 'tablet']) + const collapseMenu = useMobile() const [open, setOpen] = useState(false) const onClick = useCallback( () => { @@ -34,7 +34,7 @@ export const Navigation: React.FC = props => { } `} - {isMobile ? ( + {collapseMenu ? ( { - setMatch(isPhone && types.includes('phone')) - }, [isPhone]) - - return match -}