Skip to content

Commit e8fef2a

Browse files
committed
feat(repo-details): added loading state to alert
1 parent 378fbd0 commit e8fef2a

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/features/repo-details/index.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Skeleton, Tag, Alert } from "antd";
1+
import { Skeleton, Tag, Alert, Spin } from "antd";
22
import React from "react";
33
import { Link } from "react-router-dom";
44
import { Language, RepoIdentity } from "../../models";
@@ -33,6 +33,9 @@ const RepoDetails = ({ repo: identity }: Props) => {
3333
const collaborators = repository?.collaborators?.nodes?.filter(
3434
(collaborator): collaborator is Collaborator => !!collaborator,
3535
);
36+
const alertDescription =
37+
"For a while, you can't navigate through file" +
38+
" tree of repo - only view the main README";
3639
return (
3740
<div className="flex flex-col">
3841
<DetailsCard className="common-details" title={identity.name}>
@@ -78,12 +81,14 @@ const RepoDetails = ({ repo: identity }: Props) => {
7881
))}
7982
</DetailsCard>
8083
)}
81-
<Alert
82-
style={{ borderRadius: 6, marginTop: 10 }}
83-
showIcon
84-
message="Files access"
85-
description="For a while, you can't navigate thorugh file tree of repo - only view the main README"
86-
/>
84+
<Spin spinning={loading}>
85+
<Alert
86+
style={{ borderRadius: 6, marginTop: 10 }}
87+
showIcon
88+
message="Files access"
89+
description={alertDescription}
90+
/>
91+
</Spin>
8792
</div>
8893
);
8994
};

0 commit comments

Comments
 (0)