Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(routes): redirect / => /en-US/ except for writers #10778

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 12 additions & 3 deletions client/src/app.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import React, { useEffect } from "react";
import { Routes, Route, useLocation, useMatch } from "react-router-dom";
import {
Navigate,
Routes,
Route,
useLocation,
useMatch,
} from "react-router-dom";

// we include our base SASS here to ensure it is loaded
// and applied before any component specific style
Expand Down Expand Up @@ -161,10 +167,13 @@ export function App(appProps: HydrationData) {
{/*
Note, this can only happen in local development.
In production, all traffic at `/` is redirected to at least
having a locale. So it'll be `/en-US` (for example) by the
having a locale. So it'll be `/en-US/` (for example) by the
time it hits any React code.
*/}
<Route path="/" element={homePage} />
<Route
path="/"
element={WRITER_MODE ? homePage : <Navigate to="/en-US/" />}
/>
<Route
path="/en-US/curriculum/*"
element={
Expand Down