Day_16 has been added

pull/72/head
asabeneh 4 years ago
parent 479667a74c
commit 2df2d25cb4

@ -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')}
/>
<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')}

@ -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')}
/>
<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')}

Loading…
Cancel
Save