Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bootstraping sign in / up #139

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions src/components/signed-out/sign-in-form/sign-in-form.component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ import { signInWithGooglePopup,
import FormInput from "../../shared/form-input/form-input.component";
import Button from "../../shared/button/button.component";

import "./sign-in-form.styles.scss";
import "./sign-in-form.styles.jsx";
import { SignInContainer, ButtonContainer } from "./sign-in-form.styles.jsx";

import { errorOnSignIn } from "../../../utils/errors/user.errors";

import { useDispatch } from "react-redux";
import { googleSignInStart, emailSignInStart } from "../../../store/shared/user/user.action";
import { Typography } from "@mui/material";
import { COLOR_CODES } from "../../../utils/constants/shared.constants.js";

const defaultFormFields = {
email: "",
Expand Down Expand Up @@ -60,8 +63,8 @@ const SignInForm = () => {
};

return (
<div className="sign-in-container">
<h2>Sign In</h2>
<SignInContainer>
<Typography sx={{ color: COLOR_CODES.general["0"] }} variant="h6">Log back in</Typography>

<form onSubmit={ handleSubmit }>
<FormInput label="Email" type="email" required onChange={ handleChange }
Expand All @@ -72,18 +75,22 @@ const SignInForm = () => {

<div className="container">
<div className="row justify-content-evenly align-items-center">
<div className="col-sm-12 col-md-2 button-container">
<Button type="submit">Sign In</Button>
<div className="col-sm-12 col-md-2">
<ButtonContainer>
<Button type="submit">Sign In</Button>
</ButtonContainer>
</div>

<div className="col-sm-12 col-md-2 button-container">
<Button buttonType="google-sign-in" type="button"
onClick={ signInWithGoogle }>Google Sign In</Button>
<div className="col-sm-12 col-md-2">
<ButtonContainer>
<Button buttonType="google-sign-in" type="button"
onClick={ signInWithGoogle }>Google Sign In</Button>
</ButtonContainer>
</div>
</div>
</div>
</form>
</div>
</SignInContainer>
);
};

Expand Down
13 changes: 13 additions & 0 deletions src/components/signed-out/sign-in-form/sign-in-form.styles.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import styled from "styled-components";

export const SignInContainer = styled.div`
display: block;
justify-content: center;
align-items: center;
margin: 2% 20% 2% 20%;
`

export const ButtonContainer = styled.div`
width: 300px;
margin-bottom: 4%;
`
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ import { createAuthUserWithEmailAndPassword,
import FormInput from "../../shared/form-input/form-input.component";
import Button from "../../shared/button/button.component";

import "./sign-up-form.styles.scss";
import "./sign-up-form.styles.jsx";
import { SignUpContainer } from "./sign-up-form.styles.jsx";

import { errorOnEmailAlreadyInUse, errorOnUserCreation } from "../../../utils/errors/user.errors";

import { useDispatch } from "react-redux";
import { signUpStart } from "../../../store/shared/user/user.action";
import { Typography } from "@mui/material";
import { COLOR_CODES } from "../../../utils/constants/shared.constants.js";

const defaultFormFields = {
displayName: "",
Expand Down Expand Up @@ -64,8 +67,8 @@ const SignUpForm = () => {
}

return (
<div className="sign-up-container">
<h2>Sign Up</h2>
<SignUpContainer>
<Typography sx={{ color: COLOR_CODES.general["0"] }} variant="h6">Sign Up</Typography>

<form onSubmit={ handleSubmit }>
<FormInput label="Display name" type="text" required onChange={ handleChange }
Expand All @@ -82,7 +85,7 @@ const SignUpForm = () => {

<Button type="submit">Sign Up</Button>
</form>
</div>
</SignUpContainer>
);
};

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import styled from "styled-components";

export const SignUpContainer = styled.div`
display: block;
justify-content: center;
align-items: center;
margin: 2% 20% 2% 20%;
`
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ const AuthenticationRoute = () => {
]

return (
<div className="authentication-container">
<ItemTabs tabList={ tabList } panelList={ panelList }></ItemTabs>
</div>
<ItemTabs tabList={ tabList } panelList={ panelList }></ItemTabs>
);
};

Expand Down
Loading