diff --git a/src/components/login/login.component.tsx b/src/components/login/login.component.tsx index 2b4a526..4c2dbb6 100644 --- a/src/components/login/login.component.tsx +++ b/src/components/login/login.component.tsx @@ -4,6 +4,7 @@ import { ReactElement } from "react"; import { createStore } from "redux"; import { FirebaseService } from "../../commons/firebase.service"; import { SVGs } from "../../commons/svg.list"; +import { SignInForm } from "../signInForm/SignInForm"; import { loginReducer } from "./login.reducer"; import './login.style.scss'; @@ -31,16 +32,17 @@ export class LoginComponent extends React.Component { return(

Please Login

+
); } -} \ No newline at end of file +} diff --git a/src/components/signinForm/SignInForm.scss b/src/components/signinForm/SignInForm.scss new file mode 100644 index 0000000..5d41602 --- /dev/null +++ b/src/components/signinForm/SignInForm.scss @@ -0,0 +1,4 @@ +.form-boxes { + border-width: 2px; + border-color: steelblue; +} \ No newline at end of file diff --git a/src/components/signinForm/SigninForm.js b/src/components/signinForm/SigninForm.js new file mode 100644 index 0000000..5cd5552 --- /dev/null +++ b/src/components/signinForm/SigninForm.js @@ -0,0 +1,54 @@ +/* tslint:disable:no-empty */ +import FormControl from '../../shared/FormControl'; +import PropTypes from 'prop-types'; + +import React, { PureComponent } from 'react'; + +import './SignInForm.scss'; + +export class SignInForm extends PureComponent { + + state = { + email: '', + password: '', + } + + static propTypes = { + action: PropTypes.string.isRequired, + submit: PropTypes.func.isRequired, + } + + handleSubmit = event => { + event.preventDefault(); + this.props.submit(this.state) + .catch(() => {}); + } + + handleChange = ({ target }) => { + this.setState({ [target.email]: target.value }); + } + + render() { + const { action } = this.props; + const { email, password } = this.state; + + return ( +
+ + + + + + + + + + + + +
+ ); + } +} diff --git a/src/shared/FormControl.js b/src/shared/FormControl.js new file mode 100644 index 0000000..4730edb --- /dev/null +++ b/src/shared/FormControl.js @@ -0,0 +1,26 @@ +import React, { PureComponent } from 'react'; + +import PropTypes from 'prop-types'; + +class FormControl extends PureComponent { + + static propTypes = { + children: PropTypes.element, + label: PropTypes.string, + }; + + render() { + const { label, children } = this.props; + + return ( +
+ { label && } +
+ {children} +
+
+ ); + } +} + +export default FormControl; diff --git a/tsconfig.json b/tsconfig.json index 2a0d8cf..d8b585d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,10 +14,10 @@ "noImplicitReturns": true, "noImplicitThis": true, "noImplicitAny": true, - "importHelpers": true, + "importHelpers": false, "strictNullChecks": true, "suppressImplicitAnyIndexErrors": true, - "noUnusedLocals": true + "noUnusedLocals": true, }, "exclude": [ "node_modules",