1
1
import React , { Component } from 'react' ;
2
- import { Paper , Button , TableHead } from "@material-ui/core" ;
3
- import Grid from '@material-ui/core/Grid' ;
4
- import Table from '@material-ui/core/Table' ;
5
- import TableBody from '@material-ui/core/TableBody' ;
6
- import TableCell from '@material-ui/core/TableCell' ;
7
- import TableContainer from '@material-ui/core/TableContainer' ;
8
- import TableRow from '@material-ui/core/TableRow' ;
2
+ import {
3
+ Grid ,
4
+ Paper ,
5
+ Button ,
6
+ TableHead ,
7
+ Backdrop ,
8
+ CircularProgress ,
9
+ CardContent ,
10
+ TableRow ,
11
+ TableContainer ,
12
+ TableCell ,
13
+ TableBody ,
14
+ Table
15
+ } from "@material-ui/core" ;
16
+
9
17
import { withStyles } from '@material-ui/core/styles' ;
10
- import CircularProgress from '@material-ui/core/CircularProgress' ;
11
18
import _ from 'lodash' ;
12
- import CardContent from "@material-ui/core/CardContent" ;
13
19
import moment from "moment" ;
14
20
15
21
16
22
const styles = theme => ( {
17
- loader : {
18
- marginTop : "40px"
19
- } ,
20
- spinner : {
21
- marginLeft : theme . spacing ( 2 ) ,
22
- display : 'flex' , justifyContent : 'center' , position : 'absolute' , left : '50%' , top : '50%' ,
23
- transform : 'translate(-50%, -50%)'
23
+ backdrop : {
24
+ zIndex : theme . zIndex . drawer + 1 ,
25
+ color : '#fff' ,
24
26
}
25
27
} ) ;
26
28
@@ -77,7 +79,7 @@ class Admin extends Component {
77
79
78
80
this . setState ( { isLoading : true } ) ;
79
81
80
- var formData = new FormData ( ) ;
82
+ let formData = new FormData ( ) ;
81
83
82
84
let files = _ . get ( event , 'target.[0].files' ) ;
83
85
_ . forEach ( files , element => {
@@ -145,11 +147,9 @@ class Admin extends Component {
145
147
return (
146
148
< div style = { { paddingLeft : 20 } } >
147
149
< h1 > Admin Portal</ h1 >
148
- { this . state . isLoading === true ?
149
- < div className = { classes . spinner } >
150
+ < Backdrop className = { classes . backdrop } open = { this . state . isLoading === true } >
150
151
< CircularProgress size = { 60 } />
151
- </ div >
152
- :
152
+ </ Backdrop >
153
153
< Grid container spacing = { 3 } direction = "column" style = { { padding : 30 } } >
154
154
< Grid container spacing = { 3 } direction = "row" >
155
155
< Grid item sm = { 6 } >
@@ -227,16 +227,12 @@ class Admin extends Component {
227
227
</ form >
228
228
</ CardContent >
229
229
</ Paper >
230
-
231
230
</ Grid >
232
-
233
231
</ Grid >
234
-
235
- </ Grid > }
232
+ </ Grid >
236
233
</ div >
237
234
) ;
238
235
}
239
-
240
236
}
241
237
242
238
export default withStyles ( styles ) ( Admin ) ;
0 commit comments