Skip to content

Commit b8250e9

Browse files
committed
Bring edit overrides content back into a modal
1 parent 70b93d2 commit b8250e9

11 files changed

Lines changed: 223 additions & 236 deletions

File tree

public/static/DeleteIcon.svg

Lines changed: 8 additions & 8 deletions
Loading

src/components/Authentication/AuthenticationModal.tsx

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useRouter } from "next/router";
2-
import React, { useState } from "react";
2+
import React, { useEffect, useState } from "react";
33
import { Text, Modal } from "../atomic";
44
import Login from "./Login";
55
import Signup from "./Signup";
@@ -18,16 +18,17 @@ const AuthenticationModal = ({
1818
const [isLogin, setIsLogin] = useState(false);
1919
const router = useRouter();
2020

21-
const reset = () => {
22-
setIsLogin(false);
23-
onClose();
24-
}
21+
useEffect(() => {
22+
if (isOpen) {
23+
setIsLogin(false);
24+
}
25+
}, [isOpen]);
2526

2627
return (
27-
<Modal isOpen={isOpen} onClose={reset}>
28+
<Modal isOpen={isOpen} onClose={onClose}>
2829
<div className="flex flex-col w-144">
2930
<button
30-
onClick={reset}
31+
onClick={onClose}
3132
className="cursor-pointer focus:outline-none self-end"
3233
>
3334
<img src="/static/Close.svg" className="h-4 w-4" />
@@ -36,8 +37,8 @@ const AuthenticationModal = ({
3637
<div>
3738
<div className="flex flex-col space-y-1">
3839
{programName ? (
39-
<Text h3 b>
40-
Login to join <Text i>{programName}</Text>
40+
<Text h3>
41+
Login to join <Text b>{programName}</Text>
4142
</Text>
4243
) : (
4344
<Text h3 b>
@@ -58,8 +59,8 @@ const AuthenticationModal = ({
5859
<div>
5960
<div className="flex flex-col">
6061
{programName ? (
61-
<Text h3 b>
62-
Create an account to join <Text i>{programName}</Text>
62+
<Text h3>
63+
Create an account to join <Text b>{programName}</Text>
6364
</Text>
6465
) : (
6566
<Text h3 b>
@@ -75,9 +76,7 @@ const AuthenticationModal = ({
7576
</div>
7677
<div className="h-6" />
7778
<Signup
78-
onSuccessfulGoogleSignup={() => {
79-
location.reload();
80-
}}
79+
onSuccessfulGoogleSignup={onClose}
8180
onSuccessfulEmailSignup={() => {
8281
router.push({
8382
pathname: "/verify",

0 commit comments

Comments
 (0)