Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions 08_Colorpicker/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ _./src/main.tsx_
+ import { App } from './app';

ReactDOM.render(
- <HelloComponent />
- <HelloComponent />
+ <App />,
document.getElementById('root'));
```
Expand Down Expand Up @@ -132,7 +132,7 @@ _./src/colorpicker.tsx_
+ max="255"
+ value={props.color.red}
+ onChange={(event) => props.onColorUpdated(
+ {red: +event.target.value, green:
+ {red: +event.target.value, green:
+ props.color.green, blue: props.color.blue}
+ )}
+ />
Expand Down Expand Up @@ -171,13 +171,13 @@ _./src/app.tsx_
<div>
+ <span>
+ Color: [
+ red: {this.state.color.red},
+ green: {this.state.color.green},
+ red: {this.state.color.red},
+ green: {this.state.color.green},
+ blue: {this.state.color.blue}
+ ]
+ </span>
- <ColorPicker/>
+ <ColorPicker
+ <ColorPicker
+ color={this.state.color}
+ onColorUpdated={this.setColorState}
+ />
Expand Down Expand Up @@ -208,9 +208,9 @@ _./src/colopicker.tsx_
min="0"
max="255"
value={props.color.red}
onChange={(event : any) => props.onColorUpdated(
onChange={(event) => props.onColorUpdated(
{
red: event.target.value,
red: +event.target.value,
green: props.color.green,
blue: props.color.blue
}
Expand All @@ -222,7 +222,7 @@ _./src/colopicker.tsx_
+ min="0"
+ max="255"
+ value={props.color.green}
+ onChange={(event : any) => props.onColorUpdated(
+ onChange={(event) => props.onColorUpdated(
+ {
+ red: props.color.red,
+ green: +event.target.value,
Expand All @@ -236,7 +236,7 @@ _./src/colopicker.tsx_
+ min="0"
+ max="255"
+ value={props.color.blue}
+ onChange={(event : any) => props.onColorUpdated(
+ onChange={(event) => props.onColorUpdated(
+ {
+ red: props.color.red,
+ green: props.color.green,
Expand Down Expand Up @@ -303,7 +303,7 @@ export class App extends React.Component<{}, State> {
public render() {
return (
<div>
+ <ColorDisplayer color={this.state.color} />
+ <ColorDisplayer color={this.state.color} />
<span>
Color: [red: {this.state.color.red}, green: {this.state.color.green}, blue: {this.state.color.blue}]
</span>
Expand Down
24 changes: 12 additions & 12 deletions 08_Colorpicker/readme_es.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ _./src/main.tsx_
+ import { App } from './app';

ReactDOM.render(
- <HelloComponent />
- <HelloComponent />
+ <App />,
document.getElementById('root'));
```
Expand Down Expand Up @@ -131,8 +131,8 @@ _./src/colorpicker.tsx_
+ min="0"
+ max="255"
+ value={props.color.red}
+ onChange={(event : any) => props.onColorUpdated(
+ {red: +event.target.value,
+ onChange={(event) => props.onColorUpdated(
+ {red: +event.target.value,
+ green: props.color.green, blue: props.color.blue}
+ )}
+ />
Expand Down Expand Up @@ -172,13 +172,13 @@ _./src/app.tsx_
+ <span>
+ Color: [
+ red: {this.state.color.red},
+ green: {this.state.color.green},
+ green: {this.state.color.green},
+ blue: {this.state.color.blue}
+ ]
+ </span>
- <ColorPicker/>
+ <ColorPicker
+ color={this.state.color}
+ <ColorPicker
+ color={this.state.color}
+ onColorUpdated={this.setColorState}
+ />
</div>
Expand Down Expand Up @@ -208,9 +208,9 @@ _./src/colopicker.tsx_
min="0"
max="255"
value={props.color.red}
onChange={(event : any) => props.onColorUpdated(
onChange={(event) => props.onColorUpdated(
{
red: event.target.value,
red: +event.target.value,
green: props.color.green,
blue: props.color.blue
}
Expand All @@ -222,7 +222,7 @@ _./src/colopicker.tsx_
+ min="0"
+ max="255"
+ value={props.color.green}
+ onChange={(event : any) => props.onColorUpdated(
+ onChange={(event) => props.onColorUpdated(
+ {
+ red: props.color.red,
+ green: +event.target.value,
Expand All @@ -236,7 +236,7 @@ _./src/colopicker.tsx_
+ min="0"
+ max="255"
+ value={props.color.blue}
+ onChange={(event : any) => props.onColorUpdated(
+ onChange={(event) => props.onColorUpdated(
+ {
+ red: props.color.red,
+ green: props.color.green,
Expand Down Expand Up @@ -303,11 +303,11 @@ export class App extends React.Component<{}, State> {
public render() {
return (
<div>
+ <ColorDisplayer color={this.state.color} />
+ <ColorDisplayer color={this.state.color} />
<span>
Color: [red: {this.state.color.red}, green: {this.state.color.green}, blue: {this.state.color.blue}]
</span>
<ColorPicker color={this.state.color}
<ColorPicker color={this.state.color}
onColorUpdated={this.setColorState.bind(this)}
/>
</div>
Expand Down