Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main fix/131 fix navbar desktop #134

Merged
merged 3 commits into from
Sep 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 19 additions & 11 deletions modules/shared/components/Menu/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import Hamburguer from "../Icons/Hamburguer";
import MenuLogo from "../Icons/MenuLogo";

const Links = [
{ title: "Colecciones", href: "/" },
{ title: "Sesión de estudio", href: "/SesiónEstudio" },
{ title: "Colecciones", href: "/collections" },
{ title: "Sesión de estudio", href: "/study-sessions" },
{ title: "Tienda", href: "/Tienda" },
{ title: "Perfil", href: "/Perfil" },
];
Expand All @@ -32,11 +32,19 @@ const Menu = () => {
<Box>
<MenuLogo fill="white" width={18} height={23} borderColor="primary.100" borderWidth={7} />
</Box>
<Box onClick={onOpen} cursor="pointer">
<Box onClick={onOpen} cursor="pointer" display={{ lg: "none" }}>
<Hamburguer />
</Box>
<Box display={{ base: "none", lg: "flex" }}>
{Links.map((link) => (
<Text variant="navbar">
<Link href={link.href}>
<a>{link.title}</a>
</Link>
</Text>
))}
</Box>
</Flex>

<Drawer onClose={onClose} isOpen={isOpen} size={{ base: "full", md: "sm" }}>
<DrawerOverlay />
<DrawerContent bg="primary.100">
Expand All @@ -49,13 +57,13 @@ const Menu = () => {
borderColor="primary.100"
borderWidth={2}
/>
{Links.map((link) => {
return (
<Text variant="menu" key={link.href}>
<Link href={link.href}>{link.title}</Link>
</Text>
);
})}
{Links.map((link) => (
<Text variant="drawer">
<Link href={link.href}>
<a>{link.title}</a>
</Link>
</Text>
))}
</DrawerBody>
</DrawerContent>
</Drawer>
Expand Down
46 changes: 30 additions & 16 deletions modules/shared/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,7 @@ const colors: CustomColors = {
};

const components: Theme["components"] = {
Text: {
variants: {
menu: {
textAlign: "center",
color: "white",
fontWeight: 500,
fontSize: "1.5rem",
marginTop: "45px",
},
label: {
color: "label.50",
fontWeight: 600,
fontSize: "18px",
},
},
},

Button: {
baseStyle: {
height: "auto",
Expand Down Expand Up @@ -101,6 +86,35 @@ const components: Theme["components"] = {
size: "md",
},
},

Text: {
variants: {
label: {
color: "label.50",
fontWeight: 600,
fontSize: "18px",
},
drawer: {
textAlign: "center",
color: "white",
fontWeight: 500,
fontSize: "20px",
marginTop: "45px",
},
navbar: {
textAlign: "center",
color: "gray.300",
fontWeight: 400,
fontSize: "19px",
borderBottom: "3px solid white",
ml: "60px",
_hover: {
color: "primary.100",
borderBottom: "3px solid",
},
},
},
},

Textarea: {
// style object for base or default style
Expand Down
4 changes: 3 additions & 1 deletion pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Head from "next/head";
import nookies from "nookies";

import { verifyIdToken } from "@/firebaseAdminConfig";
import LogoutButton from "@/modules/Auth/components/LogoutButton";
import MyCollectionsPage from "@/modules/Collections/MyCollectionsPage";
import Menu from "@/modules/shared/components/Menu/Menu";

Expand All @@ -14,11 +15,12 @@ const Home: NextPage & { requiresAuthentication: boolean } = () => {
<meta name="description" content="Flashcards study app" />
<link rel="icon" href="/favicon.ico" />
</Head>

<div>
<Menu />
<MyCollectionsPage />
</div>
<LogoutButton />
<MyCollectionsPage />
</div>
);
};
Expand Down