Skip to content

Commit c8c493d

Browse files
committed
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.
1 parent d4c0a45 commit c8c493d

7 files changed

Lines changed: 10 additions & 7 deletions

File tree

src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function App() {
9494
isAuthenticated &&
9595
(await logout({
9696
logoutParams: {
97-
returnTo: window.location.origin + "/collections",
97+
returnTo: window.location.origin + "/",
9898
},
9999
}));
100100
} else {

src/i18n/bo-IN.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@
225225
"header.profileMenu.profile": "ངོ་སྤྲོད་སྙིང་བསྡུས།",
226226
"header.search_bar.search_for": "འདི་འཚོལ་ཞིབ།",
227227
"header.site_language": "དྲ་བའི་སྐད་ཡིག།",
228+
"header.plan": "སྦྱོང་ལམ།",
228229
"header.text": "ཡིག་མཛོད།",
229230
"header.topic": "ཀུན་གླེང་།",
230231
"hebrew": "བོད་ཀྱི་སྐད་ཡིག",

src/i18n/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@
229229
"header.profileMenu.profile": "Profile",
230230
"header.search_bar.search_for": "Search for",
231231
"header.site_language": "Site Language",
232+
"header.plan": "Plans",
232233
"header.text": "Texts",
233234
"header.topic": "Topics",
234235
"hebrew": "Hebrew",

src/routes/navbar/NavigationBar.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ describe("NavigationBar Component", () => {
7575
};
7676
test("renders navigation links", () => {
7777
setup();
78+
expect(screen.getByText("Plans")).toBeInTheDocument();
7879
expect(screen.getByText("Texts")).toBeInTheDocument();
79-
// Note: Community link was removed from navigation, only Texts (Collections) link remains
8080
});
8181

8282
test("renders search input", () => {

src/routes/navbar/NavigationBar.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ const Navigation = () => {
7777
const [searchTerm, setSearchTerm] = useState("");
7878
const [params, setParams] = useSearchParams();
7979
const navItems = [
80+
{ to: "/", label: "plans", key: "plan" },
8081
{ to: "/collections", label: t("header.text"), key: "collections" },
8182
];
8283

src/routes/user-login/UserLogin.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const UserLogin = () => {
5151
const accessToken = data.auth.access_token;
5252
const refreshToken = data.auth.refresh_token;
5353
login(accessToken, refreshToken);
54-
navigate("/collections");
54+
navigate("/");
5555
},
5656
onError: (error: any) => {
5757
const errorMsg =
@@ -107,7 +107,7 @@ const UserLogin = () => {
107107
connection,
108108
...(connection === "google-oauth2" && { prompt: "select_account" }),
109109
},
110-
appState: { returnTo: "/collections" },
110+
appState: { returnTo: "/" },
111111
});
112112
} catch (error: any) {
113113
const message =

src/routes/user-registration/UserRegistration.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const UserRegistration = () => {
5353

5454
useEffect(() => {
5555
if (isLoggedIn || isAuthenticated) {
56-
navigate("/collections");
56+
navigate("/");
5757
}
5858
}, [isLoggedIn, isAuthenticated, navigate]);
5959

@@ -69,7 +69,7 @@ const UserRegistration = () => {
6969
onSuccess: (data) => {
7070
const { access_token, refresh_token } = data.auth;
7171
login(access_token, refresh_token);
72-
navigate("/collections");
72+
navigate("/");
7373
},
7474
onError: (error: any) => {
7575
const message =
@@ -147,7 +147,7 @@ const UserRegistration = () => {
147147

148148
const handleSocialLogin = async (connection: "google-oauth2" | "apple") => {
149149
try {
150-
const redirectPath = "/collections";
150+
const redirectPath = "/";
151151
const authParams: any = {
152152
appState: { returnTo: redirectPath },
153153
authorizationParams: { connection },

0 commit comments

Comments
 (0)