added timeslots
This commit is contained in:
parent
2b778223e3
commit
54eb79c738
@ -3,6 +3,8 @@ import React, { Component } from "react";
|
||||
import { callAPI } from "../actions/API";
|
||||
import Cards from "./Pages/Cards";
|
||||
import GenericList from "../root/Pages/GenericList";
|
||||
import { UList } from "../root/common/Functionality/UnorderedList";
|
||||
import { builfArrayFromObject } from "../actions/Error";
|
||||
|
||||
// Homepage/Cards, first API call here to pass down to cards
|
||||
// and the pending migration list, if there's no data, nothing will show
|
||||
@ -17,6 +19,7 @@ export class Home extends Component {
|
||||
super(props);
|
||||
this.state = {
|
||||
migs: [],
|
||||
timeslots: [],
|
||||
};
|
||||
}
|
||||
|
||||
@ -33,6 +36,18 @@ export class Home extends Component {
|
||||
error: error,
|
||||
});
|
||||
});
|
||||
callAPI
|
||||
.get("/timeslots")
|
||||
.then((request) => {
|
||||
this.setState({
|
||||
timeslots: request.data,
|
||||
});
|
||||
})
|
||||
.catch((error) => {
|
||||
this.setState({
|
||||
error: error,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
@ -45,8 +60,8 @@ export class Home extends Component {
|
||||
<Cards migs={this.state.migs} />
|
||||
</div>
|
||||
<div className="col s5">
|
||||
<p>Migrations tracker</p>
|
||||
{/* <Cards migs={this.state.migs} /> */}
|
||||
<p>Current availability for {Date()}</p>
|
||||
<UList listItems={builfArrayFromObject(this.state.timeslots)} />
|
||||
</div>
|
||||
<div className="divider"></div>
|
||||
<div className="section">
|
||||
|
||||
Reference in New Issue
Block a user