Skip to content

Fix(web)/evidence skeleton overflowing and info card loading UI #1408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions web/src/components/StyledSkeleton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@ const StyledSkeletonDisputeListItem = styled(Skeleton)`
height: 62px;
`;

const StyledSkeletonEvidenceCard = styled(Skeleton)`
height: 146px;
width: 76vw;
const StyledSkeletonEvidenceContainer = styled.div`
width: 100%;
span {
width: 100%;
height: 146px;
display: flex;
}
`;

export const SkeletonDisputeCard = () => (
Expand All @@ -45,4 +49,8 @@ export const SkeletonDisputeCard = () => (

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

export const SkeletonEvidenceCard = () => <StyledSkeletonEvidenceCard />;
export const SkeletonEvidenceCard = () => (
<StyledSkeletonEvidenceContainer>
<Skeleton />
</StyledSkeletonEvidenceContainer>
);
18 changes: 14 additions & 4 deletions web/src/pages/Cases/CaseDetails/Voting/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { getPeriodEndTimestamp } from "components/DisputeCard";
import InfoCard from "components/InfoCard";
import Classic from "./Classic";
import VotingHistory from "./VotingHistory";
import Skeleton from "react-loading-skeleton";

const Container = styled.div`
padding: ${responsiveSize(16, 32)};
Expand All @@ -40,7 +41,11 @@ const Voting: React.FC<IVoting> = ({ arbitrable, currentPeriodIndex }) => {
const { id } = useParams();
const { data: disputeData } = useDisputeDetailsQuery(id);
const { data: appealCost } = useAppealCost(id);
const { data: drawData } = useDrawQuery(address?.toLowerCase(), id, disputeData?.dispute?.currentRound.id);
const { data: drawData, isLoading: isDrawDataLoading } = useDrawQuery(
address?.toLowerCase(),
id,
disputeData?.dispute?.currentRound.id
);
const roundId = disputeData?.dispute?.currentRoundIndex;
const voteId = drawData?.draws?.[0]?.voteIDNum;
const { data: voted } = useDisputeKitClassicIsVoteActive({
Expand Down Expand Up @@ -68,12 +73,17 @@ const Voting: React.FC<IVoting> = ({ arbitrable, currentPeriodIndex }) => {
<br />
</>
)}
{!userWasDrawn ? (

{userWasDrawn ? null : (
<>
<InfoCard msg="You were not drawn in current round." />
{isDrawDataLoading ? (
<Skeleton width={300} height={20} />
) : (
<InfoCard msg="You were not drawn in current round." />
)}
<br />
</>
) : null}
)}

{isPopupOpen && (
<Popup
Expand Down