diff --git a/next/components/molecules/Footer.js b/next/components/molecules/Footer.js index 18fdc355..b134d480 100644 --- a/next/components/molecules/Footer.js +++ b/next/components/molecules/Footer.js @@ -62,7 +62,7 @@ function FooterLink(props) { ) } -export default function Footer({ pages }) { +export default function Footer({ pages, ocult = false }) { const mobileCheck = useCheckMobile() const [isMobileMod, setIsMobileMod] = useState(false) @@ -70,8 +70,10 @@ export default function Footer({ pages }) { setIsMobileMod(mobileCheck) },[]) + if(ocult === true) return null + return ( - window.open(b.href, "_blank")} > {b.name} @@ -135,6 +137,7 @@ function MenuDrawer({ isOpen, onClose, links }) { border="2px solid #42B0FF" color="#42B0FF" height="38px" + borderRadius="30px" fontSize="20px" onClick={() => window.open("/user/login", "_self")} > @@ -143,6 +146,7 @@ function MenuDrawer({ isOpen, onClose, links }) { window.open("/user/register", "_self")} > @@ -261,6 +265,33 @@ function MenuDrawerUser({ isOpen, onClose}) { + + + + { + cookies.remove('user', { path: '/' }) + cookies.remove('token', { path: '/' }) + window.open("/", "_self") + }} + > + + + Sair + + ) @@ -297,11 +328,9 @@ function MenuUser ({ userData, onOpen, onClose }) { width="40px" borderRadius="50%" overflow="hidden" - display={{ base: "flex", lg: "none" }} onClick={() => onOpen()} > + + { + cookies.remove('user', { path: '/' }) + cookies.remove('token', { path: '/' }) + window.open("/", "_self")} + } + > + + + Sair + + ) @@ -492,7 +547,99 @@ function SearchInput ({ status }) { ) } -function DesktopLinks({ links, position = false, path }) { +function SearchInputUser () { + const [search, setSearch] = useState("") + const [showSearch, setShowSearch] = useState(false) + + function openSearchLink() { + window.open(`/dataset?q=${search}`, "_self") + } + + // if(isMobileMod()) return ( + // + // setShowSearch(true)} + // /> + // + // openSearchLink()} + // /> + // } + // /> + // + // + // ) + + if(isMobileMod()) return null + + return ( + + openSearchLink()} + /> + } + /> + + ) +} + +function DesktopLinks({ links, position = false, path, userTemplate = false }) { const [statusSearch, setStatusSearch] = useState(false) let userData = cookies.get("user") || null @@ -534,9 +681,9 @@ function DesktopLinks({ links, position = false, path }) { return ( - + {Object.entries(links).map(([k, v]) => { if (k === "Button") return v.map(b => ( @@ -557,6 +704,7 @@ function DesktopLinks({ links, position = false, path }) { minWidth="80px" height="35px" fontSize="15px" + borderRadius="30px" > {b.name} @@ -611,18 +759,34 @@ function DesktopLinks({ links, position = false, path }) { + {userTemplate && !isMobileMod() && } {!statusSearch && {userData ? ( - + + window.open("/precos", "_self")} + > + BD Pro + + + ) : ( <> Entrar - + Cadastrar @@ -634,7 +798,7 @@ function DesktopLinks({ links, position = false, path }) { ); } -export default function MenuNav({}) { +export default function MenuNav({ simpleTemplate = false, userTemplate = false }) { const router = useRouter() const { route } = router const menuDisclosure = useDisclosure() @@ -697,6 +861,7 @@ export default function MenuNav({}) { return ( <> - + - + {simpleTemplate ? + <> + : + + } + + {userTemplate && isMobileMod() && } {useCheckMobile() && userData && diff --git a/next/components/templates/main.js b/next/components/templates/main.js index 430a56ca..d43099dd 100644 --- a/next/components/templates/main.js +++ b/next/components/templates/main.js @@ -10,6 +10,8 @@ export function MainPageTemplate({ pages, children, backgroundColor = "#FFFFFF", + cleanTemplate = false, + userTemplate = false, ...style }) { @@ -18,11 +20,11 @@ export function MainPageTemplate({ - + {children} -