File tree Expand file tree Collapse file tree 4 files changed +21
-29
lines changed
src/components/ActivityStats Expand file tree Collapse file tree 4 files changed +21
-29
lines changed Original file line number Diff line number Diff line change @@ -104,16 +104,13 @@ const Page = async ({ params }: { params: { locale: Lang } }) => {
104
104
const ethPrice = await fetchEthPrice ( )
105
105
const totalEthStaked = await fetchTotalEthStaked ( )
106
106
107
- const metrics = await parseActivity (
108
- {
109
- txCount,
110
- stablecoinMarketCap,
111
- ethPrice,
112
- totalEthStaked,
113
- // totalCapitalSecured,
114
- } ,
115
- locale
116
- )
107
+ const metrics = await parseActivity ( {
108
+ txCount,
109
+ stablecoinMarketCap,
110
+ ethPrice,
111
+ totalEthStaked,
112
+ // totalCapitalSecured,
113
+ } )
117
114
118
115
const features : Feature [ ] = [
119
116
{
@@ -304,7 +301,6 @@ const Page = async ({ params }: { params: { locale: Lang } }) => {
304
301
305
302
< ActivityStats
306
303
metrics = { metrics }
307
- locale = { locale }
308
304
className = { cn (
309
305
metrics . length < 2 && "hidden" , // Minimum before displaying
310
306
"w-fit max-w-xl shrink-0 gap-8 sm:max-md:grid-cols-2" ,
Original file line number Diff line number Diff line change 1
- import { getTranslations } from "next-intl/server"
1
+ import { getLocale , getTranslations } from "next-intl/server"
2
2
3
3
import type {
4
4
AllEnterpriseActivityData ,
@@ -10,16 +10,14 @@ import { formatLargeNumber, formatLargeUSD } from "@/lib/utils/numbers"
10
10
import { getLocaleForNumberFormat } from "@/lib/utils/translations"
11
11
12
12
// Convert numerical value to formatted values
13
- export const parseActivity = async (
14
- {
15
- txCount,
16
- stablecoinMarketCap,
17
- ethPrice,
18
- totalEthStaked,
19
- // totalCapitalSecured,
20
- } : AllEnterpriseActivityData ,
21
- locale : Lang
22
- ) : Promise < StatsBoxMetric [ ] > => {
13
+ export const parseActivity = async ( {
14
+ txCount,
15
+ stablecoinMarketCap,
16
+ ethPrice,
17
+ totalEthStaked,
18
+ // totalCapitalSecured,
19
+ } : AllEnterpriseActivityData ) : Promise < StatsBoxMetric [ ] > => {
20
+ const locale = ( await getLocale ( ) ) as Lang
23
21
const t = await getTranslations ( "page-enterprise" )
24
22
25
23
const localeForNumberFormat = getLocaleForNumberFormat ( locale )
Original file line number Diff line number Diff line change @@ -541,7 +541,7 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => {
541
541
< p className = "mt-8 text-xl font-bold" >
542
542
{ t ( "page-index-activity-description" ) }
543
543
</ p >
544
- < ActivityStats metrics = { metrics } locale = { locale } />
544
+ < ActivityStats metrics = { metrics } />
545
545
546
546
< div className = "mt-12 flex justify-center" >
547
547
< ButtonLink
Original file line number Diff line number Diff line change
1
+ import { getLocale } from "next-intl/server"
2
+
1
3
import type { StatsBoxMetric } from "@/lib/types"
2
4
3
5
import { cn } from "@/lib/utils/cn"
@@ -6,14 +8,10 @@ import BigNumber from "../BigNumber"
6
8
7
9
type ActivityStatsProps = {
8
10
metrics : StatsBoxMetric [ ]
9
- locale : string
10
11
className ?: string
11
12
}
12
- const ActivityStats = async ( {
13
- metrics,
14
- locale,
15
- className,
16
- } : ActivityStatsProps ) => {
13
+ const ActivityStats = async ( { metrics, className } : ActivityStatsProps ) => {
14
+ const locale = await getLocale ( )
17
15
const gridBorderClasses = [
18
16
"border-b border-body-light xl:border-e xl:pe-8" ,
19
17
"border-b border-body-light xl:ps-8" ,
You can’t perform that action at this time.
0 commit comments