Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions client/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@ import Footer from "./Components/Footer/Footer";
import Profile from "./Pages/UserProfile";
import profileData from "./Data/profileData.json";
import "./styles.css";
import NotFoundPage from './pages/NotFoundPage';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this line to import Error from './Error.js';


function App() {
return (
<BrowserRouter>
<Header />
<Switch>
<Route path="/profile" component={Profile} />
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make it as a persisted route. Just change this to <Route path="/profile" component={Profile} exact />

<Redirect to="/profile" />
<Route component={NotFoundPage} />
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this line to <Route component={Error} />

</Switch>
<Footer />
</BrowserRouter>
);
}

export default App;
export default App;
26 changes: 26 additions & 0 deletions client/src/Error.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

//Add route for error page...
// <Route component = {error}>
// import Logo from '../logo.png';
import React from "react";
import {NavLink} from "react-router-dom";
import Logo from './design/error-screen/sreens/error-sreen-desktop.png'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imports outside of the src directory are not yet supported.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To add an Image, create a directory called assets, in the src, add the image there and reference it from there.

const Error = () => {
const mystyle = {
color: "white",
backgroundColor: "DodgerBlue",
padding: "10px",
fontFamily: "Arial"
};
return (
<>
<div className="setStyle2">
<h1 style={mystyle}>404 Error Page</h1>
{/* <p>Sorry this page is not valid</p> */}
<NavLink to ="/">Take Me Back To Where I Came From</NavLink>
<img src = {Logo} width = "500" alt ="error-screen-desktop.png"/>
</div>
</>
);
};
export default Error;