Skip to content

Commit

Permalink
Added error page
Browse files Browse the repository at this point in the history
  • Loading branch information
Mila2999 committed Feb 12, 2024
1 parent 83f46f4 commit 0478be1
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/Card.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
flex-direction: column;
align-items: center;
}

button {
width: 100px;
height: 30px;
Expand All @@ -40,9 +41,11 @@ button {
border: 0;
margin: 0;
}

.button:hover {
background-color: rgb(90, 145, 155);
}

@media (max-width: 768px) {
.card {
width: 100%;
Expand Down
4 changes: 4 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ body {
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
}

main {
text-align: center;
}
15 changes: 15 additions & 0 deletions src/pages/Error.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import MainNavigation from '../components/MainNavigation';

function ErrorPage() {
return (
<>
<MainNavigation />
<hr />
<main>
<h2>An error occurred!</h2>
<p>Could not find this page!</p>
</main>
</>
);
}
export default ErrorPage;
2 changes: 2 additions & 0 deletions src/router/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ import { createBrowserRouter } from 'react-router-dom';
import UserDetailPage, { loader as userDetailLoader } from '../pages/UserDetails';
import UsersListPage, { loader as usersLoader } from '../pages/UsersList';
import RootLayout from '../pages/Root';
import ErrorPage from '../pages/Error';

const router = createBrowserRouter([
{
path: '/',
id: 'user-detail',
element: <RootLayout />,
errorElement: <ErrorPage />,
children: [
{
path: '/',
Expand Down

0 comments on commit 0478be1

Please sign in to comment.