Skip to content

Commit 5127f0f

Browse files
committed
refactor: clear naming and query params
1 parent 28547bb commit 5127f0f

File tree

4 files changed

+20
-18
lines changed

4 files changed

+20
-18
lines changed

web/src/hooks/queries/useCounter.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@ import { graphqlQueryFnHelper } from "utils/graphqlQueryFnHelper";
66
const counterQuery = graphql(`
77
query Counter {
88
counter(id: "0") {
9+
id
910
cases
1011
casesRuled
12+
casesVoting
1113
casesAppealing
14+
stakedPNK
15+
redistributedPNK
16+
paidETH
17+
activeJurors
1218
}
1319
}
1420
`);

web/src/pages/Cases/index.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,28 @@ export const calculatePages = (
2626
return 0;
2727
}
2828

29-
let totalPages = 0;
29+
let totalCases = 0;
3030

3131
switch (status) {
3232
case 1:
33-
totalPages =
33+
totalCases =
3434
"counter" in data
3535
? data?.counter?.cases - data?.counter?.casesRuled
3636
: (data as CourtDetailsQuery).court?.numberDisputes - (data as CourtDetailsQuery).court?.numberClosedDisputes;
3737
break;
3838
case 2:
39-
totalPages =
39+
totalCases =
4040
"counter" in data ? data?.counter?.casesRuled : (data as CourtDetailsQuery).court?.numberClosedDisputes;
4141
break;
4242
case 3:
43-
totalPages =
43+
totalCases =
4444
"counter" in data ? data?.counter?.casesAppealing : (data as CourtDetailsQuery).court?.numberAppealingDisputes;
4545
break;
4646
default:
47-
totalPages = "counter" in data ? numberDisputes ?? 0 : (data as CourtDetailsQuery).court?.numberDisputes;
47+
totalCases = "counter" in data ? numberDisputes ?? 0 : (data as CourtDetailsQuery).court?.numberDisputes;
4848
}
4949

50-
return totalPages / casesPerPage;
50+
return totalCases / casesPerPage;
5151
};
5252

5353
const Cases: React.FC = () => {

web/src/pages/Dashboard/index.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,23 @@ const calculatePages = (status: number, data: UserQuery | undefined, casesPerPag
3535
return 0;
3636
}
3737

38-
let totalPages = 0;
38+
let totalCases = 0;
3939

4040
switch (status) {
4141
case 1:
42-
totalPages = data.user?.totalDisputes - data.user?.totalResolvedDisputes;
42+
totalCases = data.user?.totalDisputes - data.user?.totalResolvedDisputes;
4343
break;
4444
case 2:
45-
totalPages = data.user?.totalResolvedDisputes ?? 0;
45+
totalCases = data.user?.totalResolvedDisputes ?? 0;
4646
break;
4747
case 3:
48-
totalPages = myAppeals ?? 0;
48+
totalCases = myAppeals ?? 0;
4949
break;
5050
default:
51-
totalPages = data.user?.totalDisputes ?? 0;
51+
totalCases = data.user?.totalDisputes ?? 0;
5252
}
5353

54-
return totalPages / casesPerPage;
54+
return totalCases / casesPerPage;
5555
};
5656

5757
const Dashboard: React.FC = () => {

web/src/styles/global-style.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ export const GlobalStyle = createGlobalStyle`
1010
1111
.react-loading-skeleton {
1212
z-index: 0;
13-
--base-color: ${({ theme }) => theme.lightGrey};
14-
--highlight-color: ${({ theme }) => theme.stroke};
13+
--base-color: ${({ theme }) => theme.skeletonBackground};
14+
--highlight-color: ${({ theme }) => theme.skeletonHighlight};
1515
}
1616
1717
body {
@@ -105,8 +105,4 @@ export const GlobalStyle = createGlobalStyle`
105105
}
106106
}
107107
108-
.react-loading-skeleton {
109-
--base-color: ${({ theme }) => theme.skeletonBackground};
110-
--highlight-color: ${({ theme }) => theme.skeletonHighlight};
111-
}
112108
`;

0 commit comments

Comments
 (0)