-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNavBar.jsx
54 lines (51 loc) · 1.57 KB
/
NavBar.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import { Box, Button, ButtonGroup, Flex, IconButton, useBreakpointValue } from "@chakra-ui/react";
import { useNavigate } from "react-router-dom";
import React from "react";
import DuckIcon from './Duck.png'; // Import the Duck image
function Navbar() {
const isDesktop = useBreakpointValue({
base: true,
sm: false,
md: true,
lg: true,
});
const navigate = useNavigate();
return (
<Box as="nav" bg="bg-surface" boxShadow="sm" p={4}>
<Flex align="center" width="100%">
{}
<img
src={DuckIcon} // Use the Duck.png image
width="70px"
alt="Duck Logo"
style={{ marginLeft: "30px" }}
onClick={() => navigate("/")} // Navigate to the home page on click
/>
{isDesktop ? (
<Flex justify="flex-start" flex="1" marginLeft="30px">
<ButtonGroup variant="link" spacing="8">
<Button key="Home" onClick={() => navigate('/')} variant="ghost">
Home
</Button>
<Button key="Design" onClick={() => navigate('/design')} variant="ghost">
Design
</Button>
<Button key="Weather" onClick={() => navigate('/weather')} variant="ghost">
Weather
</Button>
</ButtonGroup>
</Flex>
) : (
<IconButton
alignSelf="center"
marginLeft="auto"
marginRight="10px"
variant="ghost"
aria-label="Open Menu"
/>
)}
</Flex>
</Box>
);
}
export default Navbar;