Skip to content

Commit

Permalink
Fixed routing
Browse files Browse the repository at this point in the history
  • Loading branch information
jensborch committed Oct 20, 2022
1 parent 15d3084 commit 097f7b0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
3 changes: 1 addition & 2 deletions client/.env
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
PUBLIC_URL=http://localhost:8080/client/
BASENAME=/client
PUBLIC_URL=http://localhost:8080/client
2 changes: 1 addition & 1 deletion client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function App({ basename }: AppProps) {
<Theming>
<BrowserRouter basename={basename}>
<Routes>
<Route path="/" element={<Index />} />
<Route index element={<Index />} />
<Route path="/tournament/:id" element={<Tournament />} />
</Routes>
</BrowserRouter>
Expand Down
12 changes: 7 additions & 5 deletions client/src/components/Tournaments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,13 @@ const Tournaments = () => {
}
return (
<DefaultGrid container direction="row">
{data?.map((tournament) => (
<Grid item key={tournament.id}>
<Tournament {...tournament} />
</Grid>
))}
{data &&
Array.isArray(data) &&
data.map((tournament) => (
<Grid item key={tournament.id}>
<Tournament {...tournament} />
</Grid>
))}
</DefaultGrid>
);
};
Expand Down

0 comments on commit 097f7b0

Please sign in to comment.