Skip to content

Commit 3e17477

Browse files
committed
fix(web): add-skeleton-when-drawn-data-loading
1 parent 9866102 commit 3e17477

File tree

1 file changed

+12
-2
lines changed
  • web/src/pages/Cases/CaseDetails/Voting

1 file changed

+12
-2
lines changed

web/src/pages/Cases/CaseDetails/Voting/index.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { getPeriodEndTimestamp } from "components/DisputeCard";
1818
import InfoCard from "components/InfoCard";
1919
import Classic from "./Classic";
2020
import VotingHistory from "./VotingHistory";
21+
import Skeleton from "react-loading-skeleton";
2122

2223
const Container = styled.div`
2324
padding: ${responsiveSize(16, 32)};
@@ -40,7 +41,11 @@ const Voting: React.FC<IVoting> = ({ arbitrable, currentPeriodIndex }) => {
4041
const { id } = useParams();
4142
const { data: disputeData } = useDisputeDetailsQuery(id);
4243
const { data: appealCost } = useAppealCost(id);
43-
const { data: drawData } = useDrawQuery(address?.toLowerCase(), id, disputeData?.dispute?.currentRound.id);
44+
const { data: drawData, isLoading: isDrawDataLoading } = useDrawQuery(
45+
address?.toLowerCase(),
46+
id,
47+
disputeData?.dispute?.currentRound.id
48+
);
4449
const roundId = disputeData?.dispute?.currentRoundIndex;
4550
const voteId = drawData?.draws?.[0]?.voteIDNum;
4651
const { data: voted } = useDisputeKitClassicIsVoteActive({
@@ -68,7 +73,12 @@ const Voting: React.FC<IVoting> = ({ arbitrable, currentPeriodIndex }) => {
6873
<br />
6974
</>
7075
)}
71-
{!userWasDrawn ? (
76+
{isDrawDataLoading ? (
77+
<>
78+
<Skeleton width={300} height={20} />
79+
<br />
80+
</>
81+
) : !userWasDrawn ? (
7282
<>
7383
<InfoCard msg="You were not drawn in current round." />
7484
<br />

0 commit comments

Comments
 (0)