Skip to content

Commit

Permalink
state
Browse files Browse the repository at this point in the history
  • Loading branch information
CreatinkersLatam committed May 9, 2019
1 parent 75bd1e0 commit 1dee376
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/components/Card.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
import React from 'react'
import exerciseImg from '../images/exercise.png'
import circlesImg from '../images/circles.png'
import './styles/Card.css'

class Card extends React.Component {

constructor(props){
super(props)
this.state = {
image: 'https://firebasestorage.googleapis.com/v0/b/tutoriales-e4830.appspot.com/o/bulbasaur.png?alt=media&token=567caf19-af47-414e-a9d4-3854ab24c7dc'
}
}

componentDidMount(){
setTimeout(() => {
this.setState({
image: 'https://firebasestorage.googleapis.com/v0/b/tutoriales-e4830.appspot.com/o/exercise.png?alt=media&token=b9c4b236-16a9-4a56-bba2-90c9660a0f06'
})
}, 5000)
}

render(){
const { title, description, img, leftColor, rightColor } = this.props
return (
Expand All @@ -16,7 +30,7 @@ class Card extends React.Component {
<div className="card-body">
<div className="row center">
<div className="col-6">
<img src={img} className="float-right"/>
<img src={this.state.image} className="float-right" alt="exercise"/>
</div>
<div className="col-6 Fitness-Card-Info">
<h1>{title}</h1>
Expand Down

0 comments on commit 1dee376

Please sign in to comment.