Sha256: 6424f5bc087062986cf48b1edb5e49d0bd999e047a01abe3278100feb2c79c26

Contents?: true

Size: 1.2 KB

Versions: 3

Compression:

Stored size: 1.2 KB

Contents

import React, { Component } from 'react'
import Input from 'react-toolbox/lib/input'
import Button from 'react-toolbox/lib/button'
import style from './style'

class Layout extends Component {
  state = {
    username: this.props.account.username,
    password: this.props.account.password
  }

  handleChange = (key, value) => {
    this.setState({[key]: value})
  }

  handleSubmit() {
    this.props.changeAccount({
      username: this.state.username,
      password: this.state.password
    })
  }

  render() {
    return (
      <div className={style.content}>
        <h1>Account</h1>

        <div className={style.form}>
          <Input
            type='text'
            name='username'
            label='Username'
            value={this.state.username}
            onChange={::this.handleChange.bind(this, 'username')} />

          <Input
            type='password'
            name='password'
            label='Password'
            value={this.state.password}
            onChange={::this.handleChange.bind(this, 'password')} />

          <Button raised primary
            label='Save changes'
            onClick={::this.handleSubmit} />
        </div>
      </div>
    )
  }
}

export default Layout

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bouquet-0.2.2 store/private/static/app/components/layouts/contents/account/layout.js
bouquet-0.2.1 store/private/static/app/components/layouts/contents/account/layout.js
bouquet-0.2.0 store/private/static/app/components/layouts/contents/account/layout.js