forked from podkrepi-bg/frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request podkrepi-bg#12 from daritelska-platforma/create-co…
…mmon-components Added LoginPage, RegisterPage and Footer component
- Loading branch information
Showing
9 changed files
with
171 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
export const routes = { | ||
index: '/', | ||
about: '/about', | ||
login: '/login', | ||
register: '/register', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react' | ||
import { Typography } from '@material-ui/core' | ||
|
||
import styles from './footer.module.scss' | ||
|
||
const Footer = () => ( | ||
<footer className={styles.footer}> | ||
<Typography color="primary" align="center"> | ||
Footer Component | ||
</Typography> | ||
</footer> | ||
) | ||
|
||
export default Footer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.footer { | ||
bottom: 0; | ||
left: 0; | ||
position: fixed; | ||
width: 100%; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import React, { useState } from 'react' | ||
import Layout from 'components/layout/Layout' | ||
import { Typography, Container, Grid, TextField, Button } from '@material-ui/core' | ||
|
||
export default function LoginPage() { | ||
const [email, setEmail] = useState('') | ||
const [password, setPassword] = useState('') | ||
|
||
function handleSubmit(event: React.FormEvent) { | ||
event.preventDefault() | ||
} | ||
|
||
return ( | ||
<Layout> | ||
<Container maxWidth="xs"> | ||
<Typography align="center" variant="h5" color="primary" paragraph={true}> | ||
Login | ||
</Typography> | ||
<form onSubmit={handleSubmit}> | ||
<Grid container spacing={3}> | ||
<Grid item xs={12}> | ||
<TextField | ||
fullWidth | ||
label="Email" | ||
name="email" | ||
type="text" | ||
size="small" | ||
variant="outlined" | ||
autoFocus | ||
value={email} | ||
onChange={(event) => setEmail(event.target.value)} | ||
/> | ||
</Grid> | ||
<Grid item xs={12}> | ||
<TextField | ||
fullWidth | ||
label="Password" | ||
name="password" | ||
type="password" | ||
size="small" | ||
variant="outlined" | ||
value={password} | ||
onChange={(event) => setPassword(event.target.value)} | ||
/> | ||
</Grid> | ||
<Grid item xs={12}> | ||
<Button fullWidth type="submit" color="primary" variant="contained"> | ||
Log in | ||
</Button> | ||
</Grid> | ||
</Grid> | ||
</form> | ||
</Container> | ||
</Layout> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import React, { useState } from 'react' | ||
import Layout from 'components/layout/Layout' | ||
import { Typography, Container, Grid, TextField, Button } from '@material-ui/core' | ||
|
||
export default function RegisterPage() { | ||
const [firstName, setFirstName] = useState('') | ||
const [lastName, setLastName] = useState('') | ||
const [email, setEmail] = useState('') | ||
const [password, setPassword] = useState('') | ||
|
||
function handleSubmit(event: React.FormEvent) { | ||
event.preventDefault() | ||
} | ||
|
||
return ( | ||
<Layout> | ||
<Container maxWidth="xs"> | ||
<Typography align="center" variant="h5" color="primary" paragraph={true}> | ||
Register | ||
</Typography> | ||
<form onSubmit={handleSubmit}> | ||
<Grid container spacing={3}> | ||
<Grid item xs={12} sm={6}> | ||
<TextField | ||
fullWidth | ||
label="First Name" | ||
name="firstName" | ||
type="text" | ||
size="small" | ||
variant="outlined" | ||
autoFocus | ||
value={firstName} | ||
onChange={(event) => setFirstName(event.target.value)} | ||
/> | ||
</Grid> | ||
<Grid item xs={12} sm={6}> | ||
<TextField | ||
fullWidth | ||
label="Last Name" | ||
name="lastName" | ||
type="text" | ||
size="small" | ||
variant="outlined" | ||
value={lastName} | ||
onChange={(event) => setLastName(event.target.value)} | ||
/> | ||
</Grid> | ||
<Grid item xs={12}> | ||
<TextField | ||
fullWidth | ||
label="Email" | ||
name="email" | ||
type="text" | ||
size="small" | ||
variant="outlined" | ||
value={email} | ||
onChange={(event) => setEmail(event.target.value)} | ||
/> | ||
</Grid> | ||
<Grid item xs={12}> | ||
<TextField | ||
fullWidth | ||
label="Password" | ||
name="password" | ||
type="password" | ||
size="small" | ||
variant="outlined" | ||
value={password} | ||
onChange={(event) => setPassword(event.target.value)} | ||
/> | ||
</Grid> | ||
<Grid item xs={12}> | ||
<Button fullWidth type="submit" color="primary" variant="contained"> | ||
Register | ||
</Button> | ||
</Grid> | ||
</Grid> | ||
</form> | ||
</Container> | ||
</Layout> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import LoginPage from 'components/login/LoginPage' | ||
|
||
export default LoginPage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import RegisterPage from 'components/register/RegisterPage' | ||
|
||
export default RegisterPage |