useScreenType replaced with useMobile; hide breadcrumbs on mobile

This commit is contained in:
tmshv committed 2020-02-23 05:49:52 +03:00
1 parent 822f1a0535
commit 471d8f4714
4 files changed
+12 -20

No files matched your search

+4 -2
View File
@@ -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<IAppProps> = props => {
const hideBreadcrumbs = useMobile()
const router = useRouter()
const wide = props.wide ?? false
const blockStyle = {
@@ -35,8 +37,8 @@ export const App: React.FC<IAppProps> = props => {
header={(
<header>
<Navigation />
{!props.breadcrumbs ? null : (
<Block direction={'vertical'} style={blockStyle}>
{hideBreadcrumbs || !props.breadcrumbs ? null : (
<Block direction={'horizontal'} style={blockStyle}>
<Content wide={wide}>
<Breadcrumbs
items={props.breadcrumbs}