Skip to content

Commit

Permalink
docs(choice): Minor updates to example
Browse files Browse the repository at this point in the history
  • Loading branch information
lzcabrera committed Dec 12, 2017
1 parent 7b16f2d commit d6e00cb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
5 changes: 2 additions & 3 deletions src/components/Checkbox/Checkbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ initialState = {
};
const handleCheck = (event) => {
if (event.target.checked === true) {
if (event.target.checked) {
setState({ checked: false, feedback: undefined, message: undefined});
} else {
setState({ checked: true, feedback: 'error', message: message});
}
};
<Checkbox name="terms" value="agree" label="I agree to the terms and conditions" feedback={state.feedback} error={state.message} onChange={handleCheck} checked={state.checked} />
<Checkbox name="terms" value="agree" label="I agree to the terms and conditions" feedback={state.feedback} error={state.message} onChange={handleCheck} checked={state.checked} />
```
26 changes: 12 additions & 14 deletions src/components/Radio/Radio.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,20 @@ initialState = {
choice: undefined
};
const setChoice = (value) => setState({choice: value});
const setChoice = (event) => setState({choice: event.target.value});
<Box tag="fieldset" between={3}>
<form>
<Text size="small">
Choose one combination of area code and first 3 digits to see the available numbers in that range:
<Text size="small">
Choose one combination of area code and first 3 digits to see the available numbers in that range:
</Text>
<Box tag="fieldset" between={2}>
<Text bold size="small">
Area code (416)
</Text>
<Box tag="fieldset" between={2}>
<Text bold size="small">
Area code (416)
</Text>
<Radio label="(416) 547" name="group1" value="a" checked={state.choice === "a"} onChange={e => setChoice(e.target.value)} />
<Radio label="(416) 871" name="group1" value="b" checked={state.choice === "b"} onChange={e => setChoice(e.target.value)} />
<Radio label="(416) 321" name="group1" value="c" checked={state.choice === "c"} onChange={e => setChoice(e.target.value)} />
<Radio label="(416) 384" name="group1" value="d" checked={state.choice === "d"} onChange={e => setChoice(e.target.value)} />
</Box>
</form>
<Radio label="(416) 547" name="area-code" value="547" checked={state.choice === "547"} onChange={setChoice} />
<Radio label="(416) 871" name="area-code" value="871" checked={state.choice === "871"} onChange={setChoice} />
<Radio label="(416) 321" name="area-code" value="321" checked={state.choice === "321"} onChange={setChoice} />
<Radio label="(416) 384" name="area-code" value="384" checked={state.choice === "384"} onChange={setChoice} />
</Box>
</Box>
```

0 comments on commit d6e00cb

Please sign in to comment.