Skip to content

Commit

Permalink
Merge pull request #290 from woowa-techcamp-2021/develop
Browse files Browse the repository at this point in the history
v1.0.4
  • Loading branch information
sanginchun authored Aug 31, 2021
2 parents 0458e69 + 9c576f3 commit e4f4c5b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
2 changes: 1 addition & 1 deletion client/src/components/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const App = (): JSX.Element => {
<GlobalStyle />
<Router>
<Header />
<Suspense fallback={Loading}>
<Suspense fallback={<Loading />}>
<Switch>
<Route exact path="/" component={HomePage} />
<Route exact path="/login" component={LoginPage} />
Expand Down
34 changes: 32 additions & 2 deletions client/src/components/Loading/Loading.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,42 @@
import React from 'react';
import styled from 'styled-components';
import styled, { keyframes } from 'styled-components';
import { RiLoader4Line } from 'react-icons/ri';

const spin = keyframes`
from {
transform: translate(-50%, -50%) rotate(0deg);
}
to {
transform: translate(-50%, -50%) rotate(360deg);
}
`;

const Spinner = styled(RiLoader4Line)`
position: absolute;
top: 40%;
left: 50%;
transform-origin: center;
animation: ${spin} 1s infinite;
color: ${(props) => props.theme.color.grey5};
`;

const Container = styled.div`
position: fixed;
top: 0;
width: 100%;
height: 100%;
font-size: ${(props) => props.theme.fontSize.xLarge};
background-color: rgba(255, 255, 255, 0.3);
z-index: 99;
`;

const Loading = (): JSX.Element => {
return <Container>잠시만 기다려주세요</Container>;
return (
<Container>
<Spinner />
</Container>
);
};

export default Loading;

0 comments on commit e4f4c5b

Please sign in to comment.