Skip to content

Commit

Permalink
replaces all SpacerDiv with Flex
Browse files Browse the repository at this point in the history
  • Loading branch information
pragyakallanagoudar committed May 1, 2024
1 parent 6ab65d5 commit 5a73558
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 40 deletions.
7 changes: 3 additions & 4 deletions src/app/(auth)/confirm-reset-password/page.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
'use client';

import { BigBlueLinkButton } from '@/components/Buttons';
import { SmallCard } from '@/styles/containers';
import { Flex, SmallCard } from '@/styles/containers';
import { H2, H4 } from '@/styles/text';
import { SpacerDiv } from '../styles';

export default function ConfirmResetPassword() {
return (
<SmallCard>
<SpacerDiv>
<Flex $direction="column" $gap="20px">
<H2>Your password has been reset.</H2>
<BigBlueLinkButton href="/login">
<H4 $color="white">Go to Log In</H4>
</BigBlueLinkButton>
</SpacerDiv>
</Flex>
</SmallCard>
);
}
7 changes: 3 additions & 4 deletions src/app/(auth)/email-verified/page.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
'use client';

import { SpacerDiv } from '@/app/(auth)/styles';
import { BigBlueLinkButton } from '@/components/Buttons';
import { SmallCard } from '@/styles/containers';
import { Flex, SmallCard } from '@/styles/containers';
import { H2 } from '@/styles/text';

export default function EmailVerified() {
return (
<SmallCard>
<SpacerDiv>
<Flex $direction="column" $gap="20px">
<H2>Your email has been verified!</H2>
<BigBlueLinkButton type="button" href="/onboarding/roles">
Go to Onboarding
</BigBlueLinkButton>
</SpacerDiv>
</Flex>
</SmallCard>
);
}
8 changes: 4 additions & 4 deletions src/app/(auth)/forgot-password/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import { useState } from 'react';
import isEmail from 'validator/lib/isEmail';
import supabase from '@/api/supabase/createClient';
import { HorizontalDiv, SpacerDiv } from '@/app/(auth)/styles';
import { HorizontalDiv } from '@/app/(auth)/styles';
import { BigBlueButton, Button } from '@/components/Buttons';
import TextInput from '@/components/TextInput/index';
import COLORS from '@/styles/colors';
import { SmallCardForm } from '@/styles/containers';
import { Flex, SmallCardForm } from '@/styles/containers';
import { H1, H2, H4, P } from '@/styles/text';

export default function ForgotPassword() {
Expand Down Expand Up @@ -49,7 +49,7 @@ export default function ForgotPassword() {
</SmallCardForm>
) : (
<SmallCardForm onSubmit={handleForgotPassword}>
<SpacerDiv>
<Flex $direction="column" $gap="20px">
<H2>A password reset link has been sent to your email.</H2>
<H4 $color={COLORS.greyDark}>
This link will direct you to the next step. If you didn’t receive an
Expand All @@ -67,7 +67,7 @@ export default function ForgotPassword() {
<P $color={COLORS.greyMid}>Email has been resent!</P>
)}
</HorizontalDiv>
</SpacerDiv>
</Flex>
</SmallCardForm>
);
}
20 changes: 10 additions & 10 deletions src/app/(auth)/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import { useContext, useState } from 'react';
import { useRouter } from 'next/navigation';
import isEmail from 'validator/lib/isEmail';
import { H4Centered, SpacerDiv } from '@/app/(auth)/styles';
import { H4Centered } from '@/app/(auth)/styles';
import { BigBlueButton } from '@/components/Buttons';
import TextInput from '@/components/TextInput/index';
import COLORS from '@/styles/colors';
import { SmallCardForm } from '@/styles/containers';
import { Flex, SmallCardForm } from '@/styles/containers';
import { H1, LinkColored, P } from '@/styles/text';
import { useAuth } from '@/utils/AuthProvider';
import { ProfileContext } from '@/utils/ProfileProvider';
Expand Down Expand Up @@ -52,12 +52,12 @@ export default function Login() {

return (
<SmallCardForm onSubmit={handleSignIn}>
<SpacerDiv $gap={0.625}>
<Flex $direction="column" $gap="10px">
<H1>Log In</H1>
{errorMessage !== '' && <P $color={COLORS.redMid}>{errorMessage}</P>}
</SpacerDiv>
<SpacerDiv $gap={0.8125}>
<SpacerDiv>
</Flex>
<Flex $direction="column" $gap="13px">
<Flex $direction="column" $gap="20px">
<TextInput
label="Email"
placeholder="[email protected]"
Expand All @@ -76,22 +76,22 @@ export default function Login() {
value={password}
setValue={setPassword}
/>
</SpacerDiv>
</Flex>
<P>
<LinkColored href="/forgot-password" $color={COLORS.greyMid}>
Forgot your password?
</LinkColored>
</P>
</SpacerDiv>
<SpacerDiv>
</Flex>
<Flex $direction="column" $gap="20px">
<BigBlueButton type="submit">Log in</BigBlueButton>
<H4Centered>
Don’t have an account yet?{' '}
<LinkColored $color={COLORS.greyDark} href="/signup">
Sign up
</LinkColored>
</H4Centered>
</SpacerDiv>
</Flex>
</SmallCardForm>
);
}
15 changes: 7 additions & 8 deletions src/app/(auth)/reset-password/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ import { useEffect, useState } from 'react';
import { useRouter } from 'next/navigation';
import supabase from '@/api/supabase/createClient';
import { verifyUserPassword } from '@/api/supabase/queries/password';
import { SpacerDiv } from '@/app/(auth)/styles';
import { BigBlueButton } from '@/components/Buttons';
import PasswordComplexity from '@/components/PasswordComplexity';
import TextInput from '@/components/TextInput/index';
import COLORS from '@/styles/colors';
import { SmallCardForm } from '@/styles/containers';
import { Flex, SmallCardForm } from '@/styles/containers';
import { H1, H4, P } from '@/styles/text';
import { useAuth } from '@/utils/AuthProvider';

Expand Down Expand Up @@ -63,12 +62,12 @@ export default function ResetPassword() {

return canReset ? (
<SmallCardForm onSubmit={handleResetPassword}>
<SpacerDiv $gap={10}>
<Flex $direction="column" $gap="10px">
<H1>Set New Password</H1>
{errorMessage !== '' && <P $color={COLORS.redMid}>{errorMessage}</P>}
</SpacerDiv>
<SpacerDiv>
<SpacerDiv $gap={8}>
</Flex>
<Flex $direction="column" $gap="20px">
<Flex $direction="column" $gap="8px">
<TextInput
label="New Password"
placeholder="Password"
Expand All @@ -81,7 +80,7 @@ export default function ResetPassword() {
password={newPassword}
setComplexity={setPasswordComplexity}
/>
</SpacerDiv>
</Flex>
<TextInput
label="Confirm New Password"
placeholder="Password"
Expand All @@ -90,7 +89,7 @@ export default function ResetPassword() {
value={newPassword2}
setValue={setNewPassword2}
/>
</SpacerDiv>
</Flex>
<BigBlueButton type="submit">
<H4 $color="white">Set Password</H4>
</BigBlueButton>
Expand Down
20 changes: 10 additions & 10 deletions src/app/(auth)/signup/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import { useState } from 'react';
import isEmail from 'validator/lib/isEmail';
import supabase from '@/api/supabase/createClient';
import { H4Centered, HorizontalDiv, SpacerDiv } from '@/app/(auth)/styles';
import { H4Centered, HorizontalDiv } from '@/app/(auth)/styles';
import { BigBlueButton, Button } from '@/components/Buttons';
import PasswordComplexity from '@/components/PasswordComplexity';
import TextInput from '@/components/TextInput/index';
import COLORS from '@/styles/colors';
import { SmallCardForm } from '@/styles/containers';
import { Flex, SmallCardForm } from '@/styles/containers';
import { H1, H2, H4, LinkColored, P } from '@/styles/text';
import { useAuth } from '@/utils/AuthProvider';

Expand Down Expand Up @@ -78,12 +78,12 @@ export default function SignUp() {
<>
{!emailSentCount && (
<SmallCardForm onSubmit={handleSignUp}>
<SpacerDiv $gap={10}>
<Flex $direction="column" $gap="10px">
<H1>Sign Up</H1>
{errorMessage !== '' && (
<P $color={COLORS.redMid}>{errorMessage}</P>
)}
</SpacerDiv>
</Flex>
<TextInput
label="Email"
placeholder="[email protected]"
Expand All @@ -93,7 +93,7 @@ export default function SignUp() {
value={email}
setValue={setEmail}
/>
<SpacerDiv $gap={8}>
<Flex $direction="column" $gap="8px">
<TextInput
label="Password"
placeholder="Password"
Expand All @@ -107,7 +107,7 @@ export default function SignUp() {
password={password}
setComplexity={setPasswordComplexity}
/>
</SpacerDiv>
</Flex>
<TextInput
label="Confirm Password"
placeholder="Confirm Password"
Expand All @@ -116,20 +116,20 @@ export default function SignUp() {
value={confirmPassword}
setValue={setConfirmPassword}
/>
<SpacerDiv>
<Flex $direction="column" $gap="20px">
<BigBlueButton type="submit">Sign Up</BigBlueButton>
<H4Centered>
Have an account already?{' '}
<LinkColored $color={COLORS.greyDark} href="/login">
Log In
</LinkColored>
</H4Centered>
</SpacerDiv>
</Flex>
</SmallCardForm>
)}
{emailSentCount > 0 && (
<SmallCardForm onSubmit={handleSignUp}>
<SpacerDiv>
<Flex $direction="column" $gap="20px">
<H2>An email verification link has been sent.</H2>
<H4 $color={COLORS.greyDark}>
This link will direct you to the next step. If you didn’t receive
Expand All @@ -147,7 +147,7 @@ export default function SignUp() {
<P $color={COLORS.greyMid}>Email has been resent!</P>
)}
</HorizontalDiv>
</SpacerDiv>
</Flex>
</SmallCardForm>
)}
</>
Expand Down

0 comments on commit 5a73558

Please sign in to comment.