Skip to content

Commit

Permalink
Updated loading screens
Browse files Browse the repository at this point in the history
  • Loading branch information
Dialpuri committed Nov 1, 2023
1 parent 6d859ec commit cc19976
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
3 changes: 2 additions & 1 deletion webserver/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { useEffect, useState, Suspense } from 'react'
import './App.css'
import HomeSection from './pages/Home/HomeSection'
import PageLoad from './components/Loading/PageLoad'

function App() {
const [resetApp, setResetApp] = useState(false)

return (
<Suspense fallback={<div>Loading... </div>}>
<Suspense fallback={<PageLoad/>}>

<div className='flex flex-col'>
<HomeSection/>
Expand Down
12 changes: 10 additions & 2 deletions webserver/src/components/Loading/PageLoad.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import ClipLoader from "react-spinners/ClipLoader";

export default function PageLoad() {
return (
<div className="flex text-center w-full h-full bg-gray text-primary ">
<h1>Loading page</h1>
<div className="min-h-screen flex flex-col space-y-6 text-center w-screen h-screen bg-gray justify-center items-center text-primary text-m ">
{/* <h1>Loading Privateer Web App</h1> */}
<ClipLoader
loading={true}
size={100}
aria-label="Loading Spinner"
data-testid="loader"
/>
</div>
)

Expand Down
2 changes: 1 addition & 1 deletion webserver/src/layouts/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function Header(props) {
<NavBar setResetApp={props.setResetApp}/>
<div className="flex justify-center mb-6">
{props.fallback != true ?
<Suspense fallback={<Loading loadingText={"Loading"} />}>
<Suspense fallback={<Loading loadingText={"Loading content..."} />}>
{props.submit == null ?
<Upload {...props} />
: props.tableData == null ?
Expand Down

0 comments on commit cc19976

Please sign in to comment.