Skip to content

Commit

Permalink
#11 Add login form and style
Browse files Browse the repository at this point in the history
  • Loading branch information
SandraBergstrom committed Jun 21, 2023
1 parent 4896532 commit e6113a3
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Container from 'react-bootstrap/Container';
import { Route, Switch } from 'react-router-dom';
import './api/axiosDefaults'
import SignUpForm from './pages/auth/SignUpForm';
import LoginForm from './pages/auth/LoginForm'


function App() {
Expand All @@ -13,7 +14,7 @@ function App() {
<Container className={styles.Main}>
<Switch>
<Route exact path="/" render={() => <h1>Home Page</h1>} />
<Route exact path="/login" render={() => <h1>Login!</h1>} />
<Route exact path="/login" render={() => <LoginForm />} />
<Route exact path="/signup" render={() => <SignUpForm />} />
<Route render={() => <p>Page not found!</p>} />
</Switch>
Expand Down
75 changes: 75 additions & 0 deletions src/pages/auth/LoginForm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import React from "react";

import Form from "react-bootstrap/Form";
import Alert from "react-bootstrap/Alert";
import Button from "react-bootstrap/Button";
import Col from "react-bootstrap/Col";
import Row from "react-bootstrap/Row";
import Image from "react-bootstrap/Image";
import Container from "react-bootstrap/Container";

import { Link } from "react-router-dom";

import styles from "../../styles/SignInUpForm.module.css";
import btnStyles from "../../styles/Button.module.css";
import appStyles from "../../App.module.css";

function LogInForm() {
// Add your component logic here

return (
<Row className={styles.Row}>
<Col
md={6}
className={`my-auto d-none d-md-block p-2 ${styles.SignInCol}`}
>
<Image
className={`${appStyles.FillerImage}`}
src={
"https://res.cloudinary.com/sandrabergstrom/image/upload/v1687344960/footstep_g2jfrl.png"
}
/>
</Col>
<Col className="my-auto p-0 p-md-2" md={6}>
<Container className={`${appStyles.Content} p-4 `}>
<h1 className={styles.Header}>log in</h1>

<Form>
<Form.Group controlId="username" className="mb-3">
<Form.Label className="d-none">Username</Form.Label>
<Form.Control
className={styles.Input}
type="text"
placeholder="Enter username"
name="username"
/>
</Form.Group>

<Form.Group controlId="password" className="mb-3">
<Form.Label className="d-none">Password</Form.Label>
<Form.Control
className={styles.Input}
type="password"
placeholder="Password"
/>
</Form.Group>

<Button
className={`${btnStyles.Button} ${btnStyles.Wide} ${btnStyles.Bright}`}
type="submit"
>
Login
</Button>
</Form>
</Container>
<Container className={`mt-3 ${appStyles.Content}`}>
<Link className={styles.Link} to="/signup">
Don't have an account? <span>Sign up now!</span>
</Link>
</Container>
</Col>
</Row>
);
}

export default LogInForm;

0 comments on commit e6113a3

Please sign in to comment.