diff options
Diffstat (limited to 'src/view/com/util/layouts')
-rw-r--r-- | src/view/com/util/layouts/Breakpoints.tsx | 11 | ||||
-rw-r--r-- | src/view/com/util/layouts/Breakpoints.web.tsx | 20 | ||||
-rw-r--r-- | src/view/com/util/layouts/withBreakpoints.tsx | 21 |
3 files changed, 0 insertions, 52 deletions
diff --git a/src/view/com/util/layouts/Breakpoints.tsx b/src/view/com/util/layouts/Breakpoints.tsx deleted file mode 100644 index 45dc23615..000000000 --- a/src/view/com/util/layouts/Breakpoints.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import React from 'react' - -export const Desktop = ({}: React.PropsWithChildren<{}>) => null -export const TabletOrDesktop = ({}: React.PropsWithChildren<{}>) => null -export const Tablet = ({}: React.PropsWithChildren<{}>) => null -export const TabletOrMobile = ({children}: React.PropsWithChildren<{}>) => ( - <>{children}</> -) -export const Mobile = ({children}: React.PropsWithChildren<{}>) => ( - <>{children}</> -) diff --git a/src/view/com/util/layouts/Breakpoints.web.tsx b/src/view/com/util/layouts/Breakpoints.web.tsx deleted file mode 100644 index 5106e3e1f..000000000 --- a/src/view/com/util/layouts/Breakpoints.web.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import React from 'react' -import MediaQuery from 'react-responsive' - -export const Desktop = ({children}: React.PropsWithChildren<{}>) => ( - <MediaQuery minWidth={1300}>{children}</MediaQuery> -) -export const TabletOrDesktop = ({children}: React.PropsWithChildren<{}>) => ( - <MediaQuery minWidth={800}>{children}</MediaQuery> -) -export const Tablet = ({children}: React.PropsWithChildren<{}>) => ( - <MediaQuery minWidth={800} maxWidth={1300 - 1}> - {children} - </MediaQuery> -) -export const TabletOrMobile = ({children}: React.PropsWithChildren<{}>) => ( - <MediaQuery maxWidth={1300 - 1}>{children}</MediaQuery> -) -export const Mobile = ({children}: React.PropsWithChildren<{}>) => ( - <MediaQuery maxWidth={800 - 1}>{children}</MediaQuery> -) diff --git a/src/view/com/util/layouts/withBreakpoints.tsx b/src/view/com/util/layouts/withBreakpoints.tsx deleted file mode 100644 index 71971c604..000000000 --- a/src/view/com/util/layouts/withBreakpoints.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import React from 'react' - -import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries' -import {isNative} from '#/platform/detection' - -export const withBreakpoints = <P extends object>( - Mobile: React.ComponentType<P>, - Tablet: React.ComponentType<P>, - Desktop: React.ComponentType<P>, -): React.FC<P> => - function WithBreakpoints(props: P) { - const {isMobile, isTabletOrMobile} = useWebMediaQueries() - - if (isMobile || isNative) { - return <Mobile {...props} /> - } - if (isTabletOrMobile) { - return <Tablet {...props} /> - } - return <Desktop {...props} /> - } |