Skip to content

Commit

Permalink
Merge pull request #69 from jatintyagi1/develop
Browse files Browse the repository at this point in the history
New Features
  • Loading branch information
narainkarthikv authored Dec 7, 2024
2 parents 7c110ec + 1ecd7bf commit 5ae7b87
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@ import Navbar from "./components/Navbar";
import NoteList from "./pages/NoteList";
import TableList from "./pages/TableList";
import BoardList from "./pages/BoardList";
import NotFoundPage from "./pages/NotFoundPage";
import { Box } from "@mui/material";

function App() {
return (
<Router>
<Box sx={{textAlign: 'center', fontFamily: 'Outfit, sans-serif'}}>
<Box sx={{ textAlign: 'center', fontFamily: 'Outfit, sans-serif' }}>
<Navbar />
<Routes>
<Route exact path='/' element={<NoteList/>} />
<Route path='/tables' element={<TableList/>} />
<Route path='/boards' element={<BoardList/>} />
<Route exact path='/' element={<NoteList />} />
<Route path='/tables' element={<TableList />} />
<Route path='/boards' element={<BoardList />} />
<Route path="*" element={<NotFoundPage />} />
</Routes>
</Box>
</Router>
Expand Down
24 changes: 24 additions & 0 deletions src/components/Loading/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from "react";
import { Box, CircularProgress, Typography } from "@mui/material";

const LoadingSpinner = () => {
return (
<Box
sx={{
display: "flex",
flexDirection: "column",
alignItems: "center",
justifyContent: "center",
height: "100vh",
bgcolor: "#f5f5f5",
}}
>
<CircularProgress size={60} />
<Typography variant="h6" sx={{ mt: 2, color: "#666" }}>
Loading, please wait...
</Typography>
</Box>
);
};

export default LoadingSpinner;
7 changes: 6 additions & 1 deletion src/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@ import { RecoilRoot } from 'recoil';
import App from "./App";
import './main.css';

import { Suspense } from 'react'
import LoadingSpinner from './components/Loading';

ReactDOM.createRoot(document.getElementById('root')).render(
<React.StrictMode>
<RecoilRoot>
<App />
<Suspense fallback={<LoadingSpinner />}>
<App />
</Suspense>
</RecoilRoot>
</React.StrictMode>
);
39 changes: 39 additions & 0 deletions src/pages/NotFoundPage/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import React from "react";
import { Box, Typography, Button } from "@mui/material";
import { useNavigate } from "react-router-dom";

const NotFoundPage = () => {
const navigate = useNavigate();

return (
<Box
sx={{
display: "flex",
flexDirection: "column",
alignItems: "center",
justifyContent: "center",
height: "100vh",
bgcolor: "#f5f5f5", // Light background color
textAlign: "center",
px: 2,
}}
>
<Typography variant="h1" sx={{ fontSize: "96px", fontWeight: "bold", color: "#1976d2" }}>
404
</Typography>
<Typography variant="h6" sx={{ mb: 2, color: "#666" }}>
Oops! The page you are looking for doesn’t exist.
</Typography>
<Button
variant="contained"
color="primary"
onClick={() => navigate("/")}
sx={{ mt: 2 }}
>
Go Back to Home
</Button>
</Box>
);
};

export default NotFoundPage;

0 comments on commit 5ae7b87

Please sign in to comment.