|
1 | | -import { |
2 | | - Box, |
3 | | - Burger, |
4 | | - Button, |
5 | | - Divider, |
6 | | - Drawer, |
7 | | - Group, |
8 | | - ScrollArea, |
9 | | - rem, |
10 | | - useMantineTheme, |
11 | | -} from '@mantine/core'; |
12 | | -import { useDisclosure } from '@mantine/hooks'; |
| 1 | +import { Box, Button, Flex, Group, rem, Text } from '@mantine/core'; |
13 | 2 | import ReactLogo from '@/shared/assets/react.svg?react'; |
14 | 3 |
|
15 | 4 | export function Header() { |
16 | | - const [drawerOpened, { toggle: toggleDrawer, close: closeDrawer }] = |
17 | | - useDisclosure(false); |
18 | | - const theme = useMantineTheme(); |
19 | | - |
20 | | - // Shared link styles to avoid repetition |
21 | | - const linkStyles = { |
22 | | - display: 'flex', |
23 | | - alignItems: 'center', |
24 | | - height: '100%', |
25 | | - paddingLeft: theme.spacing.md, |
26 | | - paddingRight: theme.spacing.md, |
27 | | - textDecoration: 'none', |
28 | | - fontWeight: 500, |
29 | | - fontSize: theme.fontSizes.sm, |
30 | | - color: 'light-dark(var(--mantine-color-black), var(--mantine-color-white))', |
31 | | - borderRadius: theme.radius.sm, |
32 | | - transition: 'background-color 100ms ease', |
33 | | - }; |
34 | | - |
35 | 5 | return ( |
36 | 6 | <Box> |
37 | 7 | <header |
38 | 8 | style={{ |
39 | 9 | height: rem(60), |
40 | 10 | paddingLeft: 'var(--mantine-spacing-md)', |
41 | 11 | paddingRight: 'var(--mantine-spacing-md)', |
42 | | - borderBottom: `${rem(1)} solid light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-4))`, |
| 12 | + borderBottom: `${rem(1)} solid light-dark(var(--mantine-color-gray-1), var(--mantine-color-dark-3))`, |
43 | 13 | }} |
44 | 14 | > |
45 | 15 | <Group justify="space-between" h="100%"> |
46 | | - <ReactLogo width={30} height={30} /> |
47 | | - |
48 | | - {/* Desktop Navigation */} |
49 | | - <Group h="100%" gap={0} visibleFrom="sm"> |
50 | | - <Box component="a" href="#" style={linkStyles}> |
51 | | - Home |
52 | | - </Box> |
53 | | - </Group> |
54 | | - |
| 16 | + <Flex |
| 17 | + mih={50} |
| 18 | + gap="md" |
| 19 | + justify="center" |
| 20 | + align="center" |
| 21 | + direction="row" |
| 22 | + wrap="wrap" |
| 23 | + > |
| 24 | + <ReactLogo |
| 25 | + width={25} |
| 26 | + height={25} |
| 27 | + style={{ filter: 'grayscale(1) brightness(0) invert(1)' }} |
| 28 | + /> |
| 29 | + <Text size="lg">Generic</Text> |
| 30 | + </Flex> |
55 | 31 | <Group visibleFrom="sm"> |
56 | | - <Button variant="default">Log in</Button> |
57 | | - <Button>Sign up</Button> |
| 32 | + <Button variant="default">Sign In</Button> |
58 | 33 | </Group> |
59 | | - |
60 | | - <Burger |
61 | | - opened={drawerOpened} |
62 | | - onClick={toggleDrawer} |
63 | | - hiddenFrom="sm" |
64 | | - /> |
65 | 34 | </Group> |
66 | 35 | </header> |
67 | | - |
68 | | - <Drawer |
69 | | - opened={drawerOpened} |
70 | | - onClose={closeDrawer} |
71 | | - size="100%" |
72 | | - padding="md" |
73 | | - title="Menu" |
74 | | - hiddenFrom="sm" |
75 | | - zIndex={1000000} |
76 | | - > |
77 | | - <ScrollArea h={`calc(100vh - ${rem(80)})`} mx="-md"> |
78 | | - <Divider my="sm" /> |
79 | | - |
80 | | - {/* Mobile Navigation */} |
81 | | - <Box |
82 | | - component="a" |
83 | | - href="#" |
84 | | - style={{ |
85 | | - ...linkStyles, |
86 | | - height: rem(42), |
87 | | - width: '100%', |
88 | | - }} |
89 | | - > |
90 | | - Home |
91 | | - </Box> |
92 | | - |
93 | | - <Divider my="sm" /> |
94 | | - |
95 | | - <Group justify="center" grow pb="xl" px="md"> |
96 | | - <Button variant="default">Log in</Button> |
97 | | - <Button>Sign up</Button> |
98 | | - </Group> |
99 | | - </ScrollArea> |
100 | | - </Drawer> |
101 | 36 | </Box> |
102 | 37 | ); |
103 | 38 | } |
0 commit comments