Fakultas Ilmu Komputer UI

Commit f64c9891 authored by M. Reza Qorib's avatar M. Reza Qorib
Browse files

[#140654507] #12 #13 fix typo on Server component name

parent 4a3f519a
import React from 'react'; import React from 'react';
import { Form, Input, Button, Message, Image } from 'semantic-ui-react'; import { Form, Input, Button, Message, Image } from 'semantic-ui-react';
import { browserHistory } from 'react-router'; import { browserHistory } from 'react-router';
import Server from '../lib/server'; import Server from '../lib/Server';
export default class LoginForm extends React.Component { export default class LoginForm extends React.Component {
...@@ -35,8 +35,8 @@ export default class LoginForm extends React.Component { ...@@ -35,8 +35,8 @@ export default class LoginForm extends React.Component {
const data = { const data = {
type: this.props.type, type: this.props.type,
email: this.state.email, email: this.state.email,
password: this.state.password password: this.state.password,
} };
Server.post('api/login/', data).then(() => { Server.post('api/login/', data).then(() => {
browserHistory.push('/home'); browserHistory.push('/home');
}, () => { }, () => {
...@@ -46,21 +46,21 @@ export default class LoginForm extends React.Component { ...@@ -46,21 +46,21 @@ export default class LoginForm extends React.Component {
render = () => ( render = () => (
<div className="formLogin" > <div className="formLogin" >
<Form onSubmit={(e) => this.handleSubmit(e)} error={this.state.errorFlag}> <Form onSubmit={e => this.handleSubmit(e)} error={this.state.errorFlag}>
<div className="formHeader"> <div className="formHeader">
<Image src={`./assets/img/${this.props.imgSrc}`} size={this.props.imgSize} verticalAlign="middle" /> <span>{ this.props.header }</span> <Image src={`./assets/img/${this.props.imgSrc}`} size={this.props.imgSize} verticalAlign="middle" /> <span>{ this.props.header }</span>
</div> </div>
<Form.Group widths="equal"> <Form.Group widths="equal">
<Form.Field required> <Form.Field required>
<label htmlFor="id"> Email </label> <label htmlFor="id"> Email </label>
<Input type="text" id="email" icon="user" iconPosition="left" placeholder="email" onChange={(e) => this.handleChange(e, 'email')} required /> <Input type="text" id="email" icon="user" iconPosition="left" placeholder="email" onChange={e => this.handleChange(e, 'email')} required />
</Form.Field> </Form.Field>
</Form.Group> </Form.Group>
<Form.Group widths="equal"> <Form.Group widths="equal">
<Form.Field required> <Form.Field required>
<label htmlFor="password"> Password </label> <label htmlFor="password"> Password </label>
<Input type="password" id="password" icon="key" iconPosition="left" placeholder="password" onChange={(e) => this.handleChange(e, 'password')} required /> <Input type="password" id="password" icon="key" iconPosition="left" placeholder="password" onChange={e => this.handleChange(e, 'password')} required />
</Form.Field> </Form.Field>
</Form.Group> </Form.Group>
......
import React from 'react'; import React from 'react';
import { Menu, Image } from 'semantic-ui-react'; import { Menu, Image } from 'semantic-ui-react';
import { Link } from 'react-router'; import { Link } from 'react-router';
import Server from './../lib/server'; import Server from '../lib/Server';
export default class TopMenu extends React.Component { export default class TopMenu extends React.Component {
state = { activeItem: 'home' }; state = { activeItem: 'home' };
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment