From 0f442277ed5ee5358e73535aa9230924dbf2e473 Mon Sep 17 00:00:00 2001 From: mauro-balades Date: Tue, 10 Sep 2024 22:41:28 +0200 Subject: [PATCH] feat: Add moment dependency and update release notes page This commit adds the moment dependency to the project by updating the package-lock.json and package.json files. It also updates the release notes page by modifying the layout and adding a paragraph to thank users for their feedback. --- package-lock.json | 9 ++ package.json | 1 + src/app/globals.css | 2 +- src/app/release-notes/page.tsx | 7 +- src/components/release-note.tsx | 163 ++++++++++++++++++-------------- 5 files changed, 108 insertions(+), 74 deletions(-) diff --git a/package-lock.json b/package-lock.json index 549af68..5facd13 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,6 +31,7 @@ "feed": "^4.2.2", "framer-motion": "^11.3.24", "lucide-react": "^0.400.0", + "moment": "^2.30.1", "next": "14.2.4", "next-themes": "^0.3.0", "react": "^18.3.1", @@ -14115,6 +14116,14 @@ "mkdirp": "bin/cmd.js" } }, + "node_modules/moment": { + "version": "2.30.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", + "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==", + "engines": { + "node": "*" + } + }, "node_modules/mri": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", diff --git a/package.json b/package.json index 2ef303d..4e230ee 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "feed": "^4.2.2", "framer-motion": "^11.3.24", "lucide-react": "^0.400.0", + "moment": "^2.30.1", "next": "14.2.4", "next-themes": "^0.3.0", "react": "^18.3.1", diff --git a/src/app/globals.css b/src/app/globals.css index 1197e25..064b2c8 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -51,7 +51,7 @@ } [data-theme='dark'], .dark { - --background: 0 0% 0%; + --background: 5 5 5; --foreground: 0 0% 98%; --surface: rgb(23, 23, 23); diff --git a/src/app/release-notes/page.tsx b/src/app/release-notes/page.tsx index 829dbc3..d9ae4a3 100644 --- a/src/app/release-notes/page.tsx +++ b/src/app/release-notes/page.tsx @@ -9,8 +9,11 @@ import Link from "next/link"; export default function ReleaseNotes() { return (
-
-

Release Notes

+
+

Release Notes

+

+ Stay up to date with the latest changes to Zen Browser! Since the first release till {releaseNotes[0].version}, we've been working hard to make Zen Browser the best it can be.

Thanks everyone for your feedback! ❤️ +

{releaseNotes.map((releaseNote) => ( ))} diff --git a/src/components/release-note.tsx b/src/components/release-note.tsx index a17f6c6..c1e0bf1 100644 --- a/src/components/release-note.tsx +++ b/src/components/release-note.tsx @@ -1,16 +1,26 @@ -import { ReleaseNote } from "@/lib/release-notes"; +import { ReleaseNote, releaseNotes } from "@/lib/release-notes"; import { ExclamationTriangleIcon } from "@radix-ui/react-icons"; import { CheckCheckIcon, StarIcon } from "lucide-react"; import StickyBox from "react-sticky-box"; +import moment from "moment"; +import { Accordion, AccordionItem } from "@radix-ui/react-accordion"; +import { AccordionContent, AccordionTrigger } from "./ui/accordion"; +import { ny } from "@/lib/utils"; + export default function ReleaseNoteElement({ data }: { data: ReleaseNote }) { + const splitDate = data.date.split("/"); return ( -
- - {data.date} +
+ + {moment({ + year: parseInt(splitDate[2]), + month: parseInt(splitDate[1]) - 1, + day: parseInt(splitDate[0]), + }).format('MMMM Do, YYYY')} -
-

+
+

Release notes for {data.version} 🎉

@@ -25,76 +35,87 @@ export default function ReleaseNoteElement({ data }: { data: ReleaseNote }) {

{data.extra && (

"), }} >

)} - {data.breakingChanges && ( - <> -

- - Breaking changes -

-

- The following changes may break existing functionality: -

-
    - {data.breakingChanges?.map((change, index) => ( -
  • - {change} -
  • - ))} -
- - )} - {data.features && ( - <> -

- - Features -

-

- The following features have been added: -

-
    - {data.features?.map((feature, index) => ( -
  • - {feature} -
  • - ))} -
- - )} - {data.fixes && ( - <> -

- - Fixes -

-

- The following issues have been fixed: -

- - - )} + + {data.breakingChanges && ( + + +
+ + Breaking Changes +
+
+ +
    + {data.breakingChanges.map((change) => ( +
  • + + {change} + +
  • + ))} +
+
+
+ ) + } + {data.fixes && ( + + +
+ + Fixes +
+
+ +
    + {data.fixes.map((fix) => ( +
  • + + {fix.description} + + {fix.issue && ( + + #{fix.issue} + + )} +
  • + ))} +
+
+
+ )} + {data.features && ( + + +
+ + Features +
+
+ +
    + {data.features.map((feature) => ( +
  • + + {feature} + +
  • + ))} +
+
+
+ )} +
-

+
); }