Skip to content

Commit

Permalink
Fundmentals - added rent_paid and earnings/profit
Browse files Browse the repository at this point in the history
  • Loading branch information
manishiwa committed Sep 7, 2023
1 parent 0d1ee18 commit ccc91a5
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 39 deletions.
62 changes: 23 additions & 39 deletions components/layout/ComparisonChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,26 @@ export default function ComparisonChart({

const isMobile = useMediaQuery("(max-width: 767px)");

const SourcesDisplay = useMemo(() => {
return sources && sources.length > 0 ? (
sources
.map<ReactNode>((s) => (
<Link
key={s}
rel="noopener noreferrer"
target="_blank"
href={Sources[s] ?? ""}
className="hover:text-forest-500 dark:hover:text-forest-500 underline"
>
{s}
</Link>
))
.reduce((prev, curr) => [prev, ", ", curr])
) : (
<>Unavailable</>
);
}, [sources]);

const getTickPositions = useCallback(
(xMin: any, xMax: any): number[] => {
const tickPositions: number[] = [];
Expand Down Expand Up @@ -1310,19 +1330,7 @@ export default function ComparisonChart({
Data Sources:
</div>
<div className="flex space-x-1 flex-wrap font-medium text-xs leading-snug">
{sources
.map<ReactNode>((s) => (
<Link
key={s}
rel="noopener noreferrer"
target="_blank"
href={Sources[s] ?? ""}
className="hover:text-forest-500 dark:hover:text-forest-500 underline"
>
{s}
</Link>
))
.reduce((prev, curr) => [prev, ", ", curr])}
{SourcesDisplay}
</div>
</div>
</div>
Expand Down Expand Up @@ -1393,19 +1401,7 @@ export default function ComparisonChart({
Data Sources:
</div>
<div className="flex space-x-1 flex-wrap font-medium text-xs leading-snug">
{sources
.map<ReactNode>((s) => (
<Link
key={s}
rel="noopener noreferrer"
target="_blank"
href={Sources[s] ?? ""}
className="hover:text-forest-500 dark:hover:text-forest-500 underline"
>
{s}
</Link>
))
.reduce((prev, curr) => [prev, ", ", curr])}
{SourcesDisplay}
</div>
</div>
</div>
Expand Down Expand Up @@ -1479,19 +1475,7 @@ export default function ComparisonChart({
Data Sources:
</div>
<div className="flex space-x-1 flex-wrap font-medium text-xs leading-snug">
{sources
.map<ReactNode>((s) => (
<Link
key={s}
rel="noopener noreferrer"
target="_blank"
href={Sources[s] ?? ""}
className="hover:text-forest-500 dark:hover:text-forest-500 underline"
>
{s}
</Link>
))
.reduce((prev, curr) => [prev, ", ", curr])}
{SourcesDisplay}
</div>
</div>
</div>
Expand Down
26 changes: 26 additions & 0 deletions lib/navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,32 @@ export const navigationItems: NavigationItem[] = [
rootKey: "metricsFeesPaidToEthereum",
urlKey: "fees-paid-by-users",
},
{
label: "Rent Paid",
page: {
title: "Rent Paid",
description: "The sum of rent that was paid ...",
why: "Rent paid is a critical metric for ...",
icon: "feather:credit-card",
},
icon: "feather:credit-card",
key: "rent_paid",
rootKey: "metricsRentPaid",
urlKey: "rent-paid",
},
{
label: "Earnings",
page: {
title: "Earnings",
description: "The sum of earnings that were paid ...",
why: "Earnings is a critical metric for ...",
icon: "feather:credit-card",
},
icon: "feather:credit-card",
key: "profit",
rootKey: "metricsEarnings",
urlKey: "earnings",
},
{
label: "Stablecoin Market Cap",
page: {
Expand Down
2 changes: 2 additions & 0 deletions lib/urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export const MetricsURLs = {
"total-value-locked": "https://api.growthepie.xyz/v1/metrics/tvl.json",
"transaction-count": "https://api.growthepie.xyz/v1/metrics/txcount.json",
"transaction-costs": "https://api.growthepie.xyz/v1/metrics/txcosts.json",
"rent-paid": "https://api.growthepie.xyz/v1/metrics/rent_paid.json",
earnings: "https://api.growthepie.xyz/v1/metrics/profit.json",
};

export const ChainURLs = {
Expand Down

0 comments on commit ccc91a5

Please sign in to comment.