Skip to content

Commit f16c1bc

Browse files
Update Nav bar to indicate login status
1 parent dc8498b commit f16c1bc

File tree

1 file changed

+44
-46
lines changed

1 file changed

+44
-46
lines changed
Lines changed: 44 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,52 @@
11
import React from "react";
2-
import {
3-
Image,
4-
Flex,
5-
Button,
6-
HStack,
7-
chakra
8-
} from '@chakra-ui/react';
9-
import { Link } from 'react-router-dom';
2+
import { Flex, Button, HStack, chakra } from "@chakra-ui/react";
3+
import { Link } from "react-router-dom";
4+
import { isLoggedin } from "../../helper/UIHelper";
105

116
export const Navbar = () => {
12-
return (
13-
<chakra.header>
14-
<Flex
15-
w="100%"
16-
px="6"
17-
py="4"
18-
align={'center'}
19-
justify={'space-between'}
20-
>
21-
<HStack spacing="4px">
22-
<Link to="/">
23-
<Button colorScheme="linkedin" variant="outline">Peer Prep</Button>
24-
</Link>
7+
return (
8+
<chakra.header boxShadow={"md"} minH="10vh" zIndex="999">
9+
<Flex w="100%" px="6" py="2vh" align={"center"} justify={"space-between"}>
10+
<HStack spacing="4px">
11+
<Link to="/">
12+
<Button colorScheme="linkedin" variant="outline">
13+
Peer Prep
14+
</Button>
15+
</Link>
2516

26-
<Link to="/">
27-
<Button colorScheme="blue" variant="ghost">Home</Button>
28-
</Link>
17+
<Link to="/">
18+
<Button colorScheme="blue" variant="ghost">
19+
Home
20+
</Button>
21+
</Link>
2922

30-
<Link to="/">
31-
<Button variant="ghost">Bank</Button>
32-
</Link>
23+
<Link to="/bank">
24+
<Button variant="ghost">Bank</Button>
25+
</Link>
3326

34-
<Link to="/">
35-
<Button variant="ghost">Create</Button>
36-
</Link>
27+
<Link to="/create">
28+
<Button variant="ghost">Create</Button>
29+
</Link>
3730

38-
<Link to="/">
39-
<Button variant="ghost">About</Button>
40-
</Link>
41-
</HStack>
31+
<Link to="/about">
32+
<Button variant="ghost">About</Button>
33+
</Link>
34+
</HStack>
4235

43-
<HStack>
44-
<Button variant="ghost">
45-
Sign in
46-
</Button>
47-
<Button>
48-
Sign up
49-
</Button>
50-
</HStack>
51-
</Flex>
52-
</chakra.header>
53-
);
54-
}
36+
<HStack>
37+
{isLoggedin ? (
38+
<>
39+
<Button variant="ghost">Sign out</Button>
40+
<Button colorScheme="blue">View Account</Button>
41+
</>
42+
) : (
43+
<>
44+
<Button variant="ghost">Sign in</Button>
45+
<Button>Sign up</Button>
46+
</>
47+
)}
48+
</HStack>
49+
</Flex>
50+
</chakra.header>
51+
);
52+
};

0 commit comments

Comments
 (0)