Skip to content

Commit 5204be7

Browse files
committed
feat: add additional metrics, polish copy
1 parent 1f1352d commit 5204be7

File tree

4 files changed

+72
-41
lines changed

4 files changed

+72
-41
lines changed

app/[locale]/enterprise/page.tsx

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import dynamic from "next/dynamic"
22
import { getTranslations } from "next-intl/server"
33

4-
import type { Lang } from "@/lib/types"
4+
import type { Lang, StatsBoxMetric } from "@/lib/types"
55

66
import ActivityStats from "@/components/ActivityStats"
77
import { HubHero } from "@/components/Hero"
@@ -99,19 +99,34 @@ const Page = async ({ params }: { params: { locale: Lang } }) => {
9999

100100
// const [{ txCount }, stablecoinMarketCap, ethPrice, totalEthStaked] =
101101
// await loadData()
102-
const { txCount } = await fetchGrowThePie()
102+
const { txCount, txCostsMedianUsd } = await fetchGrowThePie()
103103
const stablecoinMarketCap = await fetchEthereumStablecoinsMcap()
104104
const ethPrice = await fetchEthPrice()
105105
const totalEthStaked = await fetchTotalEthStaked()
106106

107107
const metrics = await parseActivity({
108108
txCount,
109+
txCostsMedianUsd,
109110
stablecoinMarketCap,
110111
ethPrice,
111112
totalEthStaked,
112-
// totalCapitalSecured,
113113
})
114114

115+
const signals: StatsBoxMetric[] = [
116+
{
117+
label: "Years",
118+
state: { value: "10" }, // TODO: Calculate to future-proof, avoid hard-coding
119+
},
120+
{
121+
label: "Upgrades",
122+
state: { value: "15" }, // TODO: Calculate from upgrades list
123+
},
124+
{
125+
label: "Downtime",
126+
state: { value: "0" },
127+
},
128+
]
129+
115130
const features: Feature[] = [
116131
{
117132
header: t("page-enterprise-features-1-header"),
@@ -287,7 +302,7 @@ const Page = async ({ params }: { params: { locale: Lang } }) => {
287302
<MainArticle className="space-y-12 px-4 md:space-y-20 md:px-10">
288303
<section
289304
id="activity"
290-
className="flex flex-col justify-between gap-6 md:flex-row"
305+
className="flex flex-col justify-between gap-6 xl:flex-row"
291306
>
292307
<div className="max-w-prose space-y-4">
293308
<h2>{t("page-enterprise-metrics-header")}</h2>
@@ -302,12 +317,12 @@ const Page = async ({ params }: { params: { locale: Lang } }) => {
302317
<ActivityStats
303318
metrics={metrics}
304319
className={cn(
305-
metrics.length < 2 && "hidden", // Minimum before displaying
306-
"w-fit max-w-xl shrink-0 gap-8 sm:max-md:grid-cols-2",
320+
"w-fit max-w-xl shrink-0 grid-cols-1 gap-8 sm:grid-cols-2 lg:grid-cols-[auto,auto,auto,auto] xl:grid-cols-2",
307321
"[&_[data-label='big-number']]:border-none [&_[data-label='big-number']]:p-0",
308322
"[&_[data-label='big-number']:nth-of-type(1)_[data-label='value']]:text-accent-a",
309323
"[&_[data-label='big-number']:nth-of-type(2)_[data-label='value']]:text-accent-b",
310-
"[&_[data-label='big-number']:nth-of-type(3)_[data-label='value']]:text-accent-c"
324+
"[&_[data-label='big-number']:nth-of-type(3)_[data-label='value']]:text-accent-c",
325+
"[&_[data-label='big-number']:nth-of-type(4)_[data-label='value']]:text-primary"
311326
)}
312327
/>
313328
</section>
@@ -332,7 +347,7 @@ const Page = async ({ params }: { params: { locale: Lang } }) => {
332347

333348
<section
334349
id="ecosystem"
335-
className="rounded-t-4xp flex w-full flex-col items-center gap-y-12 bg-radial-b px-4 py-10 md:rounded-t-[4rem] md:py-12"
350+
className="flex w-full flex-col items-center gap-y-12 rounded-t-4xl bg-radial-b px-4 py-10 md:rounded-t-[4rem] md:py-12"
336351
>
337352
<div className="max-w-prose space-y-4">
338353
<h2 className="max-w-prose text-center text-4xl font-black md:text-5xl">
@@ -427,6 +442,20 @@ const Page = async ({ params }: { params: { locale: Lang } }) => {
427442
{t("page-enterprise-why-description")}
428443
</p>
429444
</div>
445+
446+
<ActivityStats
447+
data-label="signalling-metrics"
448+
metrics={signals}
449+
className={cn(
450+
"max-sm:gap-8 max-sm:px-4",
451+
"flex w-fit max-w-xl shrink-0 flex-wrap gap-12 text-center",
452+
"[&_[data-label='big-number']]:border-none [&_[data-label='big-number']]:p-0",
453+
"[&_[data-label='big-number']:nth-of-type(1)_[data-label='value']]:text-accent-a",
454+
"[&_[data-label='big-number']:nth-of-type(2)_[data-label='value']]:text-accent-b",
455+
"[&_[data-label='big-number']:nth-of-type(3)_[data-label='value']]:text-accent-c"
456+
)}
457+
/>
458+
430459
<div className="grid w-full grid-cols-1 gap-6 rounded-4xl border bg-background p-6 md:grid-cols-2 md:gap-8 md:p-8">
431460
{reasons.map(({ header, content }) => (
432461
<div

app/[locale]/enterprise/utils.ts

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,23 @@ import type {
66
StatsBoxMetric,
77
} from "@/lib/types"
88

9-
import { formatLargeNumber, formatLargeUSD } from "@/lib/utils/numbers"
9+
import {
10+
formatLargeNumber,
11+
formatLargeUSD,
12+
formatSmallUSD,
13+
} from "@/lib/utils/numbers"
1014
import { getLocaleForNumberFormat } from "@/lib/utils/translations"
1115

1216
// Convert numerical value to formatted values
1317
export const parseActivity = async ({
1418
txCount,
19+
txCostsMedianUsd,
1520
stablecoinMarketCap,
1621
ethPrice,
1722
totalEthStaked,
18-
// totalCapitalSecured,
1923
}: AllEnterpriseActivityData): Promise<StatsBoxMetric[]> => {
2024
const locale = (await getLocale()) as Lang
21-
const t = await getTranslations("page-enterprise")
25+
const t = await getTranslations({ locale, namespace: "page-enterprise" })
2226

2327
const localeForNumberFormat = getLocaleForNumberFormat(locale)
2428

@@ -30,6 +34,14 @@ export const parseActivity = async ({
3034
value: formatLargeNumber(txCount.value, localeForNumberFormat),
3135
}
3236

37+
const medianTxCost =
38+
"error" in txCostsMedianUsd
39+
? { error: txCostsMedianUsd.error }
40+
: {
41+
...txCostsMedianUsd,
42+
value: formatSmallUSD(txCostsMedianUsd.value, localeForNumberFormat),
43+
}
44+
3345
const stablecoinMarketCapFormatted =
3446
"error" in stablecoinMarketCap
3547
? { error: stablecoinMarketCap.error }
@@ -61,17 +73,6 @@ export const parseActivity = async ({
6173
value: formatLargeUSD(totalStakedInUsd, localeForNumberFormat),
6274
}
6375

64-
// const totalCapitalSecuredFormatted =
65-
// "error" in totalCapitalSecured
66-
// ? { error: totalCapitalSecured.error }
67-
// : {
68-
// ...totalCapitalSecured,
69-
// value: formatLargeUSD(
70-
// totalCapitalSecured.value,
71-
// localeForNumberFormat
72-
// ),
73-
// }
74-
7576
const metrics: StatsBoxMetric[] = [
7677
{
7778
label: t("page-enterprise-activity-tx-count"),
@@ -81,8 +82,8 @@ export const parseActivity = async ({
8182
},
8283
{
8384
label: t("page-enterprise-activity-stablecoin-mktcap"),
84-
apiProvider: "CoinGecko",
85-
apiUrl: "https://www.coingecko.com/en/categories/stablecoins",
85+
apiProvider: "DefiLlama",
86+
apiUrl: "https://defillama.com/chain/ethereum",
8687
state: stablecoinMarketCapFormatted,
8788
},
8889
{
@@ -91,13 +92,13 @@ export const parseActivity = async ({
9192
apiUrl: "https://dune.com/hildobby/eth2-staking",
9293
state: totalValueSecuringFormatted,
9394
},
94-
// {
95-
// // TODO
96-
// label: t("page-enterprise-activity-total-secured"),
97-
// apiProvider: "TBD",
98-
// apiUrl: "https://www.TBD.com",
99-
// state: totalCapitalSecuredFormatted,
100-
// },
95+
96+
{
97+
label: t("page-enterprise-activity-media-tx-cost"),
98+
apiProvider: "growthepie",
99+
apiUrl: "https://www.growthepie.xyz/fundamentals/transaction-costs",
100+
state: medianTxCost,
101+
},
101102
]
102103

103104
return metrics

src/intl/en/page-enterprise.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
{
2+
"page-enterprise-activity-media-tx-cost": "Median transaction cost",
3+
"page-enterprise-activity-stablecoin-mktcap": "Stablecoin market cap",
4+
"page-enterprise-activity-total-secured": "Total capital secured",
5+
"page-enterprise-activity-tx-count": "Daily transactions",
6+
"page-enterprise-activity-value-protecting": "Value protecting Ethereum",
7+
"page-enterprise-cases-blackrock-content": "Launched <strong>$2.9B+ tokenized</strong> U.S. Treasury fund on Ethereum and its ecosystem, delivering same-day liquidity to institutions.",
8+
"page-enterprise-cases-eib-content": "<strong>Issued a €100M digital bond</strong> on public Ethereum. The project was conducted in cooperation with the Banque de France, Goldman Sachs, Santander and Société Générale.",
29
"page-enterprise-cases-mediledger-content": "Enables Pfizer and Genentech to verify drug authenticity and ensure pharma compliance.",
310
"page-enterprise-cases-tmobile-content": "Uses Ethereum to streamline roaming and device trust—shared ledgers simplify authentication and billing.",
411
"page-enterprise-cases-unwfp-content": "UN <strong>tracks aid for 100,000+ refugees</strong> using a private Ethereum fork, boosting audit capabilities.",
512
"page-enterprise-cases-visa-content": "Settled over <strong>$225 million</strong> in stablecoin transactions using USDC across Ethereum and other blockchains.",
6-
"page-enterprise-cases-blackrock-content": "Launched <strong>$2.9B+ tokenized</strong> U.S. Treasury fund on Ethereum and its ecosystem, delivering same-day liquidity to institutions.",
7-
"page-enterprise-cases-eib-content": "<strong>Issued a €100M digital bond</strong> on public Ethereum. The project was conducted in cooperation with the Banque de France, Goldman Sachs, Santander and Société Générale.",
8-
"page-enterprise-activity-tx-count": "Daily transactions",
9-
"page-enterprise-activity-stablecoin-mktcap": "Stablecoin market cap",
10-
"page-enterprise-activity-value-protecting": "Value protecting Ethereum",
11-
"page-enterprise-activity-total-secured": "Total capital secured",
1213
"page-enterprise-ecosystem-cta": "See use cases",
1314
"page-enterprise-ecosystem-description": "Programmable financial systems are here. Join the hundreds of enterprises already building on Ethereum today.",
1415
"page-enterprise-ecosystem-header": "Embrace the innovation",
1516
"page-enterprise-features-1-content-1": "Ethereum is secured by thousands of independent validators worldwide, providing resilient, open-access infrastructure for digital assets and enterprise applications.",
1617
"page-enterprise-features-1-header": "Proven security and resilience",
1718
"page-enterprise-features-2-content-1": "Ethereum offers great flexibility and powerful scaling options known as Layer 2s.",
18-
"page-enterprise-features-2-content-2": "Its proof-of-stake consensus also cuts energy use by ~99.5%, meeting ESG goals without sacrificing performance.",
19+
"page-enterprise-features-2-content-2": "Enterprises can fully customize their Ethereum environment, enabling full compliance, a branded ecosystem and throughput levels as-needed.",
1920
"page-enterprise-features-2-header": "Scalable and customizable by design",
2021
"page-enterprise-features-3-content-1": "Ethereum is home to the largest blockchain developer community.",
2122
"page-enterprise-features-3-content-2": "Thousands of developers contribute monthly, offering an abundance of libraries, frameworks, and integrations. Build fast with mature tools like Solidity, Hardhat, Truffle, Infura, and Alchemy.",

src/lib/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -576,10 +576,10 @@ export type AllHomepageActivityData = Record<
576576

577577
export type EnterpriseActivityMetric =
578578
| "txCount"
579+
| "txCostsMedianUsd"
579580
| "stablecoinMarketCap"
580581
| "ethPrice" // Use with `totalEthStaked` to convert ETH to USD
581582
| "totalEthStaked"
582-
// | "totalCapitalSecured"
583583

584584
export type AllEnterpriseActivityData = Record<
585585
EnterpriseActivityMetric,
@@ -590,8 +590,8 @@ export type StatsBoxMetric = {
590590
label: string
591591
description?: string
592592
state: StatsBoxState
593-
apiUrl: string
594-
apiProvider: string
593+
apiUrl?: string
594+
apiProvider?: string
595595
}
596596

597597
export type SimulatorNavProps = {

0 commit comments

Comments
 (0)