Use media queries instead of serverside data for correct nav view
This commit is contained in:
parent
bbd49d6d5b
commit
ce5d7ab6c6
@ -41,12 +41,10 @@ export default function (props: {
|
|||||||
email?: string;
|
email?: string;
|
||||||
hide?: boolean;
|
hide?: boolean;
|
||||||
id?: string;
|
id?: string;
|
||||||
mobile?: string;
|
|
||||||
permissions?: number;
|
permissions?: number;
|
||||||
username?: string;
|
username?: string;
|
||||||
}) {
|
}) {
|
||||||
let data = { ...props };
|
let data = { ...props };
|
||||||
const isDesktop = props.mobile === "?0";
|
|
||||||
const { isOpen, onClose, onOpen } = useDisclosure();
|
const { isOpen, onClose, onOpen } = useDisclosure();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -56,7 +54,8 @@ export default function (props: {
|
|||||||
<Container maxW="container.xl" py={{ base: "6" }}>
|
<Container maxW="container.xl" py={{ base: "6" }}>
|
||||||
<Container
|
<Container
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
display={isDesktop ? "none" : "flex"}
|
className="mobile-nav"
|
||||||
|
display="flex"
|
||||||
justifyContent="space-between"
|
justifyContent="space-between"
|
||||||
p="0"
|
p="0"
|
||||||
w="calc(100vw - 6rem)"
|
w="calc(100vw - 6rem)"
|
||||||
@ -84,7 +83,8 @@ export default function (props: {
|
|||||||
</Container>
|
</Container>
|
||||||
<Flex
|
<Flex
|
||||||
alignSelf="center"
|
alignSelf="center"
|
||||||
display={isDesktop ? "flex" : "none"}
|
className="desktop-nav"
|
||||||
|
display="flex"
|
||||||
gap="0.5rem"
|
gap="0.5rem"
|
||||||
justifyContent="space-between"
|
justifyContent="space-between"
|
||||||
p="0"
|
p="0"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user