Skip to content

Commit 9fa0ebb

Browse files
authored
Merge pull request #114 from api3dao/113-remove-unused-metrics
Disable unused metrics
2 parents 2e4e4f2 + 1c6246d commit 9fa0ebb

28 files changed

+411
-307
lines changed

components/Footer.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ export const Footer = (props: IFooterProps) => {
2727
) : null}
2828
{terms ? (
2929
<span className="text-center block leading-6 md:inline md:text-left">
30-
<a className="xs:py-4 sm:py-0 xs:text-xl sm:text-sm" target="_blank" rel="noreferrer noopener" href={terms}>
30+
<a
31+
className="xs:py-4 sm:py-0 xs:text-xl sm:text-sm"
32+
target="_blank"
33+
rel="noreferrer noopener"
34+
href={terms}
35+
>
3136
Terms
3237
</a>
3338
</span>
@@ -37,7 +42,12 @@ export const Footer = (props: IFooterProps) => {
3742
) : null}
3843
{github ? (
3944
<span className="text-center block leading-6 md:inline md:text-left">
40-
<a className="xs:py-4 sm:py-0 xs:text-xl sm:text-sm" target="_blank" rel="noreferrer noopener" href={github}>
45+
<a
46+
className="xs:py-4 sm:py-0 xs:text-xl sm:text-sm"
47+
target="_blank"
48+
rel="noreferrer noopener"
49+
href={github}
50+
>
4151
Github Source
4252
</a>
4353
</span>

components/Header.tsx

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Image from 'next/image';
1+
import Image from "next/image";
22
import Link from "next/link";
33
import React from "react";
44

@@ -61,7 +61,10 @@ export const Header = (props: IHeader) => {
6161
<header className="fixed bg-color-body w-full z-10 top-0 left-0 lg:pb-1 border-b border-1px border-solid">
6262
<div className="hidden lg:flex items-center mx-auto max-w-screen-lg">
6363
<div className="flex flex-col py-2">
64-
<Link href='/' className="text-color-menu-active text-5xl py-2 text-center font-bold">
64+
<Link
65+
href="/"
66+
className="text-color-menu-active text-5xl py-2 text-center font-bold"
67+
>
6568
API3 DAO Tracker
6669
</Link>
6770
<span className="text-color-accent text-sm text-left">
@@ -74,10 +77,19 @@ export const Header = (props: IHeader) => {
7477
<div className="lg:hidden flex p-3">
7578
<div className="flex-1">
7679
<Link href="/" onClick={hide} className="block w-8 h-8">
77-
<Image src="/API3x32-white-iso.png" width={32} height={32} alt="API3 DAO Tracker" />
80+
<Image
81+
src="/API3x32-white-iso.png"
82+
width={32}
83+
height={32}
84+
alt="API3 DAO Tracker"
85+
/>
7886
</Link>
7987
</div>
80-
<button name="toggle-mobile-menu" aria-label="Toggle Mobile Menu" onClick={toggle}>
88+
<button
89+
name="toggle-mobile-menu"
90+
aria-label="Toggle Mobile Menu"
91+
onClick={toggle}
92+
>
8193
{state.mobileOpen ? iconClose : iconMenu}
8294
</button>
8395
</div>

components/MemberClassification.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export const MemberClassification = (props: IBadgerProps) => {
6868
<span className={classBadge + b.className}>{b.name}</span> -{" "}
6969
<span className="text-xs">{b.title}</span>
7070
</li>
71-
) : null
71+
) : null,
7272
)}
7373
</ul>
7474
</div>
@@ -81,8 +81,14 @@ export const MemberBadges = (props: IBadgerProps) => {
8181
<div className="leading-2 text-xs">
8282
{badges.map((b: any) =>
8383
props.badges.includes(b.name) ? (
84-
<span title={b.title} key={b.name} className={classBadge + b.className}>{b.name}</span>
85-
) : null
84+
<span
85+
title={b.title}
86+
key={b.name}
87+
className={classBadge + b.className}
88+
>
89+
{b.name}
90+
</span>
91+
) : null,
8692
)}
8793
</div>
8894
);

components/Meta.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ export interface IMetaProps {
99
values?: Map<string, string>;
1010
}
1111

12-
const withValues = (txt: string, values: Map<string, string>|undefined) => {
12+
const withValues = (txt: string, values: Map<string, string> | undefined) => {
1313
if (!values) return txt;
1414
let out = txt;
1515
for (const [_, [k, v]] of values.entries()) {
16-
out = out.replaceAll('['+ k + ']', v);
16+
out = out.replaceAll("[" + k + "]", v);
1717
}
1818
return out;
1919
};
@@ -26,15 +26,15 @@ export const Meta = (props: IMetaProps) => {
2626
const title = withValues(pg.title || opengraph.title, props.values);
2727
const description = withValues(
2828
pg.description || opengraph.description,
29-
props.values
29+
props.values,
3030
);
3131
const ogTitle = withValues(
3232
pg.ogTitle || opengraph.ogTitle || title,
33-
props.values
33+
props.values,
3434
);
3535
const ogDescription = withValues(
3636
pg.ogDescription || opengraph.ogDescription || description,
37-
props.values
37+
props.values,
3838
);
3939

4040
const siteName = pg.siteName || opengraph.siteName;

components/Overview.tsx

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,31 +26,36 @@ export const Epoch = (props: IEpoch) => {
2626
{props.isCurrent ? props.epoch + 1 : props.epoch}
2727
</div>
2828
<div className="text-3xl uppercase m-0">
29-
APR: <strong className="font-bold">{toPct(props.isCurrent ? props.newApr : props.apr)}</strong>
29+
APR:{" "}
30+
<strong className="font-bold">
31+
{toPct(props.isCurrent ? props.newApr : props.apr)}
32+
</strong>
3033
</div>
3134
<div className="mb-3">
3235
<span className={darkenTitle}>Epoch Rewards: </span>
33-
<strong className="accent">{toPct(props.isCurrent ? props.newRewardsPct : props.rewardsPct)}</strong>
36+
<strong className="accent">
37+
{toPct(props.isCurrent ? props.newRewardsPct : props.rewardsPct)}
38+
</strong>
3439
</div>
35-
{props.isCurrent ? (
36-
<div className="mb-10">&nbsp;</div>
37-
) : (
38-
<div className="my-0">
40+
{props.isCurrent ? (
41+
<div className="mb-10">&nbsp;</div>
42+
) : (
43+
<div className="my-0">
3944
<span className={darkenTitle}>Staked at the end of epoch: </span>
4045
<strong>{noDecimals(toCurrency(props.totalStake))}</strong>
41-
</div>
42-
)}
46+
</div>
47+
)}
4348
<div className="pt-8">
44-
{props.isCurrent ? (
45-
null
46-
) : (
49+
{props.isCurrent ? null : (
4750
<div className={classTitle}>
4851
<strong> {noDecimals(toCurrency(props.mintedShares))}</strong>
4952
<span className={darkenTitle}> API3 tokens minted </span>
5053
</div>
5154
)}
5255
<div className="mb-4">
53-
<div className={darkenTitle}>{niceDateTime(epochDt.toISOString())}</div>
56+
<div className={darkenTitle}>
57+
{niceDateTime(epochDt.toISOString())}
58+
</div>
5459
</div>
5560
</div>
5661
</div>

components/Rewards.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { StakingTrend } from "../components/StakingTrend";
77
import { noDecimals, niceDate, toCurrency, toPct } from "./../services/format";
88
import { type IEpoch, type ISupply } from "./../services/types";
99

10-
1110
export interface IRewardsSummaryProps {
1211
supply: ISupply;
1312
latest: IEpoch;
@@ -59,7 +58,9 @@ export const RewardsListSmScreen = (epoch: IEpoch) => (
5958
{toCurrency(epoch.blockNumber)}
6059
</a>
6160
</div>
62-
<div className="mb-3 text-center text-xs darken">{niceDate(epoch.createdAt)}</div>
61+
<div className="mb-3 text-center text-xs darken">
62+
{niceDate(epoch.createdAt)}
63+
</div>
6364
<div className="mb-2 text-center darken">
6465
APR:{" "}
6566
<span className="text-bold text-2xl text-color-panel-title">
@@ -92,9 +93,7 @@ export const RewardsListSmScreen = (epoch: IEpoch) => (
9293
</div>
9394
<div className="text-center text-xs darken my-5">
9495
Release Date:{" "}
95-
<span className="text-bold darken">
96-
{niceDate(epoch.releaseDate)}
97-
</span>
96+
<span className="text-bold darken">{niceDate(epoch.releaseDate)}</span>
9897
</div>
9998
</BorderedPanel>
10099
</div>

components/StakingTrend.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,18 @@ export const StakingTrend = (props: IStakingTrendProps) => {
2222
}
2323

2424
let note = "";
25-
note = stakedLessThanTarget ? "DAO staking target is not reached" : "DAO staking target is reached";
25+
note = stakedLessThanTarget
26+
? "DAO staking target is not reached"
27+
: "DAO staking target is reached";
2628
if (isMin) {
2729
note += ", and APR is at its minimum of 2.5%";
2830
} else if (isMax) {
2931
note += ", and APR is at its maximum of 75%";
3032
} else {
3133
note += ", so APR will ";
32-
note += stakedLessThanTarget ? "increase by 1% for the next epochs until the target is met or APR reaches 75%" : "decrease by 1% for the next epochs until APR reaches 2.5%";
34+
note += stakedLessThanTarget
35+
? "increase by 1% for the next epochs until the target is met or APR reaches 75%"
36+
: "decrease by 1% for the next epochs until APR reaches 2.5%";
3337
}
3438

3539
const debugMsg = `apr=${props.apr} staked=${props.totalStaked} target=${props.stakingTarget}`;

components/VotingEvents.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const EventDetails = (props: IEventDetails) => {
5050
if (props.eventName === "CastVote") {
5151
const supports = props.data[2];
5252
const votes = noDecimals(
53-
withDecimals(ethers.BigNumber.from(props.data[3]).toString(), 18)
53+
withDecimals(ethers.BigNumber.from(props.data[3]).toString(), 18),
5454
);
5555
return (
5656
<div className="text-xs darken mt-1 leading-4">
@@ -87,15 +87,15 @@ const votePower = (row: IVotingEvent) => {
8787
supports = supported ? "Supports" : "Against";
8888
votes = noDecimals(
8989
toCurrency(
90-
withDecimals(ethers.BigNumber.from(row.data[3]).toString(), 18)
91-
)
90+
withDecimals(ethers.BigNumber.from(row.data[3]).toString(), 18),
91+
),
9292
);
9393
if (row.totalStake) {
9494
const total = Number.parseInt(noDecimals(row.totalStake.toString()));
9595
const abs = Number.parseFloat(
9696
noDecimals(
97-
withDecimals(ethers.BigNumber.from(row.data[3]).toString(), 18)
98-
)
97+
withDecimals(ethers.BigNumber.from(row.data[3]).toString(), 18),
98+
),
9999
);
100100
const pct = ((abs * 100) / total).toFixed(2) + "%";
101101
return [supports, votes, pct];
@@ -214,7 +214,7 @@ export const VotingEventsList = (props: IVotingEventsListProps) => {
214214
<ol className="border-t border-color-grey">
215215
{props.list.map((row, index) => {
216216
const member = props.members.find(
217-
(x: any) => toHex(row.address) === toHex(x.address)
217+
(x: any) => toHex(row.address) === toHex(x.address),
218218
);
219219
return (
220220
<VotingEventsListRow
@@ -235,7 +235,7 @@ export const VotingEventsList = (props: IVotingEventsListProps) => {
235235
<tbody>
236236
{props.list.map((row, index) => {
237237
const member = props.members.find(
238-
(x: any) => toHex(row.address) === toHex(x.address)
238+
(x: any) => toHex(row.address) === toHex(x.address),
239239
);
240240
return (
241241
<VotingEventsListTr

components/VotingsList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ export const VotingsListRow = (props: IVotingItem) => {
187187
Against:{" "}
188188
{item.totalStaked.toNumber() > 0
189189
? toPct(
190-
item.totalAgainst.mul(100).div(item.totalStaked).toFixed(2)
190+
item.totalAgainst.mul(100).div(item.totalStaked).toFixed(2),
191191
)
192192
: null}
193193
</div>

components/WalletDelegation.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const WalletDelegationThead = () => (
2626

2727
export const WalletDelegationTr = (props: any) => {
2828
const { index } = props;
29-
const {row} = props;
29+
const { row } = props;
3030
return (
3131
<tr>
3232
<td className="text-center">{(index || 0) + 1}.</td>
@@ -44,7 +44,7 @@ export const WalletDelegationTr = (props: any) => {
4444

4545
export const WalletDelegationRow = (props: any) => {
4646
const { index } = props;
47-
const {row} = props;
47+
const { row } = props;
4848
return (
4949
<li className="border-b border-color-grey py-2">
5050
<div className="flex mr-5 ml-5">
@@ -81,8 +81,7 @@ export const WalletDelegation = (props: IWalletDelegationProps) => {
8181
{to.length > 0 ? (
8282
<div className="text-color-panel-title">
8383
<h2 className="text-sm lg:text-xl font-bold text-center">
84-
This member is delegated to{" "}
85-
{" by "}
84+
This member is delegated to {" by "}
8685
{toNZ.length} members
8786
</h2>
8887
<div className="block sm:hidden">

0 commit comments

Comments
 (0)