From a70a9ec097ef7f5d582ab6e77d2f3167dd8488e2 Mon Sep 17 00:00:00 2001
From: H0llyW00dzZ <priv8@btz.pm>
Date: Sun, 12 Nov 2023 03:04:24 +0700
Subject: [PATCH] Chore UI/UX Page (#85)

* Chore UI/UX Page [Change Log]

[+] chore(changelog.tsx): remove unused onClose prop from ChangeLog component
[+] fix(changelog.tsx): fix formatting of descriptionWithLinks variable

* Chore UI/UX Page [Change Log & Privacy Page] [Styles]

[+] chore(changelog.module.scss): add user-select property to enable text selection
[+] chore(privacy.module.scss): add user-select property to enable text selection
---
 app/components/changelog.module.scss |  1 +
 app/components/changelog.tsx         | 11 ++++++-----
 app/components/privacy.module.scss   |  1 +
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/app/components/changelog.module.scss b/app/components/changelog.module.scss
index 75cd3b285d1..f51dae5acc2 100644
--- a/app/components/changelog.module.scss
+++ b/app/components/changelog.module.scss
@@ -43,6 +43,7 @@
     overflow: auto; /* Enable scrolling */
     width: 95%; /* Set the desired width */
     margin-top: auto; /* Add margin for spacing */
+    user-select: text; /* Copyable */
   }
 
   .changelog-actions {
diff --git a/app/components/changelog.tsx b/app/components/changelog.tsx
index fa7f7314071..0674fdbb2f4 100644
--- a/app/components/changelog.tsx
+++ b/app/components/changelog.tsx
@@ -15,7 +15,7 @@ const Markdown = dynamic(async () => (await import("./markdown")).Markdown, {
   loading: () => <LoadingIcon />,
 });
 
-export function ChangeLog(props: { onClose?: () => void }) {
+export function ChangeLog() {
   const navigate = useNavigate();
   const [mdText, setMdText] = useState("");
   const [pageTitle] = useState("📌 Change Log 📝");
@@ -52,9 +52,11 @@ export function ChangeLog(props: { onClose?: () => void }) {
         const authorSection = `[${author.replace("[bot]", "").replace(/\s/g, "")}](https://github.com/${author.replace("[bot]", "").replace(/\s/g, "")}) ${coAuthorsSection}`;
         const prLinkRegex = /#(\d+)/g; // Regular expression to match '#<number>' ref : autolinks github
         const prLink = commitInfo?.commitMessage.summary.replace(prLinkRegex, '[$&](https://github.com/H0llyW00dzZ/ChatGPT-Next-Web/pull/$1/commits)');
-        const descriptionWithLinks = commitInfo?.commitMessage.description.map((change: string) =>
-          change.replace(prLinkRegex, '[$&](https://github.com/H0llyW00dzZ/ChatGPT-Next-Web/pull/$1/commits)')
-        ).join('\n\n\n');
+        const descriptionWithLinks = commitInfo?.commitMessage.description
+          .map((change: string) =>
+            change.replace(prLinkRegex, '[$&](https://github.com/H0llyW00dzZ/ChatGPT-Next-Web/pull/$1/commits)')
+          )
+          .join('\n\n\n');
 
         table += `\n\n\n![GitHub contributors](https://img.shields.io/github/contributors/Yidadaa/ChatGPT-Next-Web.svg) ![GitHub commits](https://badgen.net/github/commits/H0llyW00dzZ/ChatGPT-Next-Web) ![GitHub license](https://img.shields.io/github/license/H0llyW00dzZ/ChatGPT-Next-Web) [![GitHub forks](https://img.shields.io/github/forks/Yidadaa/ChatGPT-Next-Web.svg)](https://github.com/Yidadaa/ChatGPT-Next-Web/network/members) [![GitHub stars](https://img.shields.io/github/stars/Yidadaa/ChatGPT-Next-Web.svg)](https://github.com/Yidadaa/ChatGPT-Next-Web/stargazers) [![Github All Releases](https://img.shields.io/github/downloads/Yidadaa/ChatGPT-Next-Web/total.svg)](https://github.com/Yidadaa/ChatGPT-Next-Web/releases/) [![CI: CodeQL Unit Testing Advanced](https://github.com/H0llyW00dzZ/ChatGPT-Next-Web/actions/workflows/codeql.yml/badge.svg)](https://github.com/H0llyW00dzZ/ChatGPT-Next-Web/actions/workflows/codeql.yml) \n\n\n  [![GitHub](https://img.shields.io/badge/--181717?logo=github&logoColor=ffffff)](https://github.com/${author}) ![${author.replace("[bot]", "")}](https://github.com/${author.replace("[bot]", "")}.png?size=25) ${authorSection} :\n\n${prLink}\n\n\n${descriptionWithLinks}\n\n\n\n\n\n`;
       } else {
@@ -65,7 +67,6 @@ export function ChangeLog(props: { onClose?: () => void }) {
     };
 
     fetchData();
-
   }, []);
 
   const goHome = () => {
diff --git a/app/components/privacy.module.scss b/app/components/privacy.module.scss
index 43b9673948a..d6b5eb1acef 100644
--- a/app/components/privacy.module.scss
+++ b/app/components/privacy.module.scss
@@ -51,6 +51,7 @@
     overflow: auto; /* Enable scrolling */
     width: 95%; /* Set the desired width */
     margin-top: auto; /* Add margin for spacing */
+    user-select: text; /* Copyable */
   }
 
   .privacy-actions {