Fix scuffed web styles caused by overlapping viewport breakpoint boundaries (#1985)
* fixed lack of styles on 1300px web viewport width by adjusting tablet breakpoints * fixed lack of styles on 800px web viewport width by adjusting mobile breakpoints * changed `maxWidth` values in viewports to `n - 1` formatzio/stable
parent
85b2b390df
commit
5839d2a30c
|
@ -3,8 +3,8 @@ import {isNative} from 'platform/detection'
|
|||
|
||||
export function useWebMediaQueries() {
|
||||
const isDesktop = useMediaQuery({minWidth: 1300})
|
||||
const isTablet = useMediaQuery({minWidth: 800, maxWidth: 1300})
|
||||
const isMobile = useMediaQuery({maxWidth: 800})
|
||||
const isTablet = useMediaQuery({minWidth: 800, maxWidth: 1300 - 1})
|
||||
const isMobile = useMediaQuery({maxWidth: 800 - 1})
|
||||
const isTabletOrMobile = isMobile || isTablet
|
||||
const isTabletOrDesktop = isDesktop || isTablet
|
||||
if (isNative) {
|
||||
|
|
|
@ -8,13 +8,13 @@ export const TabletOrDesktop = ({children}: React.PropsWithChildren<{}>) => (
|
|||
<MediaQuery minWidth={800}>{children}</MediaQuery>
|
||||
)
|
||||
export const Tablet = ({children}: React.PropsWithChildren<{}>) => (
|
||||
<MediaQuery minWidth={800} maxWidth={1300}>
|
||||
<MediaQuery minWidth={800} maxWidth={1300 - 1}>
|
||||
{children}
|
||||
</MediaQuery>
|
||||
)
|
||||
export const TabletOrMobile = ({children}: React.PropsWithChildren<{}>) => (
|
||||
<MediaQuery maxWidth={1300}>{children}</MediaQuery>
|
||||
<MediaQuery maxWidth={1300 - 1}>{children}</MediaQuery>
|
||||
)
|
||||
export const Mobile = ({children}: React.PropsWithChildren<{}>) => (
|
||||
<MediaQuery maxWidth={800}>{children}</MediaQuery>
|
||||
<MediaQuery maxWidth={800 - 1}>{children}</MediaQuery>
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue