forked from Archives/Athou_commafeed
use useMobile
This commit is contained in:
@@ -1,11 +1,8 @@
|
||||
import { Box, MediaQuery } from "@mantine/core"
|
||||
import { Constants } from "app/constants"
|
||||
import { Box } from "@mantine/core"
|
||||
import { useMobile } from "hooks/useMobile"
|
||||
import React from "react"
|
||||
|
||||
export function OnDesktop(props: { children: React.ReactNode }) {
|
||||
return (
|
||||
<MediaQuery smallerThan={Constants.layout.mobileBreakpoint} styles={{ display: "none" }}>
|
||||
<Box>{props.children}</Box>
|
||||
</MediaQuery>
|
||||
)
|
||||
const mobile = useMobile()
|
||||
return <Box>{!mobile && props.children}</Box>
|
||||
}
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
import { Box, MediaQuery } from "@mantine/core"
|
||||
import { Constants } from "app/constants"
|
||||
import { Box } from "@mantine/core"
|
||||
import { useMobile } from "hooks/useMobile"
|
||||
import React from "react"
|
||||
|
||||
export function OnMobile(props: { children: React.ReactNode }) {
|
||||
return (
|
||||
<MediaQuery largerThan={Constants.layout.mobileBreakpoint} styles={{ display: "none" }}>
|
||||
<Box>{props.children}</Box>
|
||||
</MediaQuery>
|
||||
)
|
||||
const mobile = useMobile()
|
||||
return <Box>{mobile && props.children}</Box>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user