Fakultas Ilmu Komputer UI

Loader.jsx 691 Bytes
Newer Older
1
2
3
4
import React from "react";
import { usePromiseTracker } from "react-promise-tracker";
import { Backdrop, CircularProgress } from "@material-ui/core";
import { makeStyles } from "@material-ui/core/styles";
5
import { css } from "@emotion/core";
6
7
8
9
10
11
12
13
14
15
16
const useStyles = makeStyles((theme) => ({
  backdrop: {
    zIndex: theme.zIndex.drawer + 1,
    color: "#6200EE",
  },
}));
const Loader = () => {
  const classes = useStyles();
  const { promiseInProgress } = usePromiseTracker();
  return (
    <Backdrop className={classes.backdrop} open={promiseInProgress}>
17
18
19
20
21
      <CircularProgress
        css={css`
          color: inherit;
        `}
      />
22
23
24
25
26
    </Backdrop>
  );
};

export default Loader;