Skip to content

Commit

Permalink
Install react-snowfall and create a not found page
Browse files Browse the repository at this point in the history
  • Loading branch information
Bopally committed Nov 28, 2024
1 parent 43262dd commit 8cd64d0
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 2 deletions.
22 changes: 21 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"axios": "^1.7.8",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^7.0.0"
"react-router-dom": "^7.0.0",
"react-snowfall": "^2.2.0"
},
"devDependencies": {
"@eslint/js": "^9.13.0",
Expand Down
2 changes: 2 additions & 0 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import LoginPage from "./pages/LoginPage";
import CreateAccount from "./pages/CreateAccountPage";
import Account from "./pages/AccountPage";
import About from "./pages/AboutPage";
import NotFound from "./pages/NotFoundPage";
import Accommodation from "./pages/Accommodation";
import Activities from "./pages/Activities";
import Gastronomy from "./pages/Gastronomy";
Expand All @@ -21,6 +22,7 @@ function App() {
<Route path="/accommodation" element={<Accommodation />} />
<Route path="/activities" element={<Activities />} />
<Route path="/gastronomy" element={<Gastronomy />} />
<Route path="*" element={<NotFound />} />
</Routes>
</div>
</Router>
Expand Down
17 changes: 17 additions & 0 deletions src/pages/NotFoundPage.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Snowfall from "react-snowfall";
import "../styles/NotFound.css";
import HomeButton from "../components/HomeButton";

function NotFound() {
return (
<div className="not-found-page">
<Snowfall color="white" snowflakeCount={200} />
<div className="not-found-container">
<h1>404</h1>
<p>Oops! The page you are looking for does not exist.</p>
<HomeButton />
</div>
</div>
);
}
export default NotFound;
22 changes: 22 additions & 0 deletions src/styles/NotFound.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.not-found-page {
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background-color: #2c3e50;
font-family: "Georgia", sans-serif;
}

.not-found-container {
text-align: center;
}

.not-found-container h1 {
font-size: 6rem;
margin-bottom: 20px;
}

.not-found-container p {
font-size: 1.5rem;
margin-bottom: 30px;
}

0 comments on commit 8cd64d0

Please sign in to comment.