Skip to content

Commit bbe383e

Browse files
committed
fixed modal
1 parent 864f222 commit bbe383e

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

frontend/components/ClubEditPage/ClubEditCard.tsx

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -170,19 +170,28 @@ const EmailModal = ({
170170
show={true}
171171
closeModal={closeModal}
172172
children={
173-
<div>
174-
<div>
173+
<div
174+
style={{
175+
alignItems: 'center',
176+
}}
177+
>
178+
<Text className="card-content">
175179
Warning: This email will be down to the public. We highly recommend
176180
you don't use a personal email, and instead use a club email. Feel
177181
free to ignore this if the email is not a personal email.
178-
</div>
182+
</Text>
179183
<Field
180-
type="email"
181184
name="email"
182185
value={email}
183186
onChange={(e) => setEmail(e.target.value)}
187+
className={`input`}
188+
style={{ maxWidth: '350px', marginBottom: '12px' }}
184189
></Field>
185-
<button onClick={confirmSubmission}>Confirm</button>
190+
<div>
191+
<button onClick={confirmSubmission} className="button is-primary">
192+
Confirm
193+
</button>
194+
</div>
186195
</div>
187196
}
188197
/>
@@ -919,19 +928,21 @@ export default function ClubEditCard({
919928
enableReinitialize
920929
validate={(values) => {
921930
const errors: { email?: string } = {}
922-
if (values.email.includes('upenn.edu')) {
931+
if (values.email.includes('upenn.edu') && !emailModal) {
923932
showEmailModal(true)
924933
errors.email = 'Please confirm your email'
925934
}
926935
return errors
927936
}}
937+
validateOnChange={false}
938+
validateOnBlur={false}
928939
>
929-
{({ dirty, isSubmitting, setFieldValue, submitForm }) => (
940+
{({ dirty, isSubmitting, setFieldValue, submitForm, values }) => (
930941
<Form>
931942
{emailModal && (
932943
<EmailModal
933944
closeModal={() => showEmailModal(false)}
934-
email=""
945+
email={values.email}
935946
setEmail={(newEmail) => setFieldValue('email', newEmail)}
936947
confirmSubmission={() => {
937948
showEmailModal(false)

0 commit comments

Comments
 (0)