Skip to content
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

chore: appeal tab improve loading #1828

Merged
merged 1 commit into from
Jan 13, 2025
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
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;
Loading