mirror of
https://github.com/rjNemo/devbook_ts
synced 2026-06-12 13:36:43 +00:00
add signin page
This commit is contained in:
parent
d5b4acf525
commit
ad918eddac
5 changed files with 36 additions and 3 deletions
|
|
@ -5,6 +5,7 @@ describe('App Router', () => {
|
||||||
cy.visit(ROUTES.LANDING);
|
cy.visit(ROUTES.LANDING);
|
||||||
cy.get('section');
|
cy.get('section');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('contains SignUp page', () => {
|
it('contains SignUp page', () => {
|
||||||
cy.visit(ROUTES.SIGN_UP);
|
cy.visit(ROUTES.SIGN_UP);
|
||||||
cy.get('section');
|
cy.get('section');
|
||||||
|
|
|
||||||
|
|
@ -4,3 +4,4 @@
|
||||||
*/
|
*/
|
||||||
export const LANDING: string = '/';
|
export const LANDING: string = '/';
|
||||||
export const SIGN_UP: string = '/signup';
|
export const SIGN_UP: string = '/signup';
|
||||||
|
export const SIGN_IN: string = '/signin';
|
||||||
|
|
|
||||||
26
src/pages/SignIn.tsx
Normal file
26
src/pages/SignIn.tsx
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
import React, {FC} from 'react';
|
||||||
|
|
||||||
|
const SignUp: FC = () => (
|
||||||
|
<section className="container">
|
||||||
|
<div className="alert alert-danger">Invalid credentials</div>
|
||||||
|
<h1 className="large text-primary">Sign In</h1>
|
||||||
|
<p className="lead">
|
||||||
|
<i className="fa fa-user"></i> Sign into your account
|
||||||
|
</p>
|
||||||
|
<form action="dashboard.html" className="form">
|
||||||
|
<div className="form-group">
|
||||||
|
<input type="email" placeholder="Email Address" />
|
||||||
|
</div>
|
||||||
|
<div className="form-group">
|
||||||
|
<input type="password" placeholder="Password" minLength={6} />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<input type="submit" value="Login" className="btn btn-primary" />
|
||||||
|
</form>
|
||||||
|
<p className="my-1">
|
||||||
|
Don't have an account? <a href="register.html">Sign in</a>
|
||||||
|
</p>
|
||||||
|
</section>
|
||||||
|
);
|
||||||
|
|
||||||
|
export default SignUp;
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
import React, {FC} from 'react';
|
import React, {FC} from 'react';
|
||||||
|
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
|
||||||
|
import {faUser} from '@fortawesome/free-solid-svg-icons';
|
||||||
|
|
||||||
const SignUp: FC = () => (
|
const SignUp: FC = () => (
|
||||||
<section className="container">
|
<section className="container">
|
||||||
<h1 className="large text-primary">Sign Up</h1>
|
<h1 className="large text-primary">Sign Up</h1>
|
||||||
<p className="lead">
|
<p className="lead">
|
||||||
<i className="fa fa-user"></i> Create your account
|
<FontAwesomeIcon icon={faUser} /> Create your account
|
||||||
</p>
|
</p>
|
||||||
<form action="dashboard.html" className="form">
|
<form action="dashboard.html" className="form">
|
||||||
<div className="form-group">
|
<div className="form-group">
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,14 @@ import React, {FC} from 'react';
|
||||||
import {Switch, Route} from 'react-router-dom';
|
import {Switch, Route} from 'react-router-dom';
|
||||||
import Landing from '../pages/Landing';
|
import Landing from '../pages/Landing';
|
||||||
import SignUp from '../pages/SignUp';
|
import SignUp from '../pages/SignUp';
|
||||||
|
import SignIn from '../pages/SignIn';
|
||||||
|
import * as ROUTES from '../constants/routes';
|
||||||
|
|
||||||
const Router: FC = () => (
|
const Router: FC = () => (
|
||||||
<Switch>
|
<Switch>
|
||||||
<Route exact path={'/'} component={Landing} />
|
<Route exact path={ROUTES.LANDING} component={Landing} />
|
||||||
<Route exact path={'/signup'} component={SignUp} />
|
<Route exact path={ROUTES.SIGN_UP} component={SignUp} />
|
||||||
|
<Route exact path={ROUTES.SIGN_IN} component={SignIn} />
|
||||||
</Switch>
|
</Switch>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue