From 847b4605f40c77aa241223f08c5a9c89c16811be Mon Sep 17 00:00:00 2001 From: boojack Date: Fri, 30 Jun 2023 08:40:13 +0800 Subject: [PATCH] chore: update dark mode style (#1864) --- web/src/components/Header.tsx | 2 +- web/src/components/Settings/MemberSection.tsx | 101 ++++++++++-------- .../components/Settings/MyAccountSection.tsx | 10 +- web/src/components/kit/DatePicker.tsx | 13 +-- web/src/components/kit/Dropdown.tsx | 2 +- web/src/less/common/selector.less | 2 +- web/src/less/memo-editor.less | 2 +- web/src/less/setting.less | 6 +- web/src/less/settings/member-section.less | 36 +------ web/src/pages/DailyReview.tsx | 2 +- 10 files changed, 75 insertions(+), 101 deletions(-) diff --git a/web/src/components/Header.tsx b/web/src/components/Header.tsx index 325f01aa..576cca89 100644 --- a/web/src/components/Header.tsx +++ b/web/src/components/Header.tsx @@ -134,7 +134,7 @@ const Header = () => {
- {user.rowStatus === "NORMAL" ? ( - - ) : ( + + + + + + + + + + {userList.map((user) => ( + + + + + + ))} + +
ID{t("common.username")}
{user.id}{user.username} + {currentUser?.id === user.id ? ( + {t("common.yourself")} + ) : ( + - + {user.rowStatus === "NORMAL" ? ( + + ) : ( + <> + + + + )} - )} - - } - /> - )} - - - ))} + } + /> + )} +
); }; diff --git a/web/src/components/Settings/MyAccountSection.tsx b/web/src/components/Settings/MyAccountSection.tsx index 368ad156..352612cb 100644 --- a/web/src/components/Settings/MyAccountSection.tsx +++ b/web/src/components/Settings/MyAccountSection.tsx @@ -35,16 +35,16 @@ const MyAccountSection = () => {
{user.nickname} - ({user.username}) + ({user.username})
{user.email}
- - + +
diff --git a/web/src/components/kit/DatePicker.tsx b/web/src/components/kit/DatePicker.tsx index 2eb7786f..1cf7c200 100644 --- a/web/src/components/kit/DatePicker.tsx +++ b/web/src/components/kit/DatePicker.tsx @@ -1,3 +1,4 @@ +import { Badge, Button } from "@mui/joy"; import { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import { DAILY_TIMESTAMP } from "@/helpers/consts"; @@ -73,15 +74,15 @@ const DatePicker: React.FC = (props: DatePickerProps) => { return (
- handleChangeMonthBtnClick(-1)}> + {firstDate.getFullYear()}/{firstDate.getMonth() + 1} - handleChangeMonthBtnClick(1)}> +
@@ -105,10 +106,10 @@ const DatePicker: React.FC = (props: DatePickerProps) => { return ( handleDateItemClick(d.datestamp)} > - {d.date} + {countByDate.has(d.datestamp) ? {d.date} : d.date} ); } diff --git a/web/src/components/kit/Dropdown.tsx b/web/src/components/kit/Dropdown.tsx index bc100358..f21c6e19 100644 --- a/web/src/components/kit/Dropdown.tsx +++ b/web/src/components/kit/Dropdown.tsx @@ -43,7 +43,7 @@ const Dropdown: React.FC = (props: Props) => { )}
diff --git a/web/src/less/common/selector.less b/web/src/less/common/selector.less index 0e72106e..fbd018ba 100644 --- a/web/src/less/common/selector.less +++ b/web/src/less/common/selector.less @@ -28,7 +28,7 @@ } > .items-wrapper { - @apply flex flex-col justify-start items-start absolute top-full left-0 w-auto p-1 mt-1 -ml-2 bg-white dark:bg-zinc-700 dark:border-zinc-600 rounded-md overflow-y-auto z-1 hide-scrollbar; + @apply flex flex-col justify-start items-start absolute top-full left-0 w-auto p-1 mt-1 -ml-2 bg-white dark:bg-zinc-800 dark:border-zinc-600 rounded-md overflow-y-auto z-1 hide-scrollbar; min-width: calc(100% + 16px); max-height: 256px; box-shadow: 0 0 8px 0 rgb(0 0 0 / 20%); diff --git a/web/src/less/memo-editor.less b/web/src/less/memo-editor.less index 596d5bbe..95fc9945 100644 --- a/web/src/less/memo-editor.less +++ b/web/src/less/memo-editor.less @@ -33,7 +33,7 @@ @apply flex flex-row justify-start items-center; > .action-btn { - @apply flex flex-row justify-center items-center p-1 w-auto h-auto mr-1 select-none rounded cursor-pointer text-gray-600 dark:text-gray-200 hover:bg-gray-300 dark:hover:bg-zinc-800 hover:shadow; + @apply flex flex-row justify-center items-center p-1 w-auto h-auto mr-1 select-none rounded cursor-pointer text-gray-600 dark:text-gray-400 hover:bg-gray-300 dark:hover:bg-zinc-800 hover:shadow; > .icon-img { @apply w-5 h-5 mx-auto flex flex-row justify-center items-center; diff --git a/web/src/less/setting.less b/web/src/less/setting.less index c48b2cc0..e8f116b1 100644 --- a/web/src/less/setting.less +++ b/web/src/less/setting.less @@ -12,10 +12,10 @@ @apply w-full h-auto flex flex-row sm:flex-col justify-start items-start; > .section-item { - @apply flex flex-row justify-start items-center text-base select-none mr-3 sm:mr-0 mt-0 sm:mt-2 text-gray-700 dark:text-gray-300 cursor-pointer hover:opacity-80; + @apply flex flex-row justify-start items-center text-base select-none mr-3 sm:mr-0 mt-0 sm:mt-2 text-gray-700 dark:text-gray-400 cursor-pointer hover:opacity-80; &.selected { - @apply font-bold hover:opacity-100; + @apply font-bold dark:text-gray-300 hover:opacity-100; } > .icon-text { @@ -32,7 +32,7 @@ @apply flex flex-col justify-start items-start w-full; .title-text { - @apply text-sm mt-4 first:mt-2 mb-3 font-mono text-gray-500; + @apply text-sm mt-4 first:mt-2 mb-3 font-mono text-gray-500 dark:text-gray-400; } > .form-label { diff --git a/web/src/less/settings/member-section.less b/web/src/less/settings/member-section.less index 9328a482..d667516e 100644 --- a/web/src/less/settings/member-section.less +++ b/web/src/less/settings/member-section.less @@ -6,7 +6,7 @@ @apply w-full mb-3 flex flex-row justify-start items-center; > .field-text { - @apply text-sm text-gray-600 w-20 text-right pr-2; + @apply text-sm text-gray-600 dark:text-gray-400 w-20 text-right pr-2; } > input { @@ -18,38 +18,4 @@ @apply w-full mb-6 pl-20 flex flex-row justify-start items-center; } } - - > .field-container { - > .field-text { - @apply text-gray-400 text-sm; - - &.username-field { - @apply col-span-2 w-full; - } - } - } - - > .member-container { - @apply w-full grid grid-cols-4 border-b dark:border-b-zinc-700 py-2; - - > .field-text { - @apply text-base pl-2 mr-4 w-16 truncate; - - &.id-text { - @apply font-mono text-gray-400; - } - - &.username-text { - @apply w-auto col-span-2; - } - } - - > .buttons-container { - @apply col-span-1 flex flex-row justify-end items-center; - - > .tip-text { - @apply text-gray-400; - } - } - } } diff --git a/web/src/pages/DailyReview.tsx b/web/src/pages/DailyReview.tsx index d9a43d06..158c2f6f 100644 --- a/web/src/pages/DailyReview.tsx +++ b/web/src/pages/DailyReview.tsx @@ -117,7 +117,7 @@ const DailyReview = () => {