From 2df2d25cb48a5c7514fa6134d24219f3838102a0 Mon Sep 17 00:00:00 2001 From: asabeneh Date: Fri, 16 Oct 2020 02:55:33 +0300 Subject: [PATCH] Day_16 has been added --- 16_Higher_Order_Component/16_higher_order_component.md | 6 +++--- .../16_higher_order_component_boilerplate/src/index.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/16_Higher_Order_Component/16_higher_order_component.md b/16_Higher_Order_Component/16_higher_order_component.md index ba6ad74..54e4a65 100644 --- a/16_Higher_Order_Component/16_higher_order_component.md +++ b/16_Higher_Order_Component/16_higher_order_component.md @@ -99,7 +99,7 @@ const Button = ({ onClick, text, style }) => { ) } -const buttonWithStyles = (CompParam, bgColor = 'default') => { +const buttonWithStyles = (CompParam, name = 'default') => { const colors = [ { name: 'default', @@ -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, @@ -170,7 +170,7 @@ class App extends Component { text='Info' onClick={() => alert('I am styled with info color')} /> - alert('I am succesful')} /> + alert('I am successful')} /> alert('I warn you many times')} diff --git a/16_Higher_Order_Component/16_higher_order_component_boilerplate/src/index.js b/16_Higher_Order_Component/16_higher_order_component_boilerplate/src/index.js index 2815098..0c00e00 100644 --- a/16_Higher_Order_Component/16_higher_order_component_boilerplate/src/index.js +++ b/16_Higher_Order_Component/16_higher_order_component_boilerplate/src/index.js @@ -9,7 +9,7 @@ const Button = ({ onClick, text, style }) => { ) } -const buttonWithStyles = (CompParam, bgColor = 'default') => { +const buttonWithStyles = (CompParam, name = 'default') => { const colors = [ { name: 'default', @@ -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, @@ -81,7 +81,7 @@ class App extends Component { text='Info' onClick={() => alert('I am styled with info color')} /> - alert('I am succesful')} /> + alert('I am successful')} /> alert('I warn you many times')}