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

Commit b9c3779

Browse files
committed
feat: added release notes
1 parent ea25120 commit b9c3779

File tree

5 files changed

+67
-3
lines changed

5 files changed

+67
-3
lines changed

apps/client/RELEASE_NOTES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
You can open release notes by going to Settings -> About -> Release notes.
2+
3+
## 1.9.8-beta
4+
5+
- Added release notes
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import releaseNotes from "../../../RELEASE_NOTES.md?raw";
2+
import {
3+
Modal,
4+
ModalBody,
5+
ModalCloseButton,
6+
ModalContent,
7+
ModalHeader,
8+
ModalOverlay,
9+
} from "@chakra-ui/react";
10+
import { Prose } from "@nikolovlazar/chakra-ui-prose";
11+
import { micromark } from "micromark";
12+
13+
type ReleaseNotesProps = {
14+
isOpen: boolean;
15+
onClose: () => void;
16+
};
17+
18+
export default function ReleaseNotes(props: ReleaseNotesProps) {
19+
return (
20+
<Modal {...props}>
21+
<ModalOverlay />
22+
<ModalContent>
23+
<ModalHeader>Release Notes</ModalHeader>
24+
<ModalCloseButton />
25+
<ModalBody>
26+
<Prose>
27+
<div
28+
dangerouslySetInnerHTML={{ __html: micromark(releaseNotes) }}
29+
/>
30+
</Prose>
31+
</ModalBody>
32+
</ModalContent>
33+
</Modal>
34+
);
35+
}

apps/client/src/components/ReleaseNotes/index.ts

Whitespace-only changes.

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
import { version } from "../../../package.json";
12
import { BottomNav } from "../../components/BottomNav";
3+
import ReleaseNotes from "../../components/ReleaseNotes/ReleaseNotes";
24
import Sidebar from "../../components/Sidebar";
35
import { useAuthActions } from "../../services/UserInterface";
46
import { useIsLoggedIn } from "../../stores/auth";
@@ -13,6 +15,7 @@ import {
1315
ModalBody,
1416
Button,
1517
Heading,
18+
useDisclosure,
1619
} from "@chakra-ui/react";
1720
import { useEffect } from "react";
1821
import { Outlet, useNavigate } from "react-router-dom";
@@ -22,6 +25,19 @@ export default function Main() {
2225
const loggedIn = useIsLoggedIn();
2326
const { logout } = useAuthActions();
2427
const isLargerThanMd = useBreakpointValue({ base: false, md: true });
28+
const { onOpen, isOpen, onClose } = useDisclosure();
29+
30+
useEffect(() => {
31+
const storedVersion = localStorage.getItem("appVersion");
32+
33+
if (
34+
storedVersion !== version &&
35+
localStorage.getItem("consentedToWelcomeMessage")
36+
) {
37+
onOpen();
38+
localStorage.setItem("appVersion", version);
39+
}
40+
});
2541

2642
useEffect(() => {
2743
if (!loggedIn) {
@@ -92,6 +108,7 @@ export default function Main() {
92108
</ModalContent>
93109
</Modal>
94110
</Flex>
111+
<ReleaseNotes onClose={onClose} isOpen={isOpen} />
95112
</>
96113
);
97114
}

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { version } from "../../../../package.json";
2+
import ReleaseNotes from "../../../components/ReleaseNotes/ReleaseNotes";
23
import { ExternalLinkIcon } from "@chakra-ui/icons";
34
import {
45
Accordion,
@@ -7,12 +8,16 @@ import {
78
AccordionItem,
89
AccordionPanel,
910
Box,
11+
Button,
1012
Heading,
1113
Link,
1214
Text,
15+
useDisclosure,
1316
} from "@chakra-ui/react";
1417

1518
export default function About() {
19+
const { isOpen, onOpen, onClose } = useDisclosure();
20+
1621
return (
1722
<>
1823
<Heading size={"sm"} fontFamily="Poppins, sans-serif">
@@ -22,6 +27,10 @@ export default function About() {
2227
Timetabl is a blazing fast, offline-enabled, installable timetable app
2328
for SBHS.
2429
</Text>
30+
<Button variant={"outline"} alignSelf={"flex-start"} onClick={onOpen}>
31+
Release notes
32+
</Button>
33+
<ReleaseNotes isOpen={isOpen} onClose={onClose} />
2534
<Text>
2635
Source code can be found on Github{" "}
2736
<Link
@@ -57,9 +66,7 @@ export default function About() {
5766
</AccordionButton>
5867
<AccordionPanel>
5968
<Text whiteSpace="pre-line">
60-
{
61-
'Copyright (c) 2022 Hamzah Ahmed'
62-
}
69+
{"Copyright (c) 2022 Hamzah Ahmed"}
6370
</Text>
6471
</AccordionPanel>
6572
</AccordionItem>

0 commit comments

Comments
 (0)