Skip to content

Commit

Permalink
refactor: Skeleton props 개선
Browse files Browse the repository at this point in the history
  • Loading branch information
ojj1123 committed May 6, 2024
1 parent f274995 commit b0636e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions components/atoms/skeleton/Skeleton.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import { Skeleton as ChakraSkeleton } from "@chakra-ui/react";
import { Skeleton as ChakraSkeleton, SkeletonProps } from "@chakra-ui/react";
import { PropsWithChildren } from "react";

interface ISkeleton {
children: React.ReactNode;
isLoad?: boolean;
}
interface ISkeleton extends Pick<SkeletonProps, "isLoaded"> {}

function Skeleton({ children, isLoad }: ISkeleton) {
function Skeleton({ children, isLoaded = false }: PropsWithChildren<ISkeleton>) {
return (
<ChakraSkeleton
borderRadius="8px"
startColor="RGB(227, 230, 235)"
endColor="rgb(246,247,249)"
isLoaded={isLoad}
isLoaded={isLoaded}
height="100%"
width="100%"
>
Expand Down
2 changes: 1 addition & 1 deletion modals/aboutHeader/promotionModal/PromotionModalDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function PromotionModalDetail() {
<div>
<span>현재 참여 수</span>
<VoteNum>
<Skeleton isLoad={!isLoading}>
<Skeleton isLoaded={!isLoading}>
{applyCnt || ""}<Temp>(중복 포함)</Temp>
</Skeleton>
</VoteNum>
Expand Down

0 comments on commit b0636e0

Please sign in to comment.