@@ -19,6 +19,12 @@ const EmailLogin = () => {
19
19
modalTitle : "" ,
20
20
modalMessage : "" ,
21
21
} ) ;
22
+ const [ style , setStyle ] = useState ( {
23
+ bgColorEmail : "bg-inputBox" ,
24
+ bgColorPassword : "bg-inputBox" ,
25
+ shadowEmail : "" ,
26
+ shadowPassword : "" ,
27
+ } ) ;
22
28
const { isLoading } = useSelector ( ( state ) => state . LoginSlice ) ;
23
29
24
30
console . log ( isLoading ) ;
@@ -40,12 +46,37 @@ const EmailLogin = () => {
40
46
//유효성검사
41
47
const onValidity = ( event ) => {
42
48
const { id, value } = event . target ;
43
-
44
49
if ( id === "userEmail" ) {
50
+ setStyle ( ( ) => ( {
51
+ ...style ,
52
+ bgColorEmail : "bg-inputBoxFocus" ,
53
+ shadowEmail : "drop-shadow-inputBoxShadow" ,
54
+ } ) ) ;
55
+ if ( value . trim ( ) === "" ) {
56
+ setStyle ( ( ) => ( {
57
+ ...style ,
58
+ bgColorEmail : "bg-inputBox" ,
59
+ shadowEmail : "" ,
60
+ } ) ) ;
61
+ }
45
62
if ( ! emailRegulationExp . test ( value ) ) {
46
63
SetRegulation ( ( ) => ( { ...regulation , regulationEmail : false } ) ) ;
47
- } else SetRegulation ( ( ) => ( { ...regulation , regulationEmail : true } ) ) ;
64
+ } else {
65
+ SetRegulation ( ( ) => ( { ...regulation , regulationEmail : true } ) ) ;
66
+ }
48
67
} else {
68
+ setStyle ( ( ) => ( {
69
+ ...style ,
70
+ bgColorPassword : "bg-inputBoxFocus" ,
71
+ shadowPassword : "drop-shadow-inputBoxShadow" ,
72
+ } ) ) ;
73
+ if ( value . trim ( ) === "" ) {
74
+ setStyle ( ( ) => ( {
75
+ ...style ,
76
+ bgColorPassword : "bg-inputBox" ,
77
+ shadowPassword : "" ,
78
+ } ) ) ;
79
+ }
49
80
if ( ! passwordRegulationExp . test ( value ) ) {
50
81
SetRegulation ( ( ) => ( { ...regulation , regulationPassword : false } ) ) ;
51
82
} else SetRegulation ( ( ) => ( { ...regulation , regulationPassword : true } ) ) ;
@@ -106,6 +137,7 @@ const EmailLogin = () => {
106
137
window . location . href = KAKAO_AUTH_URL ;
107
138
} ;
108
139
140
+ console . log ( { style } ) ;
109
141
return (
110
142
< div className = "container md" >
111
143
< div className = "ml-[20px] mr-[20px]" >
@@ -125,10 +157,13 @@ const EmailLogin = () => {
125
157
< div className = " grid grid-row-2" >
126
158
< Label htmlFor = "userEmail" > 이메일</ Label >
127
159
< LoginSignupInputBox
160
+ type = "text"
128
161
id = "userEmail"
129
162
ref = { userEmailRef }
130
163
onChange = { onValidity }
131
164
placeholder = "아이디(이메일) 입력"
165
+ shadow = { style . shadowEmail }
166
+ bgColor = { style . bgColorEmail }
132
167
/>
133
168
</ div >
134
169
< div className = "flex items-center " >
@@ -144,10 +179,13 @@ const EmailLogin = () => {
144
179
< div className = "grid grid-row-2" >
145
180
< Label htmlFor = "userPassword" > 비밀번호</ Label >
146
181
< LoginSignupInputBox
182
+ type = "password"
147
183
ref = { userPasswordRef }
148
184
onChange = { onValidity }
149
185
id = "userPassword"
150
186
placeholder = "비밀번호 입력"
187
+ shadow = { style . shadowPassword }
188
+ bgColor = { style . bgColorPassword }
151
189
/>
152
190
</ div >
153
191
< div className = "flex items-center " >
@@ -159,6 +197,7 @@ const EmailLogin = () => {
159
197
</ p >
160
198
</ div >
161
199
</ div >
200
+
162
201
< button
163
202
onClick = { onSubmit }
164
203
className = "h-[50px] rounded w-full bg-[#002C51] font-[700] text-[#ffff] mt-[24px]"
@@ -168,14 +207,14 @@ const EmailLogin = () => {
168
207
</ div >
169
208
</ form >
170
209
< div className = "mt-[26px] grid grid-cols-2 text-center" >
171
- < div >
172
- < button className = "text-[#12396F] text-[16px] font-[400] px-[30px] py-[10px]" >
210
+ < div className = "border-4 border-indigo-600" >
211
+ < button className = "text-textBlack text-[16px] font-[400] px-[30px] py-[10px]" >
173
212
비밀번호 재설정
174
213
</ button >
175
214
</ div >
176
215
< div >
177
216
< button
178
- className = "text-[#12396F] text-[16px] font-[400] px-[30px] py-[10px] "
217
+ className = "text-textBlack text-[16px] font-[400] px-[30px] py-[10px] "
179
218
onClick = { ( ) => navigate ( `/signup` ) }
180
219
>
181
220
회원가입
0 commit comments