|
|
@ -177,8 +177,8 @@ class App extends React.Component {
|
|
|
|
state = {
|
|
|
|
state = {
|
|
|
|
count: 0,
|
|
|
|
count: 0,
|
|
|
|
styles: {
|
|
|
|
styles: {
|
|
|
|
backgroundColor: '',
|
|
|
|
backgroundColor: 'black',
|
|
|
|
color: '',
|
|
|
|
color: 'white',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
showDate = (time) => {
|
|
|
|
showDate = (time) => {
|
|
|
@ -216,7 +216,20 @@ class App extends React.Component {
|
|
|
|
greetPeople = () => {
|
|
|
|
greetPeople = () => {
|
|
|
|
alert('Welcome to 30 Days Of React Challenge, 2020')
|
|
|
|
alert('Welcome to 30 Days Of React Challenge, 2020')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
changeBackground = () => {}
|
|
|
|
changeBackground = () => {
|
|
|
|
|
|
|
|
let styles = {...this.state.styles};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( this.state.styles.backgroundColor === 'black' && this.state.styles.color === 'white' ){
|
|
|
|
|
|
|
|
styles.backgroundColor = 'white'
|
|
|
|
|
|
|
|
styles.color = 'black'
|
|
|
|
|
|
|
|
this.setState({ styles });
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
styles.backgroundColor = 'black'
|
|
|
|
|
|
|
|
styles.color = 'white'
|
|
|
|
|
|
|
|
this.setState({ styles });
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
const data = {
|
|
|
|
const data = {
|
|
|
|
welcome: 'Welcome to 30 Days Of React',
|
|
|
|
welcome: 'Welcome to 30 Days Of React',
|
|
|
@ -234,8 +247,7 @@ class App extends React.Component {
|
|
|
|
const user = { ...data.author, image: asabenehImage }
|
|
|
|
const user = { ...data.author, image: asabenehImage }
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className='app'>
|
|
|
|
<div className='app' style={{backgroundColor:this.state.styles.backgroundColor,color:this.state.styles.color}}>
|
|
|
|
{this.state.backgroundColor}
|
|
|
|
|
|
|
|
<Header data={data} />
|
|
|
|
<Header data={data} />
|
|
|
|
<Main
|
|
|
|
<Main
|
|
|
|
user={user}
|
|
|
|
user={user}
|
|
|
@ -248,7 +260,6 @@ class App extends React.Component {
|
|
|
|
count={this.state.count}
|
|
|
|
count={this.state.count}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<Mine/>
|
|
|
|
<Mine/>
|
|
|
|
<Footer date={new Date()} />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|