From 3343dc73f79a8c23f64641fdd79eab4b3ce309b7 Mon Sep 17 00:00:00 2001 From: Johnny Date: Mon, 2 Jun 2025 09:39:50 +0800 Subject: [PATCH] chore: update navigator --- web/src/components/DateTimeInput.tsx | 6 +- .../components/HomeSidebar/HomeSidebar.tsx | 52 +------------- web/src/components/MemoEditor/index.tsx | 2 +- web/src/components/Navigation.tsx | 39 ++++------ .../StatisticsView/MonthNavigator.tsx | 11 ++- .../components/StatisticsView/StatCard.tsx | 4 +- .../StatisticsView/StatisticsView.tsx | 12 ++-- web/src/components/UserBanner.tsx | 12 +++- web/src/pages/Explore.tsx | 71 ++++++------------- web/src/router/index.tsx | 16 ++--- 10 files changed, 74 insertions(+), 151 deletions(-) diff --git a/web/src/components/DateTimeInput.tsx b/web/src/components/DateTimeInput.tsx index 0461fe2f1..8a380101c 100644 --- a/web/src/components/DateTimeInput.tsx +++ b/web/src/components/DateTimeInput.tsx @@ -1,12 +1,10 @@ -import dayjs from "dayjs"; import { isEqual } from "lodash-es"; import toast from "react-hot-toast"; import { cn } from "@/utils"; // Helper function to convert Date to local datetime string. const toLocalDateTimeString = (date: Date | undefined): string => { - if (!date) return ""; - return dayjs(date).format("YYYY-MM-DDTHH:mm:ss"); + return date?.toLocaleString() || ""; }; interface Props { @@ -20,7 +18,7 @@ const DateTimeInput: React.FC = ({ value, originalValue, onChange }) => { { - const t = useTranslate(); const location = useLocation(); const currentUser = useCurrentUser(); - const homeNavLink: NavLinkItem = { - id: "header-home", - path: Routes.ROOT, - title: t("common.home"), - icon: , - }; - const exploreNavLink: NavLinkItem = { - id: "header-explore", - path: Routes.EXPLORE, - title: t("common.explore"), - icon: , - }; - - const navLinks: NavLinkItem[] = currentUser ? [homeNavLink, exploreNavLink] : [exploreNavLink]; - useDebounce( async () => { let parent: string | undefined = undefined; @@ -65,30 +40,7 @@ const HomeSidebar = observer((props: Props) => { return (