Lemoncode/react-by-sample

Refactor example 15 - Simplify Login component and Form component

rumbado opened this issue · 1 comments

Login component can be simplified extracting all the centering div containers to a common centeredComponent.

export const LoginPage = () => {
  return (
    <centeredComponent>
         <Header/>
         <Form/>
    </centeredComponent>
  );

Form component can be simplified extracting the fields to a formFieldComponent

return (
    <div className="panel-body">
      <form role="form">
        <fieldset>
              <formField text="E-mail" name="email" type="text"/>
              <formField text="Password" name="password" type="password"/>
              <input className="btn btn-lg btn-success btn-block" value="Login"
            onClick={login}
          />
        </fieldset>
      </form>
    </div>
  );

@vicmator or Rocío Will assign it to you, thanks