From 73baeaa0adada5f6c169dff6791c71764fe611b3 Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 4 Jan 2024 08:32:14 +0800 Subject: [PATCH] chore: tweak dark mode styles --- web/src/components/HomeSidebarDrawer.tsx | 2 +- .../components/Inbox/MemoCommentMessage.tsx | 4 +-- .../components/Inbox/VersionUpdateMessage.tsx | 4 +-- web/src/components/MobileHeader.tsx | 6 ++--- web/src/components/Navigation.tsx | 24 ++++++++++------- web/src/components/NavigationDrawer.tsx | 4 +-- web/src/components/PersonalStatistics.tsx | 2 +- web/src/components/Settings/MemberSection.tsx | 4 +-- web/src/components/Settings/SSOSection.tsx | 19 +++++--------- .../components/Settings/StorageSection.tsx | 6 ++--- .../components/Settings/WebhookSection.tsx | 4 +-- web/src/components/UserBanner.tsx | 26 +------------------ web/src/layouts/Root.tsx | 2 +- web/src/pages/UserProfile.tsx | 7 ++++- 14 files changed, 47 insertions(+), 67 deletions(-) diff --git a/web/src/components/HomeSidebarDrawer.tsx b/web/src/components/HomeSidebarDrawer.tsx index 7a6741257..298bcf58e 100644 --- a/web/src/components/HomeSidebarDrawer.tsx +++ b/web/src/components/HomeSidebarDrawer.tsx @@ -23,7 +23,7 @@ const HomeSidebarDrawer = () => { return ( <> - +
diff --git a/web/src/components/Inbox/MemoCommentMessage.tsx b/web/src/components/Inbox/MemoCommentMessage.tsx index ce206d9b5..a29c4d6a7 100644 --- a/web/src/components/Inbox/MemoCommentMessage.tsx +++ b/web/src/components/Inbox/MemoCommentMessage.tsx @@ -64,7 +64,7 @@ const MemoCommentMessage = ({ inbox }: Props) => { "shrink-0 mt-2 p-2 rounded-full border", inbox.status === Inbox_Status.UNREAD ? "border-blue-600 text-blue-600 bg-blue-50 dark:bg-zinc-800" - : "border-gray-400 text-gray-400 bg-gray-50 dark:bg-zinc-800" + : "border-gray-500 text-gray-500 bg-gray-50 dark:bg-zinc-800" )} > @@ -73,7 +73,7 @@ const MemoCommentMessage = ({ inbox }: Props) => {
diff --git a/web/src/components/Inbox/VersionUpdateMessage.tsx b/web/src/components/Inbox/VersionUpdateMessage.tsx index a4dae615d..d32ac9e12 100644 --- a/web/src/components/Inbox/VersionUpdateMessage.tsx +++ b/web/src/components/Inbox/VersionUpdateMessage.tsx @@ -63,7 +63,7 @@ const VersionUpdateMessage = ({ inbox }: Props) => { "shrink-0 mt-2 p-2 rounded-full border", inbox.status === Inbox_Status.UNREAD ? "border-blue-600 text-blue-600 bg-blue-50 dark:bg-zinc-800" - : "border-gray-400 text-gray-400 bg-gray-50 dark:bg-zinc-800" + : "border-gray-500 text-gray-500 bg-gray-50 dark:bg-zinc-800" )} > @@ -72,7 +72,7 @@ const VersionUpdateMessage = ({ inbox }: Props) => {
diff --git a/web/src/components/MobileHeader.tsx b/web/src/components/MobileHeader.tsx index a4701fa57..754ae8bdd 100644 --- a/web/src/components/MobileHeader.tsx +++ b/web/src/components/MobileHeader.tsx @@ -11,7 +11,7 @@ interface Props { const MobileHeader = (props: Props) => { const { children } = props; const { sm } = useResponsiveWidth(); - const [titleText] = useState("MEMOS"); + const [titleText] = useState("Memos"); const { y: offsetTop } = useWindowScroll(); return ( @@ -24,8 +24,8 @@ const MobileHeader = (props: Props) => {
{!sm && } location.reload()} + className="font-bold text-lg leading-10 mr-1 text-ellipsis shrink-0 cursor-pointer overflow-hidden text-gray-700 dark:text-gray-300" + onDoubleClick={() => location.reload()} > {titleText} diff --git a/web/src/components/Navigation.tsx b/web/src/components/Navigation.tsx index f330279f7..4cdb83a8e 100644 --- a/web/src/components/Navigation.tsx +++ b/web/src/components/Navigation.tsx @@ -55,6 +55,18 @@ const Navigation = () => { title: t("common.resources"), icon: , }; + const exploreNavLink: NavLinkItem = { + id: "header-explore", + path: "/explore", + title: t("common.explore"), + icon: , + }; + const profileNavLink: NavLinkItem = { + id: "header-profile", + path: user ? `/u/${encodeURIComponent(user.username)}` : "", + title: t("common.profile"), + icon: , + }; const inboxNavLink: NavLinkItem = { id: "header-inbox", path: "/inbox", @@ -68,12 +80,6 @@ const Navigation = () => { ), }; - const exploreNavLink: NavLinkItem = { - id: "header-explore", - path: "/explore", - title: t("common.explore"), - icon: , - }; const archivedNavLink: NavLinkItem = { id: "header-archived", path: "/archived", @@ -94,7 +100,7 @@ const Navigation = () => { }; const navLinks: NavLinkItem[] = user - ? [homeNavLink, timelineNavLink, resourcesNavLink, exploreNavLink, inboxNavLink, archivedNavLink, settingNavLink] + ? [homeNavLink, timelineNavLink, resourcesNavLink, exploreNavLink, profileNavLink, inboxNavLink, archivedNavLink, settingNavLink] : [exploreNavLink, signInNavLink]; return ( @@ -105,8 +111,8 @@ const Navigation = () => { classNames( - "w-full px-4 pr-5 py-2 rounded-2xl border flex flex-row items-center text-lg text-gray-800 dark:text-gray-300 hover:bg-white hover:border-gray-200 dark:hover:border-zinc-600 dark:hover:bg-zinc-700", - isActive ? "bg-white drop-shadow-sm dark:bg-zinc-700 border-gray-200 dark:border-zinc-600" : "border-transparent" + "w-full px-4 pr-5 py-2 rounded-2xl border flex flex-row items-center text-lg text-gray-800 dark:text-gray-300 hover:bg-white hover:border-gray-200 dark:hover:border-zinc-700 dark:hover:bg-zinc-800", + isActive ? "bg-white drop-shadow-sm dark:bg-zinc-800 border-gray-200 dark:border-zinc-700" : "border-transparent" ) } key={navLink.id} diff --git a/web/src/components/NavigationDrawer.tsx b/web/src/components/NavigationDrawer.tsx index e59cbbadb..d0a11c29b 100644 --- a/web/src/components/NavigationDrawer.tsx +++ b/web/src/components/NavigationDrawer.tsx @@ -23,10 +23,10 @@ const NavigationDrawer = () => { return ( <> - + -
+
diff --git a/web/src/components/PersonalStatistics.tsx b/web/src/components/PersonalStatistics.tsx index 17c2ab553..dbe64c802 100644 --- a/web/src/components/PersonalStatistics.tsx +++ b/web/src/components/PersonalStatistics.tsx @@ -46,7 +46,7 @@ const PersonalStatistics = (props: Props) => {
- + Memos
{isRequesting ? : {memoAmount}} diff --git a/web/src/components/Settings/MemberSection.tsx b/web/src/components/Settings/MemberSection.tsx index 29d29f00a..254da3fe9 100644 --- a/web/src/components/Settings/MemberSection.tsx +++ b/web/src/components/Settings/MemberSection.tsx @@ -140,8 +140,8 @@ const MemberSection = () => {
{t("setting.member-list")}
-
- +
+
diff --git a/web/src/components/Settings/SSOSection.tsx b/web/src/components/Settings/SSOSection.tsx index d55aa53bb..a42c2e1f0 100644 --- a/web/src/components/Settings/SSOSection.tsx +++ b/web/src/components/Settings/SSOSection.tsx @@ -1,4 +1,4 @@ -import { Divider, List, ListItem } from "@mui/joy"; +import { Button, Divider, List, ListItem } from "@mui/joy"; import { useEffect, useState } from "react"; import { toast } from "react-hot-toast"; import { Link } from "react-router-dom"; @@ -58,19 +58,14 @@ const SSOSection = () => { return (
-
- {t("setting.sso-section.sso-list")} - - +
+
+ {t("setting.sso-section.sso-list")} + +
+
- - {identityProviderList.map((identityProvider) => (
{ {t("setting.storage-section.storage-services")}
- +
{storageList.map((storage) => ( diff --git a/web/src/components/Settings/WebhookSection.tsx b/web/src/components/Settings/WebhookSection.tsx index e77e1bce1..3e400da5f 100644 --- a/web/src/components/Settings/WebhookSection.tsx +++ b/web/src/components/Settings/WebhookSection.tsx @@ -65,8 +65,8 @@ const WebhookSection = () => {
-
- +
+
diff --git a/web/src/components/UserBanner.tsx b/web/src/components/UserBanner.tsx index efb06eb6a..066f98e51 100644 --- a/web/src/components/UserBanner.tsx +++ b/web/src/components/UserBanner.tsx @@ -1,6 +1,5 @@ import * as api from "@/helpers/api"; import useCurrentUser from "@/hooks/useCurrentUser"; -import useNavigateTo from "@/hooks/useNavigateTo"; import { useGlobalStore } from "@/store/module"; import { useTranslate } from "@/utils/i18n"; import showAboutSiteDialog from "./AboutSiteDialog"; @@ -10,30 +9,24 @@ import Dropdown from "./kit/Dropdown"; const UserBanner = () => { const t = useTranslate(); - const navigateTo = useNavigateTo(); const globalStore = useGlobalStore(); const { systemStatus } = globalStore.state; const user = useCurrentUser(); const title = user ? user.nickname || user.username : systemStatus.customizedProfile.name || "memos"; - const handleMyAccountClick = () => { - navigateTo(`/u/${encodeURIComponent(user.username)}`); - }; - const handleAboutBtnClick = () => { showAboutSiteDialog(); }; const handleSignOutBtnClick = async () => { await api.signout(); - localStorage.removeItem("userId"); window.location.href = "/auth"; }; return (
@@ -44,23 +37,6 @@ const UserBanner = () => { positionClassName="top-full mt-2" actions={ <> - {user != undefined && ( - <> - - - RSS - - - )}