Skip to content

Commit 2ffcefd

Browse files
authored
Merge branch 'dev' into dependabot/npm_and_yarn/dev/viem-1.16.1
2 parents e4d673c + 70b1de5 commit 2ffcefd

File tree

17 files changed

+102
-55
lines changed

17 files changed

+102
-55
lines changed

subgraph/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"create-local": "graph create --node http://localhost:8020/ kleros/kleros-v2-core-local",
1616
"remove-local": "graph remove --node http://localhost:8020/ kleros/kleros-v2-core-local",
1717
"deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 kleros/kleros-v2-core-local --version-label v$(date +%s)",
18-
"rebuild-deploy-local": "yarn update:local && yarn codegen && yarn create-local && yarn deploy-local",
18+
"rebuild-deploy-local": "yarn update:local && yarn codegen && yarn build && yarn create-local && yarn deploy-local",
1919
"start-local-indexer": "docker compose -f ../services/graph-node/docker-compose.yml up -d && docker compose -f ../services/graph-node/docker-compose.yml logs -f",
2020
"stop-local-indexer": "docker compose -f ../services/graph-node/docker-compose.yml down && rm -rf ../services/graph-node/data"
2121
},

subgraph/src/entities/Round.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
import { BigInt } from "@graphprotocol/graph-ts";
2-
import { KlerosCore__getRoundInfoResult } from "../../generated/KlerosCore/KlerosCore";
2+
import { KlerosCore__getRoundInfoResultValue0Struct } from "../../generated/KlerosCore/KlerosCore";
33
import { Round } from "../../generated/schema";
44

55
export function createRoundFromRoundInfo(
66
disputeID: BigInt,
77
roundIndex: BigInt,
8-
roundInfo: KlerosCore__getRoundInfoResult
8+
roundInfo: KlerosCore__getRoundInfoResultValue0Struct
99
): void {
1010
const roundID = `${disputeID.toString()}-${roundIndex.toString()}`;
1111
const round = new Round(roundID);
12-
const feeToken = roundInfo.getFeeToken().toHexString();
12+
const feeToken = roundInfo.feeToken.toHexString();
1313
round.feeToken = feeToken === "0x0000000000000000000000000000000000000000" ? null : feeToken;
14-
round.disputeKit = roundInfo.getDisputeKitID().toString();
15-
round.tokensAtStakePerJuror = roundInfo.getPnkAtStakePerJuror();
16-
round.totalFeesForJurors = roundInfo.getTotalFeesForJurors();
17-
round.nbVotes = roundInfo.getNbVotes();
18-
round.repartitions = roundInfo.getRepartitions();
19-
round.penalties = roundInfo.getPnkPenalties();
14+
round.disputeKit = roundInfo.disputeKitID.toString();
15+
round.tokensAtStakePerJuror = roundInfo.pnkAtStakePerJuror;
16+
round.totalFeesForJurors = roundInfo.totalFeesForJurors;
17+
round.nbVotes = roundInfo.nbVotes;
18+
round.repartitions = roundInfo.repartitions;
19+
round.penalties = roundInfo.pnkPenalties;
2020
round.dispute = disputeID.toString();
2121
round.save();
2222
}

subgraph/subgraph.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ dataSources:
66
name: KlerosCore
77
network: arbitrum-goerli
88
source:
9-
address: "0x791812B0B9f2ba260B2DA432BB02Ee23BC1bB509"
9+
address: "0x813DCc76dbA91DD9f6bDD038aea0877FC95656bE"
1010
abi: KlerosCore
11-
startBlock: 33640331
11+
startBlock: 43823780
1212
mapping:
1313
kind: ethereum/events
1414
apiVersion: 0.0.6
@@ -26,9 +26,9 @@ dataSources:
2626
- Counter
2727
abis:
2828
- name: DisputeKitClassic
29-
file: ../contracts/deployments/arbitrumGoerli/DisputeKitClassic.json
29+
file: ../contracts/deployments/arbitrumGoerliDevnet/DisputeKitClassic.json
3030
- name: KlerosCore
31-
file: ../contracts/deployments/arbitrumGoerli/KlerosCore.json
31+
file: ../contracts/deployments/arbitrumGoerliDevnet/KlerosCore.json
3232
eventHandlers:
3333
- event: AppealDecision(indexed uint256,indexed address)
3434
handler: handleAppealDecision
@@ -48,7 +48,7 @@ dataSources:
4848
handler: handleDisputeKitEnabled
4949
- event: StakeSet(indexed address,uint256,uint256)
5050
handler: handleStakeSet
51-
- event: StakeDelayed(indexed address,uint256,uint256,uint256)
51+
- event: StakeDelayed(indexed address,uint256,uint256)
5252
handler: handleStakeDelayed
5353
- event: TokenAndETHShift(indexed address,indexed uint256,indexed uint256,uint256,int256,int256,address)
5454
handler: handleTokenAndETHShift
@@ -61,9 +61,9 @@ dataSources:
6161
name: PolicyRegistry
6262
network: arbitrum-goerli
6363
source:
64-
address: "0x4c129b9836E4CC3Cf6D833b39a4B7cfA25D86c86"
64+
address: "0x0d7EeA661C1f9cB1AD389c9Df90B3beDE86a1529"
6565
abi: PolicyRegistry
66-
startBlock: 33436566
66+
startBlock: 43823685
6767
mapping:
6868
kind: ethereum/events
6969
apiVersion: 0.0.6
@@ -72,7 +72,7 @@ dataSources:
7272
- Court
7373
abis:
7474
- name: PolicyRegistry
75-
file: ../contracts/deployments/arbitrumGoerli/PolicyRegistry.json
75+
file: ../contracts/deployments/arbitrumGoerliDevnet/PolicyRegistry.json
7676
eventHandlers:
7777
- event: PolicyUpdate(indexed uint256,string,string)
7878
handler: handlePolicyUpdate
@@ -81,9 +81,9 @@ dataSources:
8181
name: DisputeKitClassic
8282
network: arbitrum-goerli
8383
source:
84-
address: "0x439f92b61783A752462527f9dA9C6c6180C9253a"
84+
address: "0x6394A70cADD1376FdE5C38bA331761256DDd03E2"
8585
abi: DisputeKitClassic
86-
startBlock: 34139950
86+
startBlock: 43823737
8787
mapping:
8888
kind: ethereum/events
8989
apiVersion: 0.0.6
@@ -97,9 +97,9 @@ dataSources:
9797
- ClassicContribution
9898
abis:
9999
- name: DisputeKitClassic
100-
file: ../contracts/deployments/arbitrumGoerli/DisputeKitClassic.json
100+
file: ../contracts/deployments/arbitrumGoerliDevnet/DisputeKitClassic.json
101101
- name: KlerosCore
102-
file: ../contracts/deployments/arbitrumGoerli/KlerosCore.json
102+
file: ../contracts/deployments/arbitrumGoerliDevnet/KlerosCore.json
103103
eventHandlers:
104104
- event: DisputeCreation(indexed uint256,uint256,bytes)
105105
handler: handleDisputeCreation

web/src/components/CasesDisplay/CasesGrid.tsx

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import React, { useMemo } from "react";
2-
import styled, { css } from "styled-components";
2+
import styled from "styled-components";
33
import { useWindowSize } from "react-use";
44
import { useParams } from "react-router-dom";
5-
import Skeleton from "react-loading-skeleton";
5+
import { SkeletonDisputeCard, SkeletonDisputeListItem } from "../StyledSkeleton";
66
import { StandardPagination } from "@kleros/ui-components-library";
7-
import { BREAKPOINT_LANDSCAPE, landscapeStyle } from "styles/landscapeStyle";
7+
import { BREAKPOINT_LANDSCAPE } from "styles/landscapeStyle";
88
import { useIsList } from "context/IsListProvider";
99
import { isUndefined } from "utils/index";
1010
import { decodeURIFilter } from "utils/uri";
@@ -17,17 +17,7 @@ const GridContainer = styled.div`
1717
flex-wrap: wrap;
1818
justify-content: center;
1919
align-items: center;
20-
gap: 8px;
21-
${landscapeStyle(
22-
() =>
23-
css`
24-
display: grid;
25-
row-gap: 16px;
26-
column-gap: 8px;
27-
grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
28-
justify-content: space-between;
29-
`
30-
)}
20+
gap: 24px;
3121
`;
3222

3323
const ListContainer = styled.div`
@@ -37,11 +27,6 @@ const ListContainer = styled.div`
3727
gap: 8px;
3828
`;
3929

40-
const StyledSkeleton = styled(Skeleton)`
41-
height: 260px;
42-
width: 310px;
43-
`;
44-
4530
// 24px as margin-top since we already have 8px from the flex gap
4631
const StyledPagination = styled(StandardPagination)`
4732
margin-top: 24px;
@@ -71,15 +56,15 @@ const CasesGrid: React.FC<ICasesGrid> = ({ disputes, casesPerPage, totalPages, c
7156
<ListContainer>
7257
<CasesListHeader />
7358
{isUndefined(disputes)
74-
? [...Array(casesPerPage)].map((_, i) => <StyledSkeleton key={i} />)
59+
? [...Array(casesPerPage)].map((_, i) => <SkeletonDisputeListItem key={i} />)
7560
: disputes.map((dispute) => {
7661
return <DisputeCard key={dispute.id} {...dispute} />;
7762
})}
7863
</ListContainer>
7964
) : (
8065
<GridContainer>
8166
{isUndefined(disputes)
82-
? [...Array(casesPerPage)].map((_, i) => <StyledSkeleton key={i} />)
67+
? [...Array(casesPerPage)].map((_, i) => <SkeletonDisputeCard key={i} />)
8368
: disputes.map((dispute) => {
8469
return <DisputeCard key={dispute.id} {...dispute} overrideIsList />;
8570
})}

web/src/components/DisputeCard/index.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,21 @@ import PeriodBanner from "./PeriodBanner";
1616
import { isUndefined } from "utils/index";
1717

1818
const StyledCard = styled(Card)`
19-
width: 312px;
19+
width: 100%;
2020
height: 260px;
2121
${landscapeStyle(
2222
() =>
2323
css`
24-
width: 380px;
24+
/* Explanation of this formula:
25+
- The 48px accounts for the total width of gaps: 2 gaps * 24px each.
26+
- The 0.333 is used to equally distribute width among 3 cards per row.
27+
- The 294px ensures the card has a minimum width.
28+
*/
29+
width: max(calc((100% - 48px) * 0.333), 294px);
2530
`
2631
)}
2732
`;
33+
2834
const StyledListItem = styled(Card)`
2935
display: flex;
3036
flex-grow: 1;

web/src/components/LatestCases.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import styled from "styled-components";
33
import { Dispute_Filter } from "../graphql/graphql";
44
import { DisputeDetailsFragment, useCasesQuery } from "queries/useCasesQuery";
55
import DisputeCard from "components/DisputeCard";
6-
import { StyledSkeleton } from "components/StyledSkeleton";
6+
import { SkeletonDisputeCard } from "components/StyledSkeleton";
77
import { isUndefined } from "utils/index";
88

99
const Container = styled.div`
@@ -30,7 +30,7 @@ const LatestCases: React.FC<{ filters?: Dispute_Filter }> = ({ filters }) => {
3030
<Title>Latest Cases</Title>
3131
<DisputeContainer>
3232
{isUndefined(disputes)
33-
? Array.from({ length: 3 }).map((_, index) => <StyledSkeleton key={index} width={312} height={260} />)
33+
? Array.from({ length: 3 }).map((_, index) => <SkeletonDisputeCard key={index} />)
3434
: disputes.map((dispute) => <DisputeCard key={dispute.id} {...dispute} overrideIsList />)}
3535
</DisputeContainer>
3636
</Container>

web/src/components/Popup/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const Container = styled.div`
5252
flex-direction: column;
5353
align-items: center;
5454
justify-content: center;
55-
width: calc(300px + (600 - 300) * (100vw - 375px) / (1250 - 375));
55+
width: 82vw;
5656
max-width: 600px;
5757
border-radius: 3px;
5858
border: 1px solid ${({ theme }) => theme.stroke};
@@ -66,6 +66,7 @@ const Container = styled.div`
6666
${landscapeStyle(
6767
() => css`
6868
overflow-y: hidden;
69+
width: calc(300px + (600 - 300) * (100vw - 375px) / (1250 - 375));
6970
`
7071
)}
7172
`;
Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,39 @@
1-
import styled from "styled-components";
1+
import React from "react";
2+
import styled, { css } from "styled-components";
3+
import { landscapeStyle } from "styles/landscapeStyle";
24
import Skeleton from "react-loading-skeleton";
35

46
export const StyledSkeleton = styled(Skeleton)`
57
z-index: 0;
68
`;
9+
10+
const SkeletonDisputeCardContainer = styled.div`
11+
width: 100%;
12+
${landscapeStyle(
13+
() =>
14+
css`
15+
/* Explanation of this formula:
16+
- The 48px accounts for the total width of gaps: 2 gaps * 24px each.
17+
- The 0.333 is used to equally distribute width among 3 cards per row.
18+
- The 294px ensures the card has a minimum width.
19+
*/
20+
width: max(calc((100% - 48px) * 0.333), 294px);
21+
`
22+
)}
23+
`;
24+
25+
const StyledSkeletonDisputeCard = styled(Skeleton)`
26+
height: 260px;
27+
`;
28+
29+
const StyledSkeletonDisputeListItem = styled(Skeleton)`
30+
height: 62px;
31+
`;
32+
33+
export const SkeletonDisputeCard = () => (
34+
<SkeletonDisputeCardContainer>
35+
<StyledSkeletonDisputeCard />
36+
</SkeletonDisputeCardContainer>
37+
);
38+
39+
export const SkeletonDisputeListItem = () => <StyledSkeletonDisputeListItem />;

web/src/layout/Header/navbar/DappList.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ const Header = styled.h1`
2525
const Container = styled.div`
2626
display: flex;
2727
position: absolute;
28-
max-height: 80vh;
28+
max-height: 340px;
2929
top: 5%;
3030
left: 50%;
3131
transform: translate(-50%);
3232
z-index: 1;
3333
flex-direction: column;
3434
align-items: center;
3535
36-
width: calc(300px + (480 - 300) * (100vw - 375px) / (1250 - 375));
36+
width: 82%;
3737
max-width: 480px;
3838
min-width: 300px;
3939
border-radius: 3px;
@@ -52,6 +52,8 @@ const Container = styled.div`
5252
left: 0;
5353
right: auto;
5454
transform: none;
55+
width: calc(300px + (480 - 300) * (100vw - 375px) / (1250 - 375));
56+
max-height: 80vh;
5557
`
5658
)}
5759
`;

web/src/layout/Header/navbar/Menu/Help.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ const Container = styled.div`
1616
position: absolute;
1717
max-height: 80vh;
1818
overflow-y: auto;
19-
width: auto;
19+
width: 82%;
20+
max-width: 444px;
2021
top: 5%;
2122
left: 50%;
2223
transform: translateX(-50%);

0 commit comments

Comments
 (0)