From 06f15fc8faef6c2323634899c5eb7a9f09bd511e Mon Sep 17 00:00:00 2001 From: Kevin-Umali Date: Sat, 30 Sep 2023 13:14:16 +0800 Subject: [PATCH] Fix page slow api call, update openai prompt and added theme for dark/light mode --- client/src/components/CustomMarkdown.tsx | 2 +- client/src/components/Navbar.tsx | 12 +-- .../components/generate/CategoryFilter.tsx | 2 +- .../src/components/generate/PurposeFilter.tsx | 8 +- client/src/main.tsx | 3 +- client/src/pages/Home.tsx | 7 +- client/src/styles/theme.ts | 66 ++++++++++++++ server/src/controllers/openai.controller.ts | 87 ++++++++++--------- 8 files changed, 125 insertions(+), 62 deletions(-) create mode 100644 client/src/styles/theme.ts diff --git a/client/src/components/CustomMarkdown.tsx b/client/src/components/CustomMarkdown.tsx index 1197b36..5b18110 100644 --- a/client/src/components/CustomMarkdown.tsx +++ b/client/src/components/CustomMarkdown.tsx @@ -60,7 +60,7 @@ const CustomMarkdown: React.FC = ({ content }) => { component: Link, props: { mb: 2, textDecorationLine: "underline" }, }, - img: { component: Image, props: { mb: 4, loading: "lazy" } }, + img: { component: Image, props: { mb: 4 } }, pre: { component: MarkdownPre, props: { mb: 4 }, diff --git a/client/src/components/Navbar.tsx b/client/src/components/Navbar.tsx index 9e76fb6..940b371 100644 --- a/client/src/components/Navbar.tsx +++ b/client/src/components/Navbar.tsx @@ -7,17 +7,7 @@ const Navbar: React.FC = () => { const { colorMode, toggleColorMode } = useColorMode(); return ( - + diff --git a/client/src/components/generate/CategoryFilter.tsx b/client/src/components/generate/CategoryFilter.tsx index 5f83e4a..e2fbf42 100644 --- a/client/src/components/generate/CategoryFilter.tsx +++ b/client/src/components/generate/CategoryFilter.tsx @@ -11,7 +11,7 @@ const CategoryFilter: React.FC = ({ categories, onCategoryC Category: - onCategoryChange(e.target.value)}> {categories.map((category) => (