From 9ad4f077d125267008b3d24a9404a4f5f1bf0bd2 Mon Sep 17 00:00:00 2001 From: Joao Ramos Date: Wed, 13 Dec 2023 23:57:32 +0000 Subject: [PATCH 1/2] Added user type to navbar --- src/components/Navbar.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index e546a2dc..28272521 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -8,6 +8,7 @@ import clsx from "clsx"; import moment from "moment"; import MobileMenu from "./MobileMenu"; import {useState} from "react"; +import {Type} from "@/interfaces/user"; interface Props { user: User; @@ -42,6 +43,9 @@ export default function Navbar({user, path, navDisabled = false, focusMode = fal return today.add(7, "days").isAfter(momentDate); }; + const uppercaseFirstLetter = (string: Type) => string.charAt(0).toUpperCase() + string.slice(1); + + return ( <> {user && setIsMenuOpen(false)} user={user} />} @@ -67,10 +71,10 @@ export default function Navbar({user, path, navDisabled = false, focusMode = fal {user.subscriptionExpirationDate && moment(user.subscriptionExpirationDate).format("DD/MM/YYYY")} )} - - {user.name} - {user.name} - + + {user.name} + {user.name} | {uppercaseFirstLetter(user.type)} +
setIsMenuOpen(true)}>
From fbc2cff3f1d7f0115056793e977284f9f61b0be8 Mon Sep 17 00:00:00 2001 From: Joao Ramos Date: Wed, 13 Dec 2023 23:58:48 +0000 Subject: [PATCH 2/2] Minor identation changes --- src/components/Navbar.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index 28272521..b2ef13df 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -45,7 +45,6 @@ export default function Navbar({user, path, navDisabled = false, focusMode = fal const uppercaseFirstLetter = (string: Type) => string.charAt(0).toUpperCase() + string.slice(1); - return ( <> {user && setIsMenuOpen(false)} user={user} />} @@ -71,10 +70,10 @@ export default function Navbar({user, path, navDisabled = false, focusMode = fal {user.subscriptionExpirationDate && moment(user.subscriptionExpirationDate).format("DD/MM/YYYY")} )} - - {user.name} - {user.name} | {uppercaseFirstLetter(user.type)} - + + {user.name} + {user.name} | {uppercaseFirstLetter(user.type)} +
setIsMenuOpen(true)}>