From cc54d3661848274cd6cae0df160f6917a463cbbc Mon Sep 17 00:00:00 2001 From: Alex <92830192+EtoKruto@users.noreply.github.com> Date: Thu, 20 Jul 2023 18:39:02 -0700 Subject: [PATCH] 306 sign in and modal (new) (#351) * Modal working, test modal opens closes successfully * Modal handleClickOutisde still not working, otherwise removed paths to login/signup page and now all pages show modal correctly * finalized css of the modal, added handleClose function on URL change or when the X on the top right is used * resolved comments, removed google and facebook buttons, changed colors to theme.palette * fixed merge conflicts and typescritp conflicts --- client/src/App.tsx | 44 ++-- client/src/components/Header.tsx | 74 +++--- client/src/components/Modal.tsx | 115 ++++++++++ client/src/components/Modals/SignInModal.tsx | 210 ++++++++++++++++++ client/src/components/Modals/SignUpModal.tsx | 34 +++ .../components/Users/Auth/FacebookAuthBtn.tsx | 4 +- .../components/Users/Auth/GoogleAuthBtn.tsx | 12 +- .../components/Users/Auth/PasswordInput.tsx | 3 + client/src/providers/ModalProvider.tsx | 39 ++++ client/src/providers/index.ts | 1 + client/src/routes/routes.ts | 6 - client/src/views/Main.tsx | 4 - 12 files changed, 482 insertions(+), 64 deletions(-) create mode 100644 client/src/components/Modal.tsx create mode 100644 client/src/components/Modals/SignInModal.tsx create mode 100644 client/src/components/Modals/SignUpModal.tsx create mode 100644 client/src/providers/ModalProvider.tsx diff --git a/client/src/App.tsx b/client/src/App.tsx index b72c6468..9eb78438 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -4,11 +4,13 @@ import { BrowserRouter } from 'react-router-dom'; import { Grid, ThemeProvider, StyledEngineProvider } from '@mui/material'; import theme from './theme'; -import Footer from './components/Footer'; import Header from './components/Header'; import Main from './views/Main'; -import { UserProvider } from './providers'; +import Footer from './components/Footer'; +import Modal from './components/Modal'; +import { UserProvider } from './providers'; +import { ModalProvider } from './providers/ModalProvider'; import { QueryClient, QueryClientProvider } from 'react-query'; import { ReactQueryDevtools } from 'react-query/devtools'; @@ -28,24 +30,28 @@ function App(): JSX.Element { - { - // intentionally left empty callback to block the default browser prompt. - }} - > - + { + // intentionally left empty callback to block the default browser prompt. + }} > -
-
-