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

Commit a607b24

Browse files
committed
feat: select whether to show times or not
1 parent acc0db8 commit a607b24

File tree

4 files changed

+30
-12
lines changed

4 files changed

+30
-12
lines changed

apps/client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "client",
3-
"version": "1.5.5-beta",
3+
"version": "1.5.6-beta",
44
"scripts": {
55
"dev": "npm-run-all --parallel dev:*",
66
"dev:run": "FORCE_COLOR=1 vite",

apps/client/src/routes/Main/Home/Period.tsx

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,28 @@ export default function Period({
4646
none: "transparent",
4747
}[periodColours];
4848

49+
const showTimes = useSettingsStore((state) => state.showTimes);
50+
4951
return (
5052
<Skeleton
5153
display="flex"
5254
fontFamily={"Poppins, sans-serifs"}
5355
isLoaded={isLoaded}
5456
mb={!isBreak || !isLoaded ? 1 : undefined}
5557
>
56-
<Text
57-
fontSize={"xs"}
58-
minW="fit-content"
59-
w="9ch"
60-
mr={2}
61-
textAlign={"right"}
62-
color={fadedOut}
63-
alignSelf={"center"}
64-
>
65-
{DateTime.fromISO(startTime).toFormat("h:mm a")}
66-
</Text>
58+
{showTimes && (
59+
<Text
60+
fontSize={"xs"}
61+
minW="fit-content"
62+
w="9ch"
63+
mr={2}
64+
textAlign={"right"}
65+
color={fadedOut}
66+
alignSelf={"center"}
67+
>
68+
{DateTime.fromISO(startTime).toFormat("h:mm a")}
69+
</Text>
70+
)}
6771
<Flex
6872
bg={!isBreak ? bgColor : undefined}
6973
rounded={"lg"}

apps/client/src/routes/Main/Settings/General.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ export default function General() {
102102
setBgImage,
103103
darkenBlur,
104104
setDarkenBlur,
105+
setShowTimes,
106+
showTimes,
105107
} = useSettingsStore();
106108

107109
const [deleting, setDeleting] = useState(false);
@@ -130,6 +132,14 @@ export default function General() {
130132
</RadioGroup>
131133
</FormControl>
132134

135+
<FormControl display="flex" alignItems="center">
136+
<FormLabel mb="0">Show Times</FormLabel>
137+
<Switch
138+
onChange={() => setShowTimes(!showTimes)}
139+
isChecked={showTimes}
140+
/>
141+
</FormControl>
142+
133143
<FormControl display="flex" alignItems="center">
134144
<FormLabel mb="0">Background Image</FormLabel>
135145
<Input

apps/client/src/stores/settings/settings.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,23 @@ export type Actions = {
88
reset: () => void;
99
setBgImage: (bgImage: string) => void;
1010
setDarkenBlur: (darkenBlur: boolean) => void;
11+
setShowTimes: (showTimes: boolean) => void;
1112
};
1213

1314
export type SettingsState = {
1415
primary: ColourScheme;
1516
periodColours: "default" | "primary" | "none";
1617
bgImage: string;
1718
darkenBlur: boolean;
19+
showTimes: boolean;
1820
};
1921

2022
export const initialState: SettingsState = {
2123
primary: "blue",
2224
periodColours: "default",
2325
bgImage: "",
2426
darkenBlur: true,
27+
showTimes: true,
2528
};
2629

2730
export const useSettingsStore = create<SettingsState & Actions>()(
@@ -33,6 +36,7 @@ export const useSettingsStore = create<SettingsState & Actions>()(
3336
setPeriodColours: (periodColours) => set({ periodColours }),
3437
setBgImage: (bgImage) => set({ bgImage }),
3538
setDarkenBlur: (darkenBlur) => set({ darkenBlur }),
39+
setShowTimes: (showTimes) => set({ showTimes }),
3640
reset: () => set(initialState),
3741
}),
3842
{

0 commit comments

Comments
 (0)