Skip to content

Commit

Permalink
Make BlizzardLoader default page loader (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
Starmordar authored Nov 24, 2023
1 parent 0aafcf5 commit cdda558
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 32 deletions.
20 changes: 10 additions & 10 deletions frontend/src/components/common/BlizzardLoader.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { Grid, Typography } from '@mui/material';
import { cn } from '@/utils/classnames';

const BlizzardLoader = () => {
interface IProps {
className?: string;
}
const BlizzardLoader = ({ className }: IProps) => {
return (
<Grid
className="loader-container"
direction="column"
sx={{ position: 'absolute', display: 'flex' }}
>
<div className="loader">
<div className={cn(className, 'absolute top-1/2 right-1/2 translate-x-2/4 -translate-y-2/4')}>
<div className="loader-container">
<div className="blizzard-loader one"></div>
<div className="blizzard-loader two"></div>
<div className="blizzard-loader three"></div>
</div>
<Typography component="span">LOADING...</Typography>
</Grid>

<span className="uppercase">Loading...</span>
</div>
);
};

Expand Down
11 changes: 0 additions & 11 deletions frontend/src/components/common/Loading.tsx

This file was deleted.

7 changes: 0 additions & 7 deletions frontend/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,6 @@ body {
}

.loader-container {
position: absolute;

top: calc(50% - 32px);
left: calc(50% - 32px);
}

.loader {
width: 64px;
height: 64px;
border-radius: 50%;
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/routes/index.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import loadable from '@loadable/component';
import { BrowserRouter, Routes as ReactRouterDomRoutes, Route } from 'react-router-dom';

import Loading from '@/components/common/Loading';
import BlizzardLoader from '@/components/common/BlizzardLoader';
import { publicUrls } from '@/config';

const { page } = publicUrls;
const ActivityScreen = loadable(() => import('@/containers/Activity'), {
fallback: <Loading />,
fallback: <BlizzardLoader />,
});
const MetaScreen = loadable(() => import('@/containers/Meta'), {
fallback: <Loading />,
fallback: <BlizzardLoader />,
});
const ProfileScreen = loadable(() => import('@/containers/Profile'), {
fallback: <Loading />,
fallback: <BlizzardLoader />,
});

const AppRoutes = () => {
Expand Down

0 comments on commit cdda558

Please sign in to comment.