Skip to content

Commit

Permalink
Day_8
Browse files Browse the repository at this point in the history
  • Loading branch information
Asabeneh committed Oct 8, 2020
1 parent 62cea63 commit 79a1769
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 31 deletions.
32 changes: 17 additions & 15 deletions 08_Day_States/08_states.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,34 +334,36 @@ class Main extends React.Component {
super(props)
}
render() {
const {
techs,
user,
greetPeople,
handleTime,
changeBackground,
count,
addOne,
minusOne,
} = this.props
return (
<main>
<div className='main-wrapper'>
<p>Prerequisite to get started react.js:</p>
<ul>
<TechList techs={this.props.techs} />
<TechList techs={techs} />
</ul>
<UserCard user={this.props.user} />
<UserCard user={user} />
<Button
text='Greet People'
onClick={this.props.greetPeople}
style={buttonStyles}
/>
<Button
text='Show Time'
onClick={this.props.handleTime}
onClick={greetPeople}
style={buttonStyles}
/>
<Button text='Show Time' onClick={handleTime} style={buttonStyles} />
<Button
text='Change Background'
onClick={this.props.changeBackground}
onClick={changeBackground}
style={buttonStyles}
/>
<Count
count={this.props.count}
addOne={this.props.addOne}
minusOne={this.props.minusOne}
/>
<Count count={count} addOne={addOne} minusOne={minusOne} />
</div>
</main>
)
Expand Down Expand Up @@ -483,7 +485,7 @@ I believe now you have a very good understanding of state. After this, we will u

### Exercise: Level 2

1[Change Background](../images/08_day_changing_background_exercise.gif)
![Change Background](../images/08_day_changing_background_exercise.gif)

🎉 CONGRATULATIONS ! 🎉

Expand Down
30 changes: 16 additions & 14 deletions 08_Day_States/08_states_boilerplate/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,34 +119,36 @@ class Main extends React.Component {
super(props)
}
render() {
const {
techs,
user,
greetPeople,
handleTime,
changeBackground,
count,
addOne,
minusOne,
} = this.props
return (
<main>
<div className='main-wrapper'>
<p>Prerequisite to get started react.js:</p>
<ul>
<TechList techs={this.props.techs} />
<TechList techs={techs} />
</ul>
<UserCard user={this.props.user} />
<UserCard user={user} />
<Button
text='Greet People'
onClick={this.props.greetPeople}
style={buttonStyles}
/>
<Button
text='Show Time'
onClick={this.props.handleTime}
onClick={greetPeople}
style={buttonStyles}
/>
<Button text='Show Time' onClick={handleTime} style={buttonStyles} />
<Button
text='Change Background'
onClick={this.props.changeBackground}
onClick={changeBackground}
style={buttonStyles}
/>
<Count
count={this.props.count}
addOne={this.props.addOne}
minusOne={this.props.minusOne}
/>
<Count count={count} addOne={addOne} minusOne={minusOne} />
</div>
</main>
)
Expand Down
4 changes: 2 additions & 2 deletions readMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
|03|[Setting Up](./03_Day_Setting_Up/03_day_setting_up.md)|
|04|[Components](./04_Day_Component/04_components.md)|
|05|[Props](./05_Day_Props/05_props.md)|
|06|[List, Map and Keys](../06_Day_Map_List_Keys/06_map_list_keys.md)|
|06|[List, Map and Keys](./06_Day_Map_List_Keys/06_map_list_keys.md)|
|07|[Class Components](./07_Day_Class_Components/07_class_components.md)|
|08|[States 😞](./08_Day_States/08_states.md)|
|08|[States](./08_Day_States/08_states.md)|
|09|[Conditional Rendering 😞]()|
|10|[Events 😞]()|
|11|[Forms 😞]()|
Expand Down

0 comments on commit 79a1769

Please sign in to comment.