File tree Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,9 @@ const RoundButtonBlock = styled.button<RoundButtonBlockProps>`
78
78
box-shadow: 0px 2px 12px #00000030;
79
79
}
80
80
cursor: pointer;
81
+ &:disabled {
82
+ background: ${ themedPalette . bg_element2 } ;
83
+ }
81
84
` ;
82
85
83
86
type ButtonProps = React . DetailedHTMLProps <
Original file line number Diff line number Diff line change @@ -35,13 +35,15 @@ export interface RegisterFormProps {
35
35
displayName : string ;
36
36
username : string ;
37
37
} | null ;
38
+ loading : boolean ;
38
39
}
39
40
40
41
const RegisterForm : React . FC < RegisterFormProps > = ( {
41
42
onSubmit,
42
43
fixedEmail,
43
44
error,
44
45
defaultInfo,
46
+ loading,
45
47
} ) => {
46
48
const [ form , onChange ] = useInputs ( {
47
49
displayName : defaultInfo ? defaultInfo . displayName : '' ,
@@ -99,6 +101,7 @@ const RegisterForm: React.FC<RegisterFormProps> = ({
99
101
onSubmit ( { ...form , email : fixedEmail || form . email } )
100
102
}
101
103
size = "LARGE"
104
+ disabled = { loading }
102
105
>
103
106
다음
104
107
</ RoundButton >
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ const RegisterFormContainer: React.FC<RegisterFormContainerProps> = ({
28
28
ignoreQueryPrefix : true ,
29
29
} ) ;
30
30
const client = useApolloClient ( ) ;
31
+ const [ loading , setLoading ] = useState ( false ) ;
31
32
32
33
const [ error , setError ] = useState < null | string > ( null ) ;
33
34
const [ socialProfile , setSocialProfile ] = useState < SocialProfile | null > (
@@ -97,6 +98,7 @@ const RegisterFormContainer: React.FC<RegisterFormContainerProps> = ({
97
98
}
98
99
99
100
try {
101
+ setLoading ( true ) ;
100
102
if ( query . code ) {
101
103
// local email register
102
104
const formWithoutEmail = { ...form } as Partial < RegisterFormType > ;
@@ -114,6 +116,7 @@ const RegisterFormContainer: React.FC<RegisterFormContainerProps> = ({
114
116
} ) ;
115
117
}
116
118
} catch ( e ) {
119
+ setLoading ( false ) ;
117
120
if ( ( e as any ) . response . status === 409 ) {
118
121
setError ( '이미 존재하는 아이디입니다.' ) ;
119
122
return ;
@@ -139,6 +142,7 @@ const RegisterFormContainer: React.FC<RegisterFormContainerProps> = ({
139
142
140
143
return (
141
144
< RegisterForm
145
+ loading = { loading }
142
146
onSubmit = { onSubmit }
143
147
fixedEmail = {
144
148
( registerToken && registerToken . email ) ||
You can’t perform that action at this time.
0 commit comments