Skip to content
This repository was archived by the owner on Aug 2, 2025. It is now read-only.

Commit 5b9171b

Browse files
committed
fix: SidebarButtons has equal width on mobile
1 parent f5f5184 commit 5b9171b

File tree

3 files changed

+14
-17
lines changed

3 files changed

+14
-17
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "timetabl-app",
3-
"version": "1.0.7-beta",
3+
"version": "1.0.8-beta",
44
"description": "",
55
"main": "index.js",
66
"scripts": {

src/components/Sidebar/Sidebar.tsx

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { Link } from "react-router-dom";
1+
import { Link as RouterLink } from "react-router-dom";
22
import SidebarButton from "./SidebarButton";
33
import { Barcode, CalendarBlank, House, Megaphone } from "phosphor-react";
4-
import { Flex, useColorModeValue } from "@chakra-ui/react";
4+
import { Flex, useColorModeValue, Box } from "@chakra-ui/react";
55

66
export default ({
77
pathname,
@@ -11,54 +11,52 @@ export default ({
1111
sidebar: boolean;
1212
}) => (
1313
<Flex
14-
minW={"fit-content"}
15-
w={{ base: "100%", md: "auto" }}
14+
w={{ base: "100%", md: "100px" }}
1615
h={{ base: "auto", md: "100%" }}
1716
direction={{ base: "row", md: "column" }}
18-
justify={{ base: "space-evenly", md: "flex-start" }}
1917
position={"fixed"}
2018
top={{ md: "80px", base: "auto" }}
2119
bottom={{ base: 0, md: "auto" }}
2220
left={0}
2321
zIndex={100}
2422
bg={useColorModeValue("white", "gray.800")}
2523
border={"1px"}
26-
borderTop="none"
24+
borderTop={{ md: "none" }}
2725
borderColor={useColorModeValue("gray.200", "gray.700")}
2826
>
29-
<Link to={"/app"}>
27+
<Box as={RouterLink} to={"/app"} w="full">
3028
<SidebarButton
3129
sidebar={sidebar}
3230
name={"Home"}
3331
active={pathname === "/app"}
3432
icon={House}
3533
/>
36-
</Link>
37-
<Link to={"/app/barcodes"}>
34+
</Box>
35+
<Box as={RouterLink} to={"/app/barcodes"} w="full">
3836
<SidebarButton
3937
sidebar={sidebar}
4038
name={"Barcodes"}
4139
active={pathname === "/app/barcodes"}
4240
icon={Barcode}
4341
/>
44-
</Link>
45-
<Link to={"/app/announcements"}>
42+
</Box>
43+
<Box as={RouterLink} to={"/app/announcements"} w="full">
4644
<SidebarButton
4745
sidebar={sidebar}
48-
name={"Announcements"}
46+
name={"Notices"}
4947
active={pathname === "/app/announcements"}
5048
icon={Megaphone}
5149
mirrored
5250
/>
53-
</Link>
54-
<Link to={"/app/calendar"}>
51+
</Box>
52+
<Box as={RouterLink} to={"/app/calendar"} w="full">
5553
<SidebarButton
5654
sidebar={sidebar}
5755
name={"Calendar"}
5856
active={pathname === "/app/calendar"}
5957
icon={CalendarBlank}
6058
mirrored
6159
/>
62-
</Link>
60+
</Box>
6361
</Flex>
6462
);

src/components/Sidebar/SidebarButton.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export default ({
3131
p={"12px"}
3232
h={"64px"}
3333
w="100%"
34-
flexGrow={1}
3534
direction={"column"}
3635
align={"center"}
3736
>

0 commit comments

Comments
 (0)