@@ -8,6 +8,9 @@ import storage from '../../lib/storage';
8
8
import { RootState } from '../../modules' ;
9
9
import { setUser } from '../../modules/core' ;
10
10
import { useApolloClient } from '@apollo/react-hooks' ;
11
+ import styled from 'styled-components' ;
12
+ import palette from '../../lib/styles/palette' ;
13
+ import { toast } from 'react-toastify' ;
11
14
12
15
const mapStateToProps = ( state : RootState ) => ( { } ) ;
13
16
const mapDispatchToProps = {
@@ -42,19 +45,127 @@ const EmailLogin: React.FC<EmailLoginProps> = ({ location, history }) => {
42
45
history . replace ( '/' ) ;
43
46
} catch ( e ) {
44
47
// TODO: show 401
48
+ toast . error ( '잘못된 접근입니다.' ) ;
45
49
history . replace ( '/' ) ;
46
50
}
47
51
} , [ client , history , query . code ] ) ;
48
52
useEffect ( ( ) => {
49
53
if ( ! query . code ) {
50
54
// TODO: show 404
55
+ toast . error ( '잘못된 접근입니다.' ) ;
51
56
history . replace ( '/' ) ;
52
57
}
53
58
processLogin ( ) ;
54
59
} , [ history , location . search , processLogin , query . code ] ) ;
55
- return null ;
60
+
61
+ return (
62
+ < Fullscreen >
63
+ < SpinnerBlock >
64
+ < div className = "sk-chase-dot" > </ div >
65
+ < div className = "sk-chase-dot" > </ div >
66
+ < div className = "sk-chase-dot" > </ div >
67
+ < div className = "sk-chase-dot" > </ div >
68
+ < div className = "sk-chase-dot" > </ div >
69
+ < div className = "sk-chase-dot" > </ div >
70
+ </ SpinnerBlock >
71
+ </ Fullscreen >
72
+ ) ;
56
73
} ;
57
74
75
+ const Fullscreen = styled . div `
76
+ width: 100%;
77
+ height: 100%;
78
+ display: flex;
79
+ align-items: center;
80
+ justify-content: center;
81
+ ` ;
82
+
83
+ const SpinnerBlock = styled . div `
84
+ width: 100px;
85
+ height: 100px;
86
+ position: relative;
87
+ animation: sk-chase 2.5s infinite linear both;
88
+
89
+ .sk-chase-dot {
90
+ width: 100%;
91
+ height: 100%;
92
+ position: absolute;
93
+ left: 0;
94
+ top: 0;
95
+ animation: sk-chase-dot 2s infinite ease-in-out both;
96
+ }
97
+
98
+ .sk-chase-dot:before {
99
+ content: '';
100
+ display: block;
101
+ width: 25%;
102
+ height: 25%;
103
+ background-color: ${ palette . teal6 } ;
104
+ border-radius: 100%;
105
+ animation: sk-chase-dot-before 2s infinite ease-in-out both;
106
+ }
107
+
108
+ .sk-chase-dot:nth-child(1) {
109
+ animation-delay: -1.1s;
110
+ }
111
+ .sk-chase-dot:nth-child(2) {
112
+ animation-delay: -1s;
113
+ }
114
+ .sk-chase-dot:nth-child(3) {
115
+ animation-delay: -0.9s;
116
+ }
117
+ .sk-chase-dot:nth-child(4) {
118
+ animation-delay: -0.8s;
119
+ }
120
+ .sk-chase-dot:nth-child(5) {
121
+ animation-delay: -0.7s;
122
+ }
123
+ .sk-chase-dot:nth-child(6) {
124
+ animation-delay: -0.6s;
125
+ }
126
+ .sk-chase-dot:nth-child(1):before {
127
+ animation-delay: -1.1s;
128
+ }
129
+ .sk-chase-dot:nth-child(2):before {
130
+ animation-delay: -1s;
131
+ }
132
+ .sk-chase-dot:nth-child(3):before {
133
+ animation-delay: -0.9s;
134
+ }
135
+ .sk-chase-dot:nth-child(4):before {
136
+ animation-delay: -0.8s;
137
+ }
138
+ .sk-chase-dot:nth-child(5):before {
139
+ animation-delay: -0.7s;
140
+ }
141
+ .sk-chase-dot:nth-child(6):before {
142
+ animation-delay: -0.6s;
143
+ }
144
+
145
+ @keyframes sk-chase {
146
+ 100% {
147
+ transform: rotate(360deg);
148
+ }
149
+ }
150
+
151
+ @keyframes sk-chase-dot {
152
+ 80%,
153
+ 100% {
154
+ transform: rotate(360deg);
155
+ }
156
+ }
157
+
158
+ @keyframes sk-chase-dot-before {
159
+ 50% {
160
+ transform: scale(0.4);
161
+ }
162
+ 100%,
163
+ 0% {
164
+ transform: scale(1);
165
+ }
166
+ }
167
+ ` ;
168
+
58
169
export default connect < StateProps , DispatchProps , OwnProps , RootState > (
59
170
mapStateToProps ,
60
171
mapDispatchToProps ,
0 commit comments