2021-10-07 10:22:44 +13:00
|
|
|
import React from 'react'
|
2021-10-07 15:39:12 +13:00
|
|
|
import { Container } from 'reactstrap';
|
|
|
|
import Stepper from '../components/Stepper'
|
2021-10-18 10:38:59 +13:00
|
|
|
import Header from '../components/Header'
|
2021-10-07 10:22:44 +13:00
|
|
|
|
|
|
|
import PlantRepsostory from '../repository/PlantRepository'
|
|
|
|
|
|
|
|
export default class SamplePage extends React.Component {
|
|
|
|
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
|
|
|
|
this.state = {
|
|
|
|
plants: []
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
updatePlants() {
|
|
|
|
PlantRepsostory.getPlants().then(response => {
|
|
|
|
if (response.status === 200) {
|
|
|
|
this.setState({ plants: response.data });
|
|
|
|
}
|
|
|
|
}).catch(e => {
|
|
|
|
this.setState({ plants: ["No plants found."] });
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
this.updatePlants()
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
2021-10-18 10:38:59 +13:00
|
|
|
<Container fluid className='p-0'>
|
|
|
|
<Header/>
|
2021-10-07 10:22:44 +13:00
|
|
|
|
2021-10-07 15:39:12 +13:00
|
|
|
<div className="pt-4">
|
|
|
|
<Stepper plants={this.state.plants} />
|
|
|
|
</div>
|
2021-10-07 10:22:44 +13:00
|
|
|
</Container>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|