Skip to content

Commit

Permalink
hide google buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
Svenstar74 committed Aug 2, 2024
1 parent 03a72d8 commit b16a0bd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/features/auth/components/SignUpForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ interface Props {
}

function SignUpForm({ isLoading, onCancel, onSignUp }: Props) {
// For testing
const devMode = localStorage.getItem('devMode') === 'true';

const [firstname, setFirstname] = useState({ value: '', touched: false });
const [lastname, setLastname] = useState({ value: '', touched: false });
const [email, setEmail] = useState({ value: '', touched: false });
Expand Down Expand Up @@ -99,7 +102,7 @@ function SignUpForm({ isLoading, onCancel, onSignUp }: Props) {
<div style={{ display: 'flex', flexDirection: 'column', justifyContent: 'center', alignItems: 'center', marginTop: 30 }}>
{onCancel && <CmButton text="Cancel" style={{ backgroundColor: 'transparent', borderColor: 'black' }} onClick={onCancel} />}
<CmButton text="Create Account" isLoading={isLoading} type="submit" disabled={!formIsValid} onClick={handleSubmit} />
<button
{devMode && <button
onClick={handleGoogleAuth}
style={{
display: 'flex',
Expand All @@ -122,7 +125,7 @@ function SignUpForm({ isLoading, onCancel, onSignUp }: Props) {
>
<img src="https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/google/google-original.svg" style={{ width: 24, height: 24 }} />
Continue With Google
</button>
</button>}
</div>
</form>
);
Expand Down
7 changes: 5 additions & 2 deletions src/pages/UserAUnauthorizedPages/LoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import Cookies from 'js-cookie';
import { useAppDispatch } from 'store/hooks';

function LoginPage() {
// For testing
const devMode = localStorage.getItem('devMode') === 'true';

const navigate = useNavigate();
const location = useLocation();
const dispatch = useAppDispatch();
Expand Down Expand Up @@ -91,7 +94,7 @@ function LoginPage() {
<CmTypography variant="h3">Sign In</CmTypography>

<LoginForm isLoading={isLoading} onLogin={handleSubmit} onForgotPasswordClick={() => setShowPasswordResetModal(true)} />
<button
{devMode && <button
onClick={handleGoogleAuth}
style={{
display: 'flex',
Expand All @@ -114,7 +117,7 @@ function LoginPage() {
>
<img src="https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/google/google-original.svg" style={{ width: 24, height: 24 }} />
Log In with google
</button>
</button>}
<RequestPasswordResetModal isOpen={showPasswordResetModal} onClose={() => setShowPasswordResetModal(false)} onSubmit={handlePasswordReset} />
</PageContent>
</Page>
Expand Down

0 comments on commit b16a0bd

Please sign in to comment.