Alejandra
5 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with
12 additions and
17 deletions
-
frontend/src/components/Common/Navbar.tsx
-
frontend/src/components/Common/Sidebar.tsx
-
frontend/src/components/UserSettings/ChangePassword.tsx
-
frontend/src/components/UserSettings/UserInformation.tsx
-
frontend/src/routes/_layout/index.tsx
|
@ -20,7 +20,7 @@ function Navbar() { |
|
|
p={4} |
|
|
p={4} |
|
|
> |
|
|
> |
|
|
<Link to="/"> |
|
|
<Link to="/"> |
|
|
<Image src={Logo} alt="Logo" w="180px" maxW="2xs" px={2} /> |
|
|
<Image src={Logo} alt="Logo" maxW="3xs" p={2} /> |
|
|
</Link> |
|
|
</Link> |
|
|
<Flex gap={2} alignItems="center"> |
|
|
<Flex gap={2} alignItems="center"> |
|
|
<UserMenu /> |
|
|
<UserMenu /> |
|
|
|
@ -22,10 +22,6 @@ const Sidebar = () => { |
|
|
const { logout } = useAuth() |
|
|
const { logout } = useAuth() |
|
|
const [open, setOpen] = useState(false) |
|
|
const [open, setOpen] = useState(false) |
|
|
|
|
|
|
|
|
const handleLogout = async () => { |
|
|
|
|
|
logout() |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|
<> |
|
|
<> |
|
|
{/* Mobile */} |
|
|
{/* Mobile */} |
|
@ -48,7 +44,7 @@ const Sidebar = () => { |
|
|
<FaBars /> |
|
|
<FaBars /> |
|
|
</IconButton> |
|
|
</IconButton> |
|
|
</DrawerTrigger> |
|
|
</DrawerTrigger> |
|
|
<DrawerContent maxW="280px"> |
|
|
<DrawerContent maxW="xs"> |
|
|
<DrawerCloseTrigger /> |
|
|
<DrawerCloseTrigger /> |
|
|
<DrawerBody> |
|
|
<DrawerBody> |
|
|
<Flex flexDir="column" justify="space-between"> |
|
|
<Flex flexDir="column" justify="space-between"> |
|
@ -56,7 +52,9 @@ const Sidebar = () => { |
|
|
<SidebarItems /> |
|
|
<SidebarItems /> |
|
|
<Flex |
|
|
<Flex |
|
|
as="button" |
|
|
as="button" |
|
|
onClick={handleLogout} |
|
|
onClick={() => { |
|
|
|
|
|
logout() |
|
|
|
|
|
}} |
|
|
alignItems="center" |
|
|
alignItems="center" |
|
|
gap={4} |
|
|
gap={4} |
|
|
px={4} |
|
|
px={4} |
|
@ -67,7 +65,7 @@ const Sidebar = () => { |
|
|
</Flex> |
|
|
</Flex> |
|
|
</Box> |
|
|
</Box> |
|
|
{currentUser?.email && ( |
|
|
{currentUser?.email && ( |
|
|
<Text fontSize="sm" p={2}> |
|
|
<Text fontSize="sm" p={2} truncate maxW="sm"> |
|
|
Logged in as: {currentUser.email} |
|
|
Logged in as: {currentUser.email} |
|
|
</Text> |
|
|
</Text> |
|
|
)} |
|
|
)} |
|
@ -84,7 +82,7 @@ const Sidebar = () => { |
|
|
position="sticky" |
|
|
position="sticky" |
|
|
bg="bg.subtle" |
|
|
bg="bg.subtle" |
|
|
top={0} |
|
|
top={0} |
|
|
minW="280px" |
|
|
minW="xs" |
|
|
h="100vh" |
|
|
h="100vh" |
|
|
p={4} |
|
|
p={4} |
|
|
> |
|
|
> |
|
|
|
@ -48,11 +48,10 @@ const ChangePassword = () => { |
|
|
Change Password |
|
|
Change Password |
|
|
</Heading> |
|
|
</Heading> |
|
|
<Box |
|
|
<Box |
|
|
w={{ sm: "full", md: "300px" }} |
|
|
|
|
|
as="form" |
|
|
as="form" |
|
|
onSubmit={handleSubmit(onSubmit)} |
|
|
onSubmit={handleSubmit(onSubmit)} |
|
|
> |
|
|
> |
|
|
<VStack gap={4}> |
|
|
<VStack gap={4} w={{ base: "100%", md: "sm" }}> |
|
|
<PasswordInput |
|
|
<PasswordInput |
|
|
type="current_password" |
|
|
type="current_password" |
|
|
startElement={<FiLock />} |
|
|
startElement={<FiLock />} |
|
|
|
@ -76,7 +76,7 @@ const UserInformation = () => { |
|
|
User Information |
|
|
User Information |
|
|
</Heading> |
|
|
</Heading> |
|
|
<Box |
|
|
<Box |
|
|
w={{ sm: "full", md: "50%" }} |
|
|
w={{ sm: "full", md: "sm" }} |
|
|
as="form" |
|
|
as="form" |
|
|
onSubmit={handleSubmit(onSubmit)} |
|
|
onSubmit={handleSubmit(onSubmit)} |
|
|
> |
|
|
> |
|
@ -86,7 +86,6 @@ const UserInformation = () => { |
|
|
{...register("full_name", { maxLength: 30 })} |
|
|
{...register("full_name", { maxLength: 30 })} |
|
|
type="text" |
|
|
type="text" |
|
|
size="md" |
|
|
size="md" |
|
|
w="auto" |
|
|
|
|
|
/> |
|
|
/> |
|
|
) : ( |
|
|
) : ( |
|
|
<Text |
|
|
<Text |
|
@ -94,7 +93,7 @@ const UserInformation = () => { |
|
|
py={2} |
|
|
py={2} |
|
|
color={!currentUser?.full_name ? "gray" : "inherit"} |
|
|
color={!currentUser?.full_name ? "gray" : "inherit"} |
|
|
truncate |
|
|
truncate |
|
|
maxWidth="250px" |
|
|
maxW="sm" |
|
|
> |
|
|
> |
|
|
{currentUser?.full_name || "N/A"} |
|
|
{currentUser?.full_name || "N/A"} |
|
|
</Text> |
|
|
</Text> |
|
@ -114,10 +113,9 @@ const UserInformation = () => { |
|
|
})} |
|
|
})} |
|
|
type="email" |
|
|
type="email" |
|
|
size="md" |
|
|
size="md" |
|
|
w="auto" |
|
|
|
|
|
/> |
|
|
/> |
|
|
) : ( |
|
|
) : ( |
|
|
<Text fontSize="md" py={2} truncate maxWidth="250px"> |
|
|
<Text fontSize="md" py={2} truncate maxW="sm"> |
|
|
{currentUser?.email} |
|
|
{currentUser?.email} |
|
|
</Text> |
|
|
</Text> |
|
|
)} |
|
|
)} |
|
|
|
@ -14,7 +14,7 @@ function Dashboard() { |
|
|
<> |
|
|
<> |
|
|
<Container maxW="full"> |
|
|
<Container maxW="full"> |
|
|
<Box pt={12} m={4}> |
|
|
<Box pt={12} m={4}> |
|
|
<Text fontSize="2xl"> |
|
|
<Text fontSize="2xl" truncate maxW="sm"> |
|
|
Hi, {currentUser?.full_name || currentUser?.email} 👋🏼 |
|
|
Hi, {currentUser?.full_name || currentUser?.email} 👋🏼 |
|
|
</Text> |
|
|
</Text> |
|
|
<Text>Welcome back, nice to see you again!</Text> |
|
|
<Text>Welcome back, nice to see you again!</Text> |
|
|