Skip to content

Commit

Permalink
✨ Add loader
Browse files Browse the repository at this point in the history
  • Loading branch information
xdaruis committed Jul 19, 2024
1 parent 24fc7e8 commit cee6e8b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 14 deletions.
2 changes: 2 additions & 0 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useDispatch, useSelector } from 'react-redux';
import { Route, BrowserRouter as Router, Routes } from 'react-router-dom';

import Layout from './components/Layout/index.js';
import Loader from './components/Loader.js';
import { loaded, login, logout } from './features/auth.js';
import Home from './routes/Home.js';
import Login from './routes/Login.js';
Expand Down Expand Up @@ -41,6 +42,7 @@ const App = () => {

return (
<Router>
{isLoading && <Loader />}
<Routes>
<Route path="/" element={<Layout />}>
<Route index element={<Home />} />
Expand Down
9 changes: 0 additions & 9 deletions frontend/src/App.test.js

This file was deleted.

22 changes: 22 additions & 0 deletions frontend/src/components/Loader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react';

const Loader = () => {
return (
<div
className="vh-100 vw-100 position-fixed top-0
start-0 d-flex justify-content-center align-items-center
bg-dark bg-opacity-50"
style={{ zIndex: 9999 }}
>
<div
className="spinner-border text-light"
role="status"
style={{ width: '3rem', height: '3rem' }}
>
<span className="visually-hidden">Loading...</span>
</div>
</div>
);
};

export default Loader;
5 changes: 0 additions & 5 deletions frontend/src/setupTests.js

This file was deleted.

0 comments on commit cee6e8b

Please sign in to comment.