From 9ff63d96fd8a9ab99a25f3b1693eeec2d6e37c0c Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Tue, 27 Aug 2024 10:09:41 -0700 Subject: [PATCH] Show an alert when we click the "login" button. Yay, user interactivity. --- src/App.tsx | 2 +- src/AuthModal.tsx | 75 +++++++++++++++++++++++++---------------------- 2 files changed, 41 insertions(+), 36 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index ea2eaa6..a4c562d 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -40,7 +40,7 @@ const App = () => { return (
- {state ?

{state.username}

: } + {state ?

{state.username}

: alert("login")}>}
); }; diff --git a/src/AuthModal.tsx b/src/AuthModal.tsx index 7ae8d89..c421852 100644 --- a/src/AuthModal.tsx +++ b/src/AuthModal.tsx @@ -1,41 +1,46 @@ -import Button from "react-bootstrap/Button"; -import Form from "react-bootstrap/Form"; -import Modal from "react-bootstrap/Modal"; +import Button from "react-bootstrap/Button" +import Form from "react-bootstrap/Form" +import Modal from "react-bootstrap/Modal" -function AuthModal() { - return ( -
- - - Modal title - +import React from "react" - -
- - Email address - - - We'll never share your email with anyone else. - - +type AuthProps = { + doLogin: () => void; +} - - Password - - -
-
+const AuthModal: React.FC = ({ doLogin }) => { + return ( +
+ + + Modal title + - - - - - -
- ); + +
+ + Email address + + + We'll never share your email with anyone else. + + + + + Password + + +
+
+ + + + +
+
+ ); } export default AuthModal;