Skip to content

Commit a536cec

Browse files
authored
Merge pull request #1408 from kleros/fix(web)/evidence-skeleton-overflowing-and-info-card-loading-ui
Fix(web)/evidence skeleton overflowing and info card loading UI
2 parents 9866102 + a48449f commit a536cec

File tree

2 files changed

+26
-8
lines changed

2 files changed

+26
-8
lines changed

web/src/components/StyledSkeleton.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,13 @@ const StyledSkeletonDisputeListItem = styled(Skeleton)`
3232
height: 62px;
3333
`;
3434

35-
const StyledSkeletonEvidenceCard = styled(Skeleton)`
36-
height: 146px;
37-
width: 76vw;
35+
const StyledSkeletonEvidenceContainer = styled.div`
36+
width: 100%;
37+
span {
38+
width: 100%;
39+
height: 146px;
40+
display: flex;
41+
}
3842
`;
3943

4044
export const SkeletonDisputeCard = () => (
@@ -45,4 +49,8 @@ export const SkeletonDisputeCard = () => (
4549

4650
export const SkeletonDisputeListItem = () => <StyledSkeletonDisputeListItem />;
4751

48-
export const SkeletonEvidenceCard = () => <StyledSkeletonEvidenceCard />;
52+
export const SkeletonEvidenceCard = () => (
53+
<StyledSkeletonEvidenceContainer>
54+
<Skeleton />
55+
</StyledSkeletonEvidenceContainer>
56+
);

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

Lines changed: 14 additions & 4 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,12 +73,17 @@ const Voting: React.FC<IVoting> = ({ arbitrable, currentPeriodIndex }) => {
6873
<br />
6974
</>
7075
)}
71-
{!userWasDrawn ? (
76+
77+
{userWasDrawn ? null : (
7278
<>
73-
<InfoCard msg="You were not drawn in current round." />
79+
{isDrawDataLoading ? (
80+
<Skeleton width={300} height={20} />
81+
) : (
82+
<InfoCard msg="You were not drawn in current round." />
83+
)}
7484
<br />
7585
</>
76-
) : null}
86+
)}
7787

7888
{isPopupOpen && (
7989
<Popup

0 commit comments

Comments
 (0)