Skip to content

Commit 6f21310

Browse files
authored
Merge pull request #1828 from kleros/chore/appeal-loading-skeleton
chore: appeal tab improve loading
2 parents e27997b + 9456601 commit 6f21310

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

web/src/components/Popup/MiniGuides/PageContentsTemplate.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export const LeftContentContainer = styled.div`
2424

2525
export const StyledImage = styled.div`
2626
width: ${responsiveSize(260, 460)};
27+
2728
${landscapeStyle(
2829
() => css`
2930
width: 389px;
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import React from "react";
22
import styled from "styled-components";
33

4+
import Skeleton from "react-loading-skeleton";
5+
46
import { useOptionsContext, useFundingContext } from "hooks/useClassicAppealContext";
57

68
import HowItWorks from "components/HowItWorks";
79
import Appeal from "components/Popup/MiniGuides/Appeal";
810

911
import OptionCard from "./OptionCard";
10-
11-
import { AppealHeader, StyledTitle } from ".";
12+
import { AppealHeader, StyledTitle } from "./index";
1213

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

29-
return (
30+
return options && options.length > 2 ? (
3031
<div>
3132
<AppealHeader>
3233
<StyledTitle>Appeal Results - Last Round</StyledTitle>
@@ -37,24 +38,20 @@ const AppealHistory: React.FC<IAppealHistory> = ({ isAppealMiniGuideOpen, toggle
3738
/>
3839
</AppealHeader>
3940
<OptionsContainer>
40-
{options ? (
41-
options.map((option, index) => {
42-
return (
43-
<OptionCard
44-
key={option + index}
45-
text={option}
46-
winner={index.toString() === winningChoice}
47-
funding={BigInt(paidFees?.[index] ?? "0")}
48-
required={fundedChoices?.includes(index.toString()) ? BigInt(paidFees?.[index] ?? "0") : undefined}
49-
canBeSelected={false}
50-
/>
51-
);
52-
})
53-
) : (
54-
<h2>Not in appeal period</h2>
55-
)}
41+
{options.map((option, index) => (
42+
<OptionCard
43+
key={option + index}
44+
text={option}
45+
winner={index.toString() === winningChoice}
46+
funding={BigInt(paidFees?.[index] ?? "0")}
47+
required={fundedChoices?.includes(index.toString()) ? BigInt(paidFees?.[index] ?? "0") : undefined}
48+
canBeSelected={false}
49+
/>
50+
))}
5651
</OptionsContainer>
5752
</div>
53+
) : (
54+
<Skeleton />
5855
);
5956
};
6057
export default AppealHistory;

0 commit comments

Comments
 (0)