Skip to content

Commit 2176d08

Browse files
authored
Merge pull request #6 from nicolelim02/feat/questions
Fix navigation routes
2 parents 3f1072c + 58e051f commit 2176d08

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

frontend/src/App.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ function App() {
99
<BrowserRouter>
1010
<Routes>
1111
<Route path="/" element={<Layout />}>
12-
<Route path="/questions" element={<>question page list</>} />
13-
<Route path="/questions/new" element={<NewQuestion />} />
14-
<Route path="/questions/:questionId" element={<QuestionDetail />} />
12+
<Route path="questions">
13+
<Route index element={<>question page list</>} />
14+
<Route path="new" element={<NewQuestion />} />
15+
<Route path=":questionId" element={<QuestionDetail />} />
16+
</Route>
1517
<Route path="*" element={<PageNotFound />} />
1618
</Route>
1719
</Routes>

frontend/src/components/Navbar/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ type NavbarItem = { label: string; link: string };
99
type NavbarProps = { navbarItems?: Array<NavbarItem> };
1010

1111
const Navbar: FunctionComponent<NavbarProps> = (props: NavbarProps) => {
12-
const { navbarItems = [{ label: "Questions", link: "/" }] } = props;
12+
const { navbarItems = [{ label: "Questions", link: "/questions" }] } = props;
1313
const navigate = useNavigate();
1414

1515
return (

0 commit comments

Comments
 (0)