feat(web): Add a global query fetch/mutation status
This commit is contained in:
6 files changed
+185
-22
No files matched your search
@@ -0,0 +1,36 @@
|
||||
import { LinearProgress } from "@mui/material";
|
||||
import { useNProgress } from "@tanem/react-nprogress";
|
||||
import React from "react";
|
||||
|
||||
const NProgress: React.FC<{ isAnimating: boolean | number }> = ({
|
||||
isAnimating,
|
||||
}) => {
|
||||
const { animationDuration, isFinished, progress } = useNProgress({
|
||||
isAnimating,
|
||||
});
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
opacity: isFinished ? 0 : 1,
|
||||
pointerEvents: "none",
|
||||
transition: `opacity ${animationDuration}ms linear`,
|
||||
position: "fixed",
|
||||
top: "0",
|
||||
left: "0",
|
||||
right: "0",
|
||||
zIndex: "10000",
|
||||
}}
|
||||
>
|
||||
<LinearProgress
|
||||
sx={{
|
||||
transitionDuration: animationDuration,
|
||||
}}
|
||||
value={progress * 100}
|
||||
variant="determinate"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default NProgress;
|
||||
@@ -10,14 +10,6 @@ const ItemSkeleton = () => {
|
||||
width: "100vw",
|
||||
}}
|
||||
>
|
||||
<LinearProgress
|
||||
sx={{
|
||||
position: "fixed",
|
||||
top: "0",
|
||||
left: 0,
|
||||
right: 0,
|
||||
}}
|
||||
/>
|
||||
<div
|
||||
className="item-hero flex flex-row"
|
||||
style={{
|
||||
|
||||
Reference in new issue
Block a user