From 866027ba689b1cc939b99eaaaa095717cc07c65a Mon Sep 17 00:00:00 2001 From: Kirstie <39728053+epixieme@users.noreply.github.com> Date: Mon, 2 Sep 2024 17:50:16 +0100 Subject: [PATCH] cleaned and refactored --- src/features/auth/components/SignUpForm.tsx | 4 ---- src/features/auth/hooks/useLogin.tsx | 2 +- src/pages/UserAUnauthorizedPages/LoginPage.tsx | 8 +++++--- src/pages/UserAUnauthorizedPages/SignUpPage.tsx | 8 +++++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/features/auth/components/SignUpForm.tsx b/src/features/auth/components/SignUpForm.tsx index f92c423a..ee2b5c2e 100644 --- a/src/features/auth/components/SignUpForm.tsx +++ b/src/features/auth/components/SignUpForm.tsx @@ -1,10 +1,6 @@ import { useState } from 'react'; -import { useLocation, useNavigate } from 'react-router-dom'; import { CmButton2, CmTextInput } from 'shared/components'; -import { useLogin } from '../hooks'; -import GoogleLogin from './GoogleLogin'; - interface Props { isLoading: boolean; onSignUp: (firstname: string, lastname: string, email: string, password: string) => void; diff --git a/src/features/auth/hooks/useLogin.tsx b/src/features/auth/hooks/useLogin.tsx index cf25374d..b70a7469 100644 --- a/src/features/auth/hooks/useLogin.tsx +++ b/src/features/auth/hooks/useLogin.tsx @@ -24,7 +24,7 @@ function useLogin() { throw new Error('No credential received from Google'); } - const data = await postGoogleLogin(response); + const data = await postGoogleLogin(response.toString()); showSuccessToast(`Welcome back, ${data.user.first_name}!`); const { first_name, last_name, email, quiz_id, user_uuid } = data.user; diff --git a/src/pages/UserAUnauthorizedPages/LoginPage.tsx b/src/pages/UserAUnauthorizedPages/LoginPage.tsx index 8beb051f..efcc3552 100644 --- a/src/pages/UserAUnauthorizedPages/LoginPage.tsx +++ b/src/pages/UserAUnauthorizedPages/LoginPage.tsx @@ -46,9 +46,11 @@ function LoginPage() { {isMobile && navigate(-1)} style={styles.backButton} />} Climate Mind Logo Climate Mind Logo - setShowPasswordResetModal(true)} /> -
- {devMode && } +
+ setShowPasswordResetModal(true)} /> +
+ {devMode && } +
setShowPasswordResetModal(false)} onSubmit={handlePasswordReset} /> diff --git a/src/pages/UserAUnauthorizedPages/SignUpPage.tsx b/src/pages/UserAUnauthorizedPages/SignUpPage.tsx index 9ea44dc1..dbc35fbf 100644 --- a/src/pages/UserAUnauthorizedPages/SignUpPage.tsx +++ b/src/pages/UserAUnauthorizedPages/SignUpPage.tsx @@ -44,9 +44,11 @@ function SignUpPage() { Save your results, see your climate topics, and start talking. - - - +
+ +
+ +
);