From fe4ec0b156d3a19db40996730f13a79c703901b5 Mon Sep 17 00:00:00 2001 From: Steven Date: Tue, 19 Dec 2023 00:13:22 +0800 Subject: [PATCH] chore: rename navigator --- store/db/sqlite/seed/10002__memo.sql | 4 +- web/src/components/Memo.tsx | 4 +- web/src/components/Navigation.tsx | 12 +- web/src/locales/ar.json | 4 - web/src/locales/de.json | 4 - web/src/locales/en.json | 5 +- web/src/locales/fr.json | 4 - web/src/locales/nl.json | 4 - web/src/locales/pt-BR.json | 4 - web/src/locales/ru.json | 4 - web/src/locales/zh-Hans.json | 5 +- web/src/locales/zh-Hant.json | 5 +- web/src/pages/SignIn.tsx | 166 +++++++++--------- web/src/pages/SignUp.tsx | 118 ++++++------- .../pages/{DailyReview.tsx => Timeline.tsx} | 6 +- web/src/router/index.tsx | 6 +- 16 files changed, 161 insertions(+), 194 deletions(-) rename web/src/pages/{DailyReview.tsx => Timeline.tsx} (98%) diff --git a/store/db/sqlite/seed/10002__memo.sql b/store/db/sqlite/seed/10002__memo.sql index 0cab75e4..de27dbb9 100644 --- a/store/db/sqlite/seed/10002__memo.sql +++ b/store/db/sqlite/seed/10002__memo.sql @@ -55,9 +55,7 @@ VALUES '#TODO - [x] Take more photos about **🌄 sunset**; - [ ] Clean the classroom; -- [ ] Watch *👦 The Boys*; -(👆 click to toggle status) -', +- [ ] Watch *👦 The Boys*;', 102, 'PROTECTED' ); diff --git a/web/src/components/Memo.tsx b/web/src/components/Memo.tsx index 14d9190d..548b17f1 100644 --- a/web/src/components/Memo.tsx +++ b/web/src/components/Memo.tsx @@ -212,7 +212,7 @@ const Memo: React.FC = (props: Props) => { className={`group memo-wrapper ${"memos-" + memo.id} ${memo.pinned && props.showPinnedStyle ? "pinned" : ""}`} ref={memoContainerRef} > -
+
{props.showCreator && creator && ( <> @@ -303,7 +303,7 @@ const Memo: React.FC = (props: Props) => {
{props.showParent && memo.parent && ( -
+
{ title: t("common.home"), icon: , }; - const dailyReviewNavLink: NavLinkItem = { - id: "header-daily-review", - path: "/review", - title: t("daily-review.title"), - icon: , + const timelineNavLink: NavLinkItem = { + id: "header-timeline", + path: "/timeline", + title: t("timeline.title"), + icon: , }; const resourcesNavLink: NavLinkItem = { id: "header-resources", @@ -94,7 +94,7 @@ const Navigation = () => { }; const navLinks: NavLinkItem[] = user - ? [homeNavLink, dailyReviewNavLink, resourcesNavLink, exploreNavLink, inboxNavLink, archivedNavLink, settingNavLink] + ? [homeNavLink, timelineNavLink, resourcesNavLink, exploreNavLink, inboxNavLink, archivedNavLink, settingNavLink] : [exploreNavLink, signInNavLink]; return ( diff --git a/web/src/locales/ar.json b/web/src/locales/ar.json index d9c403b0..15346f7f 100644 --- a/web/src/locales/ar.json +++ b/web/src/locales/ar.json @@ -70,10 +70,6 @@ "visibility": "الرؤية", "yourself": "نفسك" }, - "daily-review": { - "no-memos": "عفوًا، لا يوجد شيء.", - "title": "المراجعة اليومية" - }, "editor": { "cancel-edit": "إلغاء التعديل", "cant-empty": "المحتوى لا يمكن أن يكون فارغ", diff --git a/web/src/locales/de.json b/web/src/locales/de.json index 5eed92cf..6018badb 100644 --- a/web/src/locales/de.json +++ b/web/src/locales/de.json @@ -81,10 +81,6 @@ "visibility": "Sichtbarkeit", "yourself": "Du selbst" }, - "daily-review": { - "no-memos": "Hoppla, da ist ja gar nichts.", - "title": "Tagesbilanz" - }, "days": { "fri": "Fr", "mon": "Mo", diff --git a/web/src/locales/en.json b/web/src/locales/en.json index 2df681f2..88a2f4b8 100644 --- a/web/src/locales/en.json +++ b/web/src/locales/en.json @@ -157,9 +157,8 @@ "hide": "Hide", "save-all": "Save all" }, - "daily-review": { - "title": "Daily Review", - "no-memos": "Oops, there is nothing." + "timeline": { + "title": "Timeline" }, "setting": { "my-account": "My Account", diff --git a/web/src/locales/fr.json b/web/src/locales/fr.json index 51045d76..29ccb475 100644 --- a/web/src/locales/fr.json +++ b/web/src/locales/fr.json @@ -85,10 +85,6 @@ "visibility": "Visibilité", "yourself": "Vous-même" }, - "daily-review": { - "no-memos": "Oups, il n'y a rien.", - "title": "Résumé journalier" - }, "days": { "fri": "Ve", "mon": "Lu", diff --git a/web/src/locales/nl.json b/web/src/locales/nl.json index b62726fc..649e8e3d 100644 --- a/web/src/locales/nl.json +++ b/web/src/locales/nl.json @@ -123,10 +123,6 @@ "tag-name": "LABEL_NAAM", "invalid-tag-name": "Onjuiste label naam" }, - "daily-review": { - "title": "Dagelijks", - "no-memos": "Oeps, er is niks." - }, "setting": { "my-account": "Mijn account", "preference": "Voorkeuren", diff --git a/web/src/locales/pt-BR.json b/web/src/locales/pt-BR.json index 7efed0da..1c60f4af 100644 --- a/web/src/locales/pt-BR.json +++ b/web/src/locales/pt-BR.json @@ -85,10 +85,6 @@ "visibility": "Visibilidade", "yourself": "Você mesmo" }, - "daily-review": { - "no-memos": "Não há memos.", - "title": "Resumo Diário" - }, "days": { "fri": "Sex", "mon": "Seg", diff --git a/web/src/locales/ru.json b/web/src/locales/ru.json index 2355dddd..58781b61 100644 --- a/web/src/locales/ru.json +++ b/web/src/locales/ru.json @@ -78,10 +78,6 @@ "visibility": "Видимость", "yourself": "Вы" }, - "daily-review": { - "no-memos": "Записей нет.", - "title": "По дням" - }, "days": { "fri": "Пт.", "mon": "Пон.", diff --git a/web/src/locales/zh-Hans.json b/web/src/locales/zh-Hans.json index 5de23ec5..b2288466 100644 --- a/web/src/locales/zh-Hans.json +++ b/web/src/locales/zh-Hans.json @@ -82,9 +82,8 @@ "yourself": "您自己", "inbox": "通知" }, - "daily-review": { - "no-memos": "哎呀,空无一物。", - "title": "每日回顾" + "timeline": { + "title": "时间线" }, "days": { "fri": "五", diff --git a/web/src/locales/zh-Hant.json b/web/src/locales/zh-Hant.json index 726c5c6d..51acda7c 100644 --- a/web/src/locales/zh-Hant.json +++ b/web/src/locales/zh-Hant.json @@ -82,9 +82,8 @@ "visibility": "可見度", "yourself": "你自己" }, - "daily-review": { - "no-memos": "可惜可惜,是日空空如也。", - "title": "每日回顧" + "timeline": { + "title": "时间线" }, "days": { "fri": "五", diff --git a/web/src/pages/SignIn.tsx b/web/src/pages/SignIn.tsx index f6031555..19aaeb77 100644 --- a/web/src/pages/SignIn.tsx +++ b/web/src/pages/SignIn.tsx @@ -104,94 +104,92 @@ const SignIn = () => { }; return ( -
-
-
-
- -

{systemStatus.customizedProfile.name}

-
- {!disablePasswordLogin && ( - <> -
-
-
- {t("common.username")} - -
-
- {t("common.password")} - -
-
-
- setRemember(e.target.checked)} /> -
-
- + size="lg" + type="text" + readOnly={actionBtnLoadingState.isLoading} + placeholder={t("common.username")} + value={username} + onChange={handleUsernameInputChanged} + required + />
-
- {systemStatus.allowSignUp && ( -

- {t("auth.sign-up-tip")} - - {t("common.sign-up")} - -

- )} - - )} - {identityProviderList.length > 0 && ( - <> - {!disablePasswordLogin && {t("common.or")}} -
- {identityProviderList.map((identityProvider) => ( - - ))} + size="lg" + type="password" + readOnly={actionBtnLoadingState.isLoading} + placeholder={t("common.password")} + value={password} + onChange={handlePasswordInputChanged} + required + /> +
- - )} -
-
- - -
+
+ setRemember(e.target.checked)} /> +
+
+ +
+ + {systemStatus.allowSignUp && ( +

+ {t("auth.sign-up-tip")} + + {t("common.sign-up")} + +

+ )} + + )} + {identityProviderList.length > 0 && ( + <> + {!disablePasswordLogin && {t("common.or")}} +
+ {identityProviderList.map((identityProvider) => ( + + ))} +
+ + )} +
+
+ +
); diff --git a/web/src/pages/SignUp.tsx b/web/src/pages/SignUp.tsx index 4e67c62f..13ce39b9 100644 --- a/web/src/pages/SignUp.tsx +++ b/web/src/pages/SignUp.tsx @@ -70,68 +70,66 @@ const SignUp = () => { }; return ( -
-
-
-
- -

{systemStatus.customizedProfile.name}

-
-

{t("auth.create-your-account")}

-
-
-
- {t("common.username")} - -
-
- {t("common.password")} - -
-
-
- + size="lg" + type="text" + readOnly={actionBtnLoadingState.isLoading} + placeholder={t("common.username")} + value={username} + onChange={handleUsernameInputChanged} + required + />
-
- {!systemStatus.host &&

{t("auth.host-tip")}

} -

- {t("auth.sign-in-tip")} - - {t("common.sign-in")} - -

-
-
- - -
+
+ {t("common.password")} + +
+
+
+ +
+ + {!systemStatus.host &&

{t("auth.host-tip")}

} +

+ {t("auth.sign-in-tip")} + + {t("common.sign-in")} + +

+
+
+ +
); diff --git a/web/src/pages/DailyReview.tsx b/web/src/pages/Timeline.tsx similarity index 98% rename from web/src/pages/DailyReview.tsx rename to web/src/pages/Timeline.tsx index b112f3bc..2205124e 100644 --- a/web/src/pages/DailyReview.tsx +++ b/web/src/pages/Timeline.tsx @@ -18,7 +18,7 @@ import { useMemoStore } from "@/store/module"; import { extractUsernameFromName } from "@/store/v1"; import { useTranslate } from "@/utils/i18n"; -const DailyReview = () => { +const Timeline = () => { const t = useTranslate(); const memoStore = useMemoStore(); const currentUser = useCurrentUser(); @@ -128,7 +128,7 @@ const DailyReview = () => { {selectedDateStamp === currentDateStamp && (
- +
)}
@@ -138,4 +138,4 @@ const DailyReview = () => { ); }; -export default DailyReview; +export default Timeline; diff --git a/web/src/router/index.tsx b/web/src/router/index.tsx index dc46492c..40d03f65 100644 --- a/web/src/router/index.tsx +++ b/web/src/router/index.tsx @@ -13,7 +13,7 @@ const Home = lazy(() => import("@/pages/Home")); const UserProfile = lazy(() => import("@/pages/UserProfile")); const MemoDetail = lazy(() => import("@/pages/MemoDetail")); const Archived = lazy(() => import("@/pages/Archived")); -const DailyReview = lazy(() => import("@/pages/DailyReview")); +const Timeline = lazy(() => import("@/pages/Timeline")); const Resources = lazy(() => import("@/pages/Resources")); const Inboxes = lazy(() => import("@/pages/Inboxes")); const Setting = lazy(() => import("@/pages/Setting")); @@ -59,10 +59,10 @@ const router = createBrowserRouter([ ), }, { - path: "review", + path: "timeline", element: ( - + ), },