@@ -170,19 +170,28 @@ const EmailModal = ({
170
170
show = { true }
171
171
closeModal = { closeModal }
172
172
children = {
173
- < div >
174
- < div >
173
+ < div
174
+ style = { {
175
+ alignItems : 'center' ,
176
+ } }
177
+ >
178
+ < Text className = "card-content" >
175
179
Warning: This email will be down to the public. We highly recommend
176
180
you don't use a personal email, and instead use a club email. Feel
177
181
free to ignore this if the email is not a personal email.
178
- </ div >
182
+ </ Text >
179
183
< Field
180
- type = "email"
181
184
name = "email"
182
185
value = { email }
183
186
onChange = { ( e ) => setEmail ( e . target . value ) }
187
+ className = { `input` }
188
+ style = { { maxWidth : '350px' , marginBottom : '12px' } }
184
189
> </ Field >
185
- < button onClick = { confirmSubmission } > Confirm</ button >
190
+ < div >
191
+ < button onClick = { confirmSubmission } className = "button is-primary" >
192
+ Confirm
193
+ </ button >
194
+ </ div >
186
195
</ div >
187
196
}
188
197
/>
@@ -919,19 +928,21 @@ export default function ClubEditCard({
919
928
enableReinitialize
920
929
validate = { ( values ) => {
921
930
const errors : { email ?: string } = { }
922
- if ( values . email . includes ( 'upenn.edu' ) ) {
931
+ if ( values . email . includes ( 'upenn.edu' ) && ! emailModal ) {
923
932
showEmailModal ( true )
924
933
errors . email = 'Please confirm your email'
925
934
}
926
935
return errors
927
936
} }
937
+ validateOnChange = { false }
938
+ validateOnBlur = { false }
928
939
>
929
- { ( { dirty, isSubmitting, setFieldValue, submitForm } ) => (
940
+ { ( { dirty, isSubmitting, setFieldValue, submitForm, values } ) => (
930
941
< Form >
931
942
{ emailModal && (
932
943
< EmailModal
933
944
closeModal = { ( ) => showEmailModal ( false ) }
934
- email = ""
945
+ email = { values . email }
935
946
setEmail = { ( newEmail ) => setFieldValue ( 'email' , newEmail ) }
936
947
confirmSubmission = { ( ) => {
937
948
showEmailModal ( false )
0 commit comments