Browse Source

Use CheckBox component inside Profile tab

master
meriadec 7 years ago
parent
commit
621b0cf5b5
No known key found for this signature in database GPG Key ID: 1D2FC2305E2CB399
  1. 19
      src/components/SettingsPage/Profile.js

19
src/components/SettingsPage/Profile.js

@ -15,6 +15,7 @@ import { unlock } from 'reducers/application'
import Box, { Card } from 'components/base/Box' import Box, { Card } from 'components/base/Box'
import Input from 'components/base/Input' import Input from 'components/base/Input'
import CheckBox from 'components/base/CheckBox'
import Button from 'components/base/Button' import Button from 'components/base/Button'
import Label from 'components/base/Label' import Label from 'components/base/Label'
@ -80,17 +81,21 @@ class TabProfile extends PureComponent<Props, State> {
render() { render() {
const { inputValue } = this.state const { inputValue } = this.state
const isPasswordChecked = get(inputValue, 'password.state', false)
return ( return (
<form onSubmit={this.handleSubmit}> <form onSubmit={this.handleSubmit}>
<Card flow={3}> <Card flow={3}>
<label> <label>
<Box horizontal align="center" flow={1} style={{ cursor: 'pointer' }}> <Box
<input horizontal
type="checkbox" align="center"
checked={get(inputValue, 'password.state', false)} flow={1}
onChange={e => this.handleChangeInput('password.state')(e.target.checked)} style={{ cursor: 'pointer' }}
/> onClick={() => this.handleChangeInput('password.state')(!isPasswordChecked)}
<div>{' with password'}</div> >
<CheckBox isChecked={isPasswordChecked} />
<div>{' Protect local data with a password'}</div>
</Box> </Box>
</label> </label>
{get(inputValue, 'password.state') === true && ( {get(inputValue, 'password.state') === true && (

Loading…
Cancel
Save