|
| 1 | +import React from 'react'; |
| 2 | +import { Link } from 'react-router' |
| 3 | + |
| 4 | +import Error from 'components/Error/Error' |
| 5 | +import styles from 'components/Client/Profile/styles.css' |
| 6 | + |
| 7 | +class Client extends React.Component |
| 8 | +{ |
| 9 | + constructor(props, context) { |
| 10 | + super(props, context); |
| 11 | + super(props); |
| 12 | + this.handleSubmit = this.handleSubmit.bind(this); |
| 13 | + this.state = { |
| 14 | + client : null, |
| 15 | + error : '' |
| 16 | + }; |
| 17 | + } |
| 18 | + |
| 19 | + handleSubmit(e) { |
| 20 | + e.preventDefault(); |
| 21 | + |
| 22 | + for (let i in this.refs) { |
| 23 | + console.log(this.refs[i].value); |
| 24 | + } |
| 25 | + |
| 26 | + } |
| 27 | + |
| 28 | + render() { |
| 29 | + if (this.state.error) { |
| 30 | + return (<Error error={this.state.error} />); |
| 31 | + } |
| 32 | + |
| 33 | + return ( |
| 34 | + <div className="container"> |
| 35 | + <div className="columns is-vcentered"> |
| 36 | + <div className="column is-4 is-offset-4"> |
| 37 | + <h1 className="title"> |
| 38 | + Register a Client |
| 39 | + </h1> |
| 40 | + <form onSubmit={this.handleSubmit}> |
| 41 | + <div className="box"> |
| 42 | + <label className="label">Name</label> |
| 43 | + <p className="control has-icon"> |
| 44 | + <input |
| 45 | + ref='name' |
| 46 | + className="input" |
| 47 | + type="text" |
| 48 | + placeholder="John Smith" |
| 49 | + /> |
| 50 | + <i className="fa fa-id-card-o" aria-hidden="true" /> |
| 51 | + </p> |
| 52 | + <label className="label">Phone</label> |
| 53 | + <p className="control has-icon"> |
| 54 | + <input |
| 55 | + ref='phone' |
| 56 | + className="input" |
| 57 | + type="text" |
| 58 | + placeholder="21 99999-00000" |
| 59 | + /> |
| 60 | + <i className="fa fa-phone" aria-hidden="true" /> |
| 61 | + </p> |
| 62 | + <label className="label">Address</label> |
| 63 | + <p className="control has-icon"> |
| 64 | + <input |
| 65 | + ref='address' |
| 66 | + className="input" |
| 67 | + type="text" |
| 68 | + placeholder="Street 32 - Nª 23" |
| 69 | + /> |
| 70 | + <i className="fa fa-address-card" aria-hidden="true" /> |
| 71 | + </p> |
| 72 | + <label className="label">City</label> |
| 73 | + <p className="control has-icon"> |
| 74 | + <input |
| 75 | + ref='city' |
| 76 | + className="input" |
| 77 | + type="text" |
| 78 | + placeholder="London" |
| 79 | + /> |
| 80 | + <i className="fa fa-address-book" aria-hidden="true" /> |
| 81 | + </p> |
| 82 | + <label className="label">Area</label> |
| 83 | + <p className="control has-icon"> |
| 84 | + <input |
| 85 | + ref='area' |
| 86 | + className="input" |
| 87 | + type="text" |
| 88 | + placeholder="Center" |
| 89 | + /> |
| 90 | + <i className="fa fa-map-marker" aria-hidden="true" /> |
| 91 | + </p> |
| 92 | + <label className="label">Frequency</label> |
| 93 | + <p className="control has-icon"> |
| 94 | + <input |
| 95 | + ref='frequency' |
| 96 | + className="input" |
| 97 | + type="number" |
| 98 | + placeholder="10" |
| 99 | + /> |
| 100 | + <i className="fa fa-calendar-check-o" aria-hidden="true" /> |
| 101 | + </p> |
| 102 | + <label className="label">Ability</label> |
| 103 | + <p className="control has-icon"> |
| 104 | + <input |
| 105 | + ref='ability' |
| 106 | + className="input" |
| 107 | + type="number" |
| 108 | + placeholder="200" |
| 109 | + /> |
| 110 | + <i className="fa fa-shopping-basket" aria-hidden="true" /> |
| 111 | + </p> |
| 112 | + <hr /> |
| 113 | + <p className="control"> |
| 114 | + <button className="button is-primary">Register</button> |
| 115 | + <Link to='/clients' className="button"> |
| 116 | + <span>Cancel</span> |
| 117 | + </Link> |
| 118 | + </p> |
| 119 | + </div> |
| 120 | + </form> |
| 121 | + </div> |
| 122 | + </div> |
| 123 | + </div> |
| 124 | + ); |
| 125 | + } |
| 126 | +} |
| 127 | + |
| 128 | +export default Client; |
| 129 | + |
| 130 | + |
0 commit comments