Skip to content

Commit

Permalink
Merge pull request #1828 from kleros/chore/appeal-loading-skeleton
Browse files Browse the repository at this point in the history
chore: appeal tab improve loading
  • Loading branch information
alcercu authored Jan 13, 2025
2 parents e27997b + 9456601 commit 6f21310
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const LeftContentContainer = styled.div`

export const StyledImage = styled.div`
width: ${responsiveSize(260, 460)};
${landscapeStyle(
() => css`
width: 389px;
Expand Down
35 changes: 16 additions & 19 deletions web/src/pages/Cases/CaseDetails/Appeal/AppealHistory.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import React from "react";
import styled from "styled-components";

import Skeleton from "react-loading-skeleton";

import { useOptionsContext, useFundingContext } from "hooks/useClassicAppealContext";

import HowItWorks from "components/HowItWorks";
import Appeal from "components/Popup/MiniGuides/Appeal";

import OptionCard from "./OptionCard";

import { AppealHeader, StyledTitle } from ".";
import { AppealHeader, StyledTitle } from "./index";

const OptionsContainer = styled.div`
display: grid;
Expand All @@ -26,7 +27,7 @@ const AppealHistory: React.FC<IAppealHistory> = ({ isAppealMiniGuideOpen, toggle
const options = useOptionsContext();
const { winningChoice, paidFees, fundedChoices } = useFundingContext();

return (
return options && options.length > 2 ? (
<div>
<AppealHeader>
<StyledTitle>Appeal Results - Last Round</StyledTitle>
Expand All @@ -37,24 +38,20 @@ const AppealHistory: React.FC<IAppealHistory> = ({ isAppealMiniGuideOpen, toggle
/>
</AppealHeader>
<OptionsContainer>
{options ? (
options.map((option, index) => {
return (
<OptionCard
key={option + index}
text={option}
winner={index.toString() === winningChoice}
funding={BigInt(paidFees?.[index] ?? "0")}
required={fundedChoices?.includes(index.toString()) ? BigInt(paidFees?.[index] ?? "0") : undefined}
canBeSelected={false}
/>
);
})
) : (
<h2>Not in appeal period</h2>
)}
{options.map((option, index) => (
<OptionCard
key={option + index}
text={option}
winner={index.toString() === winningChoice}
funding={BigInt(paidFees?.[index] ?? "0")}
required={fundedChoices?.includes(index.toString()) ? BigInt(paidFees?.[index] ?? "0") : undefined}
canBeSelected={false}
/>
))}
</OptionsContainer>
</div>
) : (
<Skeleton />
);
};
export default AppealHistory;

0 comments on commit 6f21310

Please sign in to comment.