Skip to content

Commit 67fd514

Browse files
replace loaders with skeleton loaders when comps load
1 parent 5eb2f72 commit 67fd514

File tree

1 file changed

+10
-2
lines changed
  • client/packages/lowcoder-design/src/components

1 file changed

+10
-2
lines changed

client/packages/lowcoder-design/src/components/Loading.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import styled, { css } from "styled-components";
22
import { CSSProperties } from "react";
3+
import { default as Skeleton } from "antd/es/skeleton";
34

45
type LoadingContainerProps = {
56
$backgroundColor: string;
@@ -12,6 +13,8 @@ const LoadingWrapper = styled.div`
1213
flex-direction: column;
1314
align-items: center;
1415
justify-content: center;
16+
width: 100%;
17+
height: 100%;
1518
`;
1619

1720
// Loading
@@ -61,6 +64,10 @@ const Load2 = styled.div<LoadingContainerProps>`
6164
linear-gradient(to right, ${(props) => props.$color}a3, ${(props) => props.$color}1a);
6265
`;
6366

67+
const StyledSkeleton = styled(Skeleton.Button)`
68+
height: 100%;
69+
`;
70+
6471
type LoadingProps = {
6572
backgroundColor?: string;
6673
color?: string;
@@ -77,14 +84,15 @@ export const Loading = (props: LoadingProps) => {
7784
};
7885
return (
7986
<LoadingWrapper className={props.className} style={props.style}>
80-
<ContainerX {...loadingProps}>
87+
{/* <ContainerX {...loadingProps}>
8188
<Container {...loadingProps}>
8289
<Load1 {...loadingProps} />
8390
</Container>
8491
<Container {...loadingProps}>
8592
<Load2 {...loadingProps} />
8693
</Container>
87-
</ContainerX>
94+
</ContainerX> */}
95+
<StyledSkeleton active block style={{height: '100%', animationDuration: '2s'}} />
8896
</LoadingWrapper>
8997
);
9098
};

0 commit comments

Comments
 (0)