Skip to content

Commit 005bc9d

Browse files
committed
set skeleton inside contributors modal
1 parent 48c12d4 commit 005bc9d

File tree

1 file changed

+32
-41
lines changed

1 file changed

+32
-41
lines changed

src/components/FileContributors.tsx

Lines changed: 32 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ import {
88
ListItem,
99
ModalBody,
1010
ModalHeader,
11-
Skeleton as ChakraSkeleton,
12-
SkeletonCircle as ChakraSkeletonCircle,
11+
SkeletonText,
1312
UnorderedList,
1413
useBreakpointValue,
1514
VStack,
@@ -34,13 +33,7 @@ const skeletonColorProps = {
3433
endColor: "searchBackgroundEmpty",
3534
}
3635

37-
const Skeleton = (props) => (
38-
<ChakraSkeleton {...skeletonColorProps} borderRadius="md" {...props} />
39-
)
40-
41-
const SkeletonCircle = (props) => (
42-
<ChakraSkeletonCircle {...skeletonColorProps} {...props} />
43-
)
36+
const Skeleton = (props) => <SkeletonText {...skeletonColorProps} {...props} />
4437

4538
const ContributorList = ({ children }: { children: React.ReactNode }) => {
4639
return (
@@ -114,16 +107,18 @@ const FileContributors = ({
114107

115108
<ModalBody>
116109
<Translation id="contributors-thanks" />
117-
{contributors ? (
118-
<ContributorList>
119-
{contributors.map((contributor) => (
120-
<Contributor
121-
contributor={contributor}
122-
key={contributor.email}
123-
/>
124-
))}
125-
</ContributorList>
126-
) : null}
110+
<Skeleton noOfLines="4" mt="4" isLoaded={!loading}>
111+
{contributors ? (
112+
<ContributorList>
113+
{contributors.map((contributor) => (
114+
<Contributor
115+
contributor={contributor}
116+
key={contributor.email}
117+
/>
118+
))}
119+
</ContributorList>
120+
) : null}
121+
</Skeleton>
127122
</ModalBody>
128123
</Modal>
129124

@@ -138,28 +133,24 @@ const FileContributors = ({
138133
<Flex me={4} alignItems="center" flex="1">
139134
{isDesktop && (
140135
<>
141-
<SkeletonCircle size="10" me={4} isLoaded={!loading}>
142-
<Avatar
143-
height="40px"
144-
width="40px"
145-
src={lastContributor.avatarUrl}
146-
name={lastContributor.name}
147-
me={2}
148-
/>
149-
</SkeletonCircle>
150-
151-
<Skeleton isLoaded={!loading}>
152-
<Text m={0} color="text200">
153-
<Translation id="last-edit" />:{" "}
154-
{lastContributor.user?.url && (
155-
<InlineLink href={lastContributor.user.url}>
156-
@{lastContributor.user.login}
157-
</InlineLink>
158-
)}
159-
{!lastContributor.user && <span>{lastContributor.name}</span>}
160-
, {getLocaleTimestamp(locale as Lang, lastEdit)}
161-
</Text>
162-
</Skeleton>
136+
<Avatar
137+
height="40px"
138+
width="40px"
139+
src={lastContributor.avatarUrl}
140+
name={lastContributor.name}
141+
me={2}
142+
/>
143+
144+
<Text m={0} color="text200">
145+
<Translation id="last-edit" />:{" "}
146+
{lastContributor.user?.url && (
147+
<InlineLink href={lastContributor.user.url}>
148+
@{lastContributor.user.login}
149+
</InlineLink>
150+
)}
151+
{!lastContributor.user && <span>{lastContributor.name}</span>},{" "}
152+
{getLocaleTimestamp(locale as Lang, lastEdit)}
153+
</Text>
163154
</>
164155
)}
165156
</Flex>

0 commit comments

Comments
 (0)