Use media queries instead of serverside data for correct nav view

This commit is contained in:
regalijan 2023-10-19 16:49:55 -04:00
parent bbd49d6d5b
commit ce5d7ab6c6
Signed by: regalijan
GPG Key ID: 5D4196DA269EF520

View File

@ -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"