Skip to content

Update loaders #1146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Sep 8, 2024
Prev Previous commit
Next Next commit
replace loaders with skeleton loaders when comps load
  • Loading branch information
raheeliftikhar5 committed Sep 6, 2024
commit 67fd51408008d4b6d8fec777be51b3c9397d7580
12 changes: 10 additions & 2 deletions client/packages/lowcoder-design/src/components/Loading.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import styled, { css } from "styled-components";
import { CSSProperties } from "react";
import { default as Skeleton } from "antd/es/skeleton";

type LoadingContainerProps = {
$backgroundColor: string;
Expand All @@ -12,6 +13,8 @@ const LoadingWrapper = styled.div`
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
`;

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

const StyledSkeleton = styled(Skeleton.Button)`
height: 100%;
`;

type LoadingProps = {
backgroundColor?: string;
color?: string;
Expand All @@ -77,14 +84,15 @@ export const Loading = (props: LoadingProps) => {
};
return (
<LoadingWrapper className={props.className} style={props.style}>
<ContainerX {...loadingProps}>
{/* <ContainerX {...loadingProps}>
<Container {...loadingProps}>
<Load1 {...loadingProps} />
</Container>
<Container {...loadingProps}>
<Load2 {...loadingProps} />
</Container>
</ContainerX>
</ContainerX> */}
<StyledSkeleton active block style={{height: '100%', animationDuration: '2s'}} />
</LoadingWrapper>
);
};
Expand Down