Skip to content

Commit 8b613d0

Browse files
update progress bar on skeleton to be infinitely loading
1 parent 894c594 commit 8b613d0

File tree

1 file changed

+29
-26
lines changed

1 file changed

+29
-26
lines changed
Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,17 @@
11
import React from "react";
22
import styled from "@emotion/styled";
33
import { HomeLogo } from "icons/home-logo";
4-
import { AnimatedLineProgressBar } from "@frogress/line";
5-
import { colors } from "theme";
4+
import { withStyles } from "@material-ui/core/styles";
5+
import Box from "@material-ui/core/Box";
6+
import LinearProgress from "@material-ui/core/LinearProgress";
67

78
export function EditorSkeleton({ percent = 0 }: { percent?: number }) {
89
return (
910
<SkeletonWrap>
1011
<LoadingIndicatorContainer>
1112
<HomeLogo />
12-
<AnimatedLineProgressBar
13-
containerColor="#838383"
14-
progressColor="#fff"
15-
defaultValue={0}
16-
percent={percent * 100}
17-
/>
13+
<ColoredLinearProgress />
1814
</LoadingIndicatorContainer>
19-
{/* <Body>
20-
<SidebarMock>
21-
<ListMock>
22-
{[1, 2, 3, 4, 5, 6, 7, 8].map((i) => (
23-
<MockItem1 key={i.toString()}>
24-
<BaseHierarchyItem>
25-
<Frame55>
26-
<Frame52></Frame52>
27-
<Frame324></Frame324>
28-
</Frame55>
29-
</BaseHierarchyItem>
30-
</MockItem1>
31-
))}
32-
</ListMock>
33-
</SidebarMock>
34-
<CanvasMock></CanvasMock>
35-
<CodeEditorMock></CodeEditorMock>
36-
</Body> */}
3715
</SkeletonWrap>
3816
);
3917
}
@@ -65,3 +43,28 @@ const LoadingIndicatorContainer = styled.div`
6543
width: 220px;
6644
height: 88px;
6745
`;
46+
47+
const styles = (props) => ({
48+
colorPrimary: {
49+
backgroundColor: "rgba(255, 255, 255, 0.3)",
50+
},
51+
barColorPrimary: {
52+
backgroundColor: "#fff",
53+
},
54+
});
55+
56+
const ColoredLinearProgress = withStyles(styles)(function (props) {
57+
//@ts-ignore
58+
const { classes } = props;
59+
return (
60+
<Box sx={{ width: "100%" }}>
61+
<LinearProgress
62+
{...props}
63+
classes={{
64+
colorPrimary: classes.colorPrimary,
65+
barColorPrimary: classes.barColorPrimary,
66+
}}
67+
/>
68+
</Box>
69+
);
70+
});

0 commit comments

Comments
 (0)