From c8c493d1d7fa294b6350d7611ed8cff5e0caa64f Mon Sep 17 00:00:00 2001 From: tenkus47 Date: Sat, 6 Jun 2026 15:23:18 +0530 Subject: [PATCH 1/3] Update navigation and authentication routes to redirect to the home page. Added "Plans" label to navigation and updated translations for English and Tibetan. Adjusted tests to reflect changes in navigation links. --- src/App.tsx | 2 +- src/i18n/bo-IN.json | 1 + src/i18n/en.json | 1 + src/routes/navbar/NavigationBar.test.tsx | 2 +- src/routes/navbar/NavigationBar.tsx | 1 + src/routes/user-login/UserLogin.tsx | 4 ++-- src/routes/user-registration/UserRegistration.tsx | 6 +++--- 7 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index d678ab67..0a5e77a2 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -94,7 +94,7 @@ function App() { isAuthenticated && (await logout({ logoutParams: { - returnTo: window.location.origin + "/collections", + returnTo: window.location.origin + "/", }, })); } else { diff --git a/src/i18n/bo-IN.json b/src/i18n/bo-IN.json index 0d5c787f..cbe2e098 100644 --- a/src/i18n/bo-IN.json +++ b/src/i18n/bo-IN.json @@ -225,6 +225,7 @@ "header.profileMenu.profile": "ངོ་སྤྲོད་སྙིང་བསྡུས།", "header.search_bar.search_for": "འདི་འཚོལ་ཞིབ།", "header.site_language": "དྲ་བའི་སྐད་ཡིག།", + "header.plan": "སྦྱོང་ལམ།", "header.text": "ཡིག་མཛོད།", "header.topic": "ཀུན་གླེང་།", "hebrew": "བོད་ཀྱི་སྐད་ཡིག", diff --git a/src/i18n/en.json b/src/i18n/en.json index f384aa10..0ba61991 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -229,6 +229,7 @@ "header.profileMenu.profile": "Profile", "header.search_bar.search_for": "Search for", "header.site_language": "Site Language", + "header.plan": "Plans", "header.text": "Texts", "header.topic": "Topics", "hebrew": "Hebrew", diff --git a/src/routes/navbar/NavigationBar.test.tsx b/src/routes/navbar/NavigationBar.test.tsx index e970f8cf..b6326982 100644 --- a/src/routes/navbar/NavigationBar.test.tsx +++ b/src/routes/navbar/NavigationBar.test.tsx @@ -75,8 +75,8 @@ describe("NavigationBar Component", () => { }; test("renders navigation links", () => { setup(); + expect(screen.getByText("Plans")).toBeInTheDocument(); expect(screen.getByText("Texts")).toBeInTheDocument(); - // Note: Community link was removed from navigation, only Texts (Collections) link remains }); test("renders search input", () => { diff --git a/src/routes/navbar/NavigationBar.tsx b/src/routes/navbar/NavigationBar.tsx index af7eb100..59f73e56 100644 --- a/src/routes/navbar/NavigationBar.tsx +++ b/src/routes/navbar/NavigationBar.tsx @@ -77,6 +77,7 @@ const Navigation = () => { const [searchTerm, setSearchTerm] = useState(""); const [params, setParams] = useSearchParams(); const navItems = [ + { to: "/", label: "plans", key: "plan" }, { to: "/collections", label: t("header.text"), key: "collections" }, ]; diff --git a/src/routes/user-login/UserLogin.tsx b/src/routes/user-login/UserLogin.tsx index 5e4cbdde..2c1981b3 100644 --- a/src/routes/user-login/UserLogin.tsx +++ b/src/routes/user-login/UserLogin.tsx @@ -51,7 +51,7 @@ const UserLogin = () => { const accessToken = data.auth.access_token; const refreshToken = data.auth.refresh_token; login(accessToken, refreshToken); - navigate("/collections"); + navigate("/"); }, onError: (error: any) => { const errorMsg = @@ -107,7 +107,7 @@ const UserLogin = () => { connection, ...(connection === "google-oauth2" && { prompt: "select_account" }), }, - appState: { returnTo: "/collections" }, + appState: { returnTo: "/" }, }); } catch (error: any) { const message = diff --git a/src/routes/user-registration/UserRegistration.tsx b/src/routes/user-registration/UserRegistration.tsx index 4add9483..f67e74fe 100644 --- a/src/routes/user-registration/UserRegistration.tsx +++ b/src/routes/user-registration/UserRegistration.tsx @@ -53,7 +53,7 @@ const UserRegistration = () => { useEffect(() => { if (isLoggedIn || isAuthenticated) { - navigate("/collections"); + navigate("/"); } }, [isLoggedIn, isAuthenticated, navigate]); @@ -69,7 +69,7 @@ const UserRegistration = () => { onSuccess: (data) => { const { access_token, refresh_token } = data.auth; login(access_token, refresh_token); - navigate("/collections"); + navigate("/"); }, onError: (error: any) => { const message = @@ -147,7 +147,7 @@ const UserRegistration = () => { const handleSocialLogin = async (connection: "google-oauth2" | "apple") => { try { - const redirectPath = "/collections"; + const redirectPath = "/"; const authParams: any = { appState: { returnTo: redirectPath }, authorizationParams: { connection }, From 4856916be24c895d29920035650337b5f27b52f9 Mon Sep 17 00:00:00 2001 From: Tech-lo Date: Fri, 12 Jun 2026 10:37:08 +0530 Subject: [PATCH 2/3] update header tolgee --- src/routes/navbar/NavigationBar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/navbar/NavigationBar.tsx b/src/routes/navbar/NavigationBar.tsx index 59f73e56..0a68ef69 100644 --- a/src/routes/navbar/NavigationBar.tsx +++ b/src/routes/navbar/NavigationBar.tsx @@ -77,7 +77,7 @@ const Navigation = () => { const [searchTerm, setSearchTerm] = useState(""); const [params, setParams] = useSearchParams(); const navItems = [ - { to: "/", label: "plans", key: "plan" }, + { to: "/", label: t("header.plans"), key: "plans" }, { to: "/collections", label: t("header.text"), key: "collections" }, ]; From 2747d6e71ecf3c7b1f7a8788be1e1259fdc63db7 Mon Sep 17 00:00:00 2001 From: Tech-lo Date: Fri, 12 Jun 2026 10:43:29 +0530 Subject: [PATCH 3/3] update test --- src/routes/navbar/NavigationBar.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/navbar/NavigationBar.test.tsx b/src/routes/navbar/NavigationBar.test.tsx index b6326982..617d3093 100644 --- a/src/routes/navbar/NavigationBar.test.tsx +++ b/src/routes/navbar/NavigationBar.test.tsx @@ -75,7 +75,7 @@ describe("NavigationBar Component", () => { }; test("renders navigation links", () => { setup(); - expect(screen.getByText("Plans")).toBeInTheDocument(); + expect(screen.getByText("header.plans")).toBeInTheDocument(); expect(screen.getByText("Texts")).toBeInTheDocument(); });