mirror of
https://github.com/ClaytonWWilson/CS307-Team24.git
synced 2025-12-18 11:08:47 +00:00
Add circular progress to home page
This commit is contained in:
parent
739b1cc92a
commit
a0d2532c22
@ -35,17 +35,20 @@ const styles = {
|
|||||||
|
|
||||||
class Home extends Component {
|
class Home extends Component {
|
||||||
state = {
|
state = {
|
||||||
likes: []
|
likes: [],
|
||||||
|
loading: false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
this.setState({loading: true});
|
||||||
axios
|
axios
|
||||||
.get("/getallPosts")
|
.get("/getallPosts")
|
||||||
.then(res => {
|
.then(res => {
|
||||||
// console.log(res.data);
|
// console.log(res.data);
|
||||||
this.setState({
|
this.setState({
|
||||||
posts: res.data
|
posts: res.data,
|
||||||
|
loading: false
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(err => console.log(err));
|
.catch(err => console.log(err));
|
||||||
@ -139,6 +142,7 @@ class Home extends Component {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
authenticated ? (
|
authenticated ? (
|
||||||
|
this.state.loading ? (<CircularProgress size={60} style={{marginTop: "300px"}}></CircularProgress>) :
|
||||||
<Grid container>
|
<Grid container>
|
||||||
<Grid item sm={4} xs={8}>
|
<Grid item sm={4} xs={8}>
|
||||||
<Writing_Microblogs />
|
<Writing_Microblogs />
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user