-
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.
- Loading branch information
Showing
34 changed files
with
874 additions
and
45 deletions.
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"presets": ["@babel/preset-env", "@babel/preset-react"], | ||
"plugins": [ | ||
["@babel/plugin-proposal-decorators", { "legacy": true }], | ||
["@babel/plugin-proposal-class-properties", { "loose": true }] | ||
] | ||
} |
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,32 @@ | ||
{ | ||
"parser": "babel-eslint", | ||
"env": { | ||
"browser": true, | ||
"node": true, | ||
"es6": true | ||
}, | ||
"plugins": ["react", "prettier"], | ||
"rules": { | ||
"no-plusplus": 0, | ||
"no-underscore-dangle": 0, | ||
"no-mixed-operators": 0, | ||
"class-methods-use-this": 0, | ||
"indent": ["error", 4], | ||
"comma-dangle": 0 | ||
}, | ||
"extends": [ | ||
"airbnb-base", | ||
"plugin:react/recommended", | ||
"plugin:import/errors", | ||
"plugin:import/warnings", | ||
"prettier", | ||
"plugin:compat/recommended" | ||
], | ||
"settings": { | ||
"import/resolver": { | ||
"webpack": { | ||
"config": "webpack.config.dev.js" | ||
} | ||
} | ||
} | ||
} |
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 @@ | ||
12.16.1 |
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,7 @@ | ||
{ | ||
"printWidth": 120, | ||
"useTabs": false, | ||
"tabWidth": 4, | ||
"semi": true, | ||
"singleQuote": true | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,15 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<title>Node</title> | ||
</head> | ||
|
||
<body> | ||
<div id="root"></div> | ||
<script src="./bundle.js"></script> | ||
</body> | ||
|
||
</html> |
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,27 @@ | ||
import React from 'react'; | ||
import Navbar from 'client/components/layout/navbar/navbar.react'; | ||
import Landing from 'client/components/layout/landing/landing.react'; | ||
import Login from 'client/components/auth/login/login.react'; | ||
import Register from 'client/components/auth/register/register.react'; | ||
import Dashboard from 'client/components/dashboard/dashboard.react'; | ||
import PrivateRoute from 'client/components/routing/privateRoute.react'; | ||
import { Route, Switch } from 'react-router-dom'; | ||
import styles from 'client/app.scss'; | ||
|
||
function App() { | ||
return ( | ||
<> | ||
<Navbar /> | ||
<Route exact path="/" component={Landing} /> | ||
<section className={styles.container}> | ||
<Switch> | ||
<Route exact path="/register" component={Register} /> | ||
<Route exact path="/login" component={Login} /> | ||
<PrivateRoute exact path="/dashboard" component={Dashboard} /> | ||
</Switch> | ||
</section> | ||
</> | ||
); | ||
} | ||
|
||
export default App; |
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,20 @@ | ||
* { | ||
padding: 0; | ||
margin: 0; | ||
box-sizing: border-box; | ||
} | ||
|
||
body { | ||
font-family: 'Raleway', sans-serif; | ||
line-height: 1.6; | ||
font-size: 16px; | ||
} | ||
|
||
.container { | ||
max-width: 1100px; | ||
margin: auto; | ||
overflow: hidden; | ||
padding: 0 32px; | ||
margin-top: 96px; | ||
margin-bottom: 48px; | ||
} |
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,89 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import styles from 'client/components/auth/login/login.scss'; | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
import { faUser } from '@fortawesome/free-solid-svg-icons'; | ||
import { Button, TextField } from '@material-ui/core'; | ||
import { Link, Redirect } from 'react-router-dom'; | ||
import { inject, observer } from 'mobx-react'; | ||
|
||
const Login = props => { | ||
const { inProgress, token, doLogin } = props; | ||
|
||
const [formData, setFormData] = React.useState({ | ||
email: '', | ||
password: '' | ||
}); | ||
|
||
const { email, password } = formData; | ||
|
||
const handleInput = e => { | ||
setFormData({ ...formData, [e.target.name]: e.target.value }); | ||
}; | ||
|
||
const handleSubmitForm = e => { | ||
e.preventDefault(); | ||
doLogin(formData); | ||
}; | ||
|
||
if (token) { | ||
return <Redirect to="/dashboard" />; | ||
} | ||
|
||
return ( | ||
<div className={styles.container}> | ||
<h1 className={styles.header}>Sign In</h1> | ||
<p className={styles.subheader}> | ||
<FontAwesomeIcon icon={faUser} /> Sign into Your Account | ||
</p> | ||
<form onSubmit={e => handleSubmitForm(e)}> | ||
<div className={styles.formGroup}> | ||
<TextField | ||
type="email" | ||
placeholder="Email Address" | ||
name="email" | ||
size="small" | ||
fullWidth | ||
variant="outlined" | ||
value={email} | ||
onChange={e => handleInput(e)} | ||
/> | ||
</div> | ||
<div className={styles.formGroup}> | ||
<TextField | ||
type="password" | ||
placeholder="Password" | ||
name="password" | ||
size="small" | ||
fullWidth | ||
variant="outlined" | ||
value={password} | ||
onChange={e => handleInput(e)} | ||
/> | ||
</div> | ||
<Button type="submit" variant="contained" color="primary" disabled={inProgress}> | ||
Login | ||
</Button> | ||
</form> | ||
<p className={styles.alternateRegister}> | ||
Don't have an account? | ||
<Link to="/register" className={styles.link}> | ||
Sign Up | ||
</Link> | ||
</p> | ||
</div> | ||
); | ||
}; | ||
|
||
Login.propTypes = { | ||
inProgress: PropTypes.bool, | ||
token: PropTypes.string, | ||
doLogin: PropTypes.func | ||
}; | ||
|
||
export default inject(stores => ({ | ||
inProgress: stores.auth.inProgress, | ||
// errors: stores.auth.errors, | ||
doLogin: stores.auth.doLogin, | ||
token: stores.common.token | ||
}))(observer(Login)); |
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,33 @@ | ||
.container { | ||
max-width: 1100px; | ||
margin: auto; | ||
overflow: hidden; | ||
padding: 0 32px; | ||
margin-top: 96px; | ||
margin-bottom: 48px; | ||
} | ||
|
||
.header { | ||
font-size: 48px; | ||
line-height: 1.2; | ||
margin-bottom: 16px; | ||
color: #3f51b5; | ||
} | ||
|
||
.subheader { | ||
font-size: 24px; | ||
margin-bottom: 16px; | ||
} | ||
|
||
.formGroup { | ||
margin: 19px 0; | ||
} | ||
|
||
.alternateRegister { | ||
margin: 16px 0; | ||
} | ||
|
||
.link { | ||
text-decoration: none; | ||
color: #3f51b5 | ||
} |
Oops, something went wrong.