Skip to content

Feat(web): Appeal Flow #508

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

Closed
wants to merge 13 commits into from
Closed
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
2 changes: 1 addition & 1 deletion web/codegen.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
schema: https://api.thegraph.com/subgraphs/name/alcercu/kleros-core
schema: https://api.thegraph.com/subgraphs/name/alcercu/kleroscoretest
documents: './src/hooks/queries/*.ts'
generates:
src/graphql/generated.ts:
Expand Down
9 changes: 5 additions & 4 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
"generate": "graphql-codegen"
},
"devDependencies": {
"@parcel/transformer-svg-react": "^2.7.0",
"@types/react": "^18.0.24",
"@types/react-dom": "^18.0.6",
"@parcel/transformer-svg-react": "^2.8.2",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.10",
"@types/styled-components": "^5.1.26",
"@typescript-eslint/eslint-plugin": "^5.43.0",
"@typescript-eslint/parser": "^5.43.0",
Expand All @@ -49,7 +49,7 @@
"eslint-plugin-security": "^1.4.0",
"eslint-utils": "^3.0.0",
"lru-cache": "^7.8.0",
"parcel": "^2.7.0",
"parcel": "^2.8.2",
"prettier": "^2.5.1",
"typescript": "^4.5.5"
},
Expand Down Expand Up @@ -79,6 +79,7 @@
"react-loading-skeleton": "^3.1.0",
"react-modal": "^3.16.1",
"react-router-dom": "^6.4.2",
"react-use": "^17.4.0",
"styled-components": "^5.3.6",
"swr": "^1.3.0"
},
Expand Down
4 changes: 2 additions & 2 deletions web/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import Dashboard from "./pages/Dashboard";
const fetcherBuilder =
(url: string) =>
({ query, variables }: { query: string; variables?: any }) => {
console.log("fetching subgraph");
console.log("fetching subgraph", query, variables);
return request(url, query, variables);
};

Expand All @@ -24,7 +24,7 @@ const App: React.FC = () => {
<SWRConfig
value={{
fetcher: fetcherBuilder(
"https://api.thegraph.com/subgraphs/name/kleros/kleros-v2-core-arbitrum-goerli"
"https://api.thegraph.com/subgraphs/name/alcercu/kleroscoretest"
),
}}
>
Expand Down
3 changes: 3 additions & 0 deletions web/src/assets/svgs/icons/gavel.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions web/src/components/DisputeCard/DisputeInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ const Container = styled.div`

const getPeriodPhrase = (period: Periods) => {
switch (period) {
case Periods.Evidence:
case Periods.evidence:
return "Voting Starts";
case Periods.Appeal:
case Periods.appeal:
return "Appeal Deadline";
case Periods.Execution:
case Periods.execution:
return "Final Decision";
default:
return "Voting Deadline";
Expand Down
8 changes: 4 additions & 4 deletions web/src/components/DisputeCard/PeriodBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ export interface IPeriodBanner {

const getPeriodColors = (period: Periods, theme: Theme): [string, string] => {
switch (period) {
case Periods.Appeal:
case Periods.appeal:
return [theme.tint, theme.tintMedium];
case Periods.Execution:
case Periods.execution:
return [theme.secondaryPurple, theme.mediumPurple];
default:
return [theme.primaryBlue, theme.mediumBlue];
Expand Down Expand Up @@ -56,9 +56,9 @@ const Container = styled.div<Omit<IPeriodBanner, "id">>`

const getPeriodLabel = (period: Periods) => {
switch (period) {
case Periods.Appeal:
case Periods.appeal:
return "Crowdfunding Appeal";
case Periods.Execution:
case Periods.execution:
return "Closed";
default:
return "In Progress";
Expand Down
14 changes: 5 additions & 9 deletions web/src/components/DisputeCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,17 @@ const DisputeCard: React.FC<CasesPageQuery["disputes"][number]> = ({
arbitrated,
period,
lastPeriodChange,
courtID,
court,
}) => {
const currentPeriodIndex = Periods[period];
const rewards = `≥ ${utils.formatEther(courtID.feeForJuror)} ETH`;
const rewards = `≥ ${utils.formatEther(court.feeForJuror)} ETH`;
const date =
currentPeriodIndex === 4
? lastPeriodChange
: getTimeLeft(
lastPeriodChange,
currentPeriodIndex,
courtID.timesPerPeriod
);
const { data: metaEvidence } = useGetMetaEvidence(id, arbitrated);
: getTimeLeft(lastPeriodChange, currentPeriodIndex, court.timesPerPeriod);
const { data: metaEvidence } = useGetMetaEvidence(id, arbitrated.id);
const title = metaEvidence ? metaEvidence.title : <Skeleton />;
const { data: courtPolicyPath } = useCourtPolicy(parseInt(courtID.id));
const { data: courtPolicyPath } = useCourtPolicy(court.id);
const { data: courtPolicy } = useIPFSQuery(courtPolicyPath?.args._policy);
const courtName = courtPolicy?.name;
const category = metaEvidence ? metaEvidence.category : undefined;
Expand Down
10 changes: 5 additions & 5 deletions web/src/consts/periods.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export enum Periods {
Evidence,
Commit,
Vote,
Appeal,
Execution,
evidence,
commit,
vote,
appeal,
execution,
}
Loading