Skip to content

Commit

Permalink
Day_16 has been added
Browse files Browse the repository at this point in the history
  • Loading branch information
Asabeneh committed Oct 15, 2020
1 parent 479667a commit 2df2d25
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions 16_Higher_Order_Component/16_higher_order_component.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const Button = ({ onClick, text, style }) => {
)
}

const buttonWithStyles = (CompParam, bgColor = 'default') => {
const buttonWithStyles = (CompParam, name = 'default') => {
const colors = [
{
name: 'default',
Expand Down Expand Up @@ -132,7 +132,7 @@ const buttonWithStyles = (CompParam, bgColor = 'default') => {
color: '#ffffff',
},
]
const { backgroundColor, color } = colors.find((c) => c.name === bgColor)
const { backgroundColor, color } = colors.find((c) => c.name === name)

const buttonStyles = {
backgroundColor,
Expand Down Expand Up @@ -170,7 +170,7 @@ class App extends Component {
text='Info'
onClick={() => alert('I am styled with info color')}
/>
<SuccessButton text='Success' onClick={() => alert('I am succesful')} />
<SuccessButton text='Success' onClick={() => alert('I am successful')} />
<WarningButton
text='Warning'
onClick={() => alert('I warn you many times')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const Button = ({ onClick, text, style }) => {
)
}

const buttonWithStyles = (CompParam, bgColor = 'default') => {
const buttonWithStyles = (CompParam, name = 'default') => {
const colors = [
{
name: 'default',
Expand Down Expand Up @@ -42,7 +42,7 @@ const buttonWithStyles = (CompParam, bgColor = 'default') => {
color: '#ffffff',
},
]
const { backgroundColor, color } = colors.find((c) => c.name === bgColor)
const { backgroundColor, color } = colors.find((c) => c.name === name)

const buttonStyles = {
backgroundColor,
Expand Down Expand Up @@ -81,7 +81,7 @@ class App extends Component {
text='Info'
onClick={() => alert('I am styled with info color')}
/>
<SuccessButton text='Success' onClick={() => alert('I am succesful')} />
<SuccessButton text='Success' onClick={() => alert('I am successful')} />
<WarningButton
text='Warning'
onClick={() => alert('I warn you many times')}
Expand Down

0 comments on commit 2df2d25

Please sign in to comment.