Skip to content

Commit

Permalink
fix 404
Browse files Browse the repository at this point in the history
  • Loading branch information
SearchForSunnyD committed Jul 28, 2024
1 parent 831d721 commit 8b9d4b2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion dnd-app/frontend/src/404.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export function NotFound() {
return (
<div className="container d-flex flex-column align-items-center justify-content-center">
<div className="container d-flex flex-column p-2 align-items-center justify-content-center bisque rounded">
<h1 className="display-1 border-bottom">ERROR 404</h1>
<p className="h4">
<span className="text-danger">Oops!</span> Page not found.
Expand Down
3 changes: 2 additions & 1 deletion dnd-app/frontend/src/DetailRoutes/Monster.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
} from "reactstrap";
import DndApi from "../api";
import { getScore } from "../tools";
import ReactMarkdown from "react-markdown";

import("../assets/styles/Details.css");

Expand Down Expand Up @@ -63,7 +64,7 @@ export function Monster() {
<Col>
<CardBody>
<CardTitle tag="h3">{data.name}</CardTitle>
{!data.desc && !data.legendary_desc ? "" : <CardSubtitle>{data.desc || data.legendary_desc}</CardSubtitle>}
{!data.desc && !data.legendary_desc ? "" : <ReactMarkdown>{data.desc || data.legendary_desc}</ReactMarkdown>}
<hr />
<Row>
<CardText className="col-3">
Expand Down
5 changes: 3 additions & 2 deletions dnd-app/frontend/src/RouteList.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Navigate, Route, Routes } from "react-router-dom";
import { Route, Routes } from "react-router-dom";
import { Container } from "reactstrap";

import { NotFound } from "./404";
import { DetailRoutes } from "./DetailRoutes/DetailRoutes";
import { Home } from "./Home";
import { SearchResult } from "./SearchResults";
Expand All @@ -18,8 +19,8 @@ export function RouteList() {
<Route path="/" element={<Home />} />
{UserRoutes()}
{DetailRoutes()}
<Route path="/*" element={<Navigate to="/" />} />
<Route path="/search-results" element={<SearchResult />} />
<Route path="/*" element={<NotFound />} />
</Routes>
</Container>
</main>
Expand Down
12 changes: 3 additions & 9 deletions dnd-app/frontend/src/UserRoutes/UserRoutes.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Navigate, Route } from "react-router-dom";

import { PrivateRoute } from "../PrivateRoute";
import { LoginSignup } from "./LoginSignup";
import { Logout } from "./Logout";
import { PrivateRoute } from "../PrivateRoute";
import { Profile } from "./Profile";

/**
Expand All @@ -13,14 +13,8 @@ export function UserRoutes() {
return (
<>
<Route path="/login/signup" element={<LoginSignup />} />
<Route
path="/profile"
element={<PrivateRoute element={<Profile />} />}
/>
<Route
path="/logout"
element={<PrivateRoute element={<Logout />} />}
/>
<Route path="/profile" element={<PrivateRoute element={<Profile />} />} />
<Route path="/logout" element={<PrivateRoute element={<Logout />} />} />
<Route path="/login" element={<Navigate to="/" />} />
<Route path="/signup" element={<Navigate to="/" />} />
</>
Expand Down

0 comments on commit 8b9d4b2

Please sign in to comment.