Skip to content

Commit 8da4adc

Browse files
authored
Merge pull request #1261 from dacadeorg/ft/update-metrics
fix: update the metric numbers
2 parents f582f32 + 1ebed6e commit 8da4adc

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

src/components/sections/homepage/_partials/testimonials/CommunityStats.tsx

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Button from "@/components/ui/button";
22
import DiscordIcon from "@/icons/discord.svg";
33
import { useTranslation } from "next-i18next";
4+
import { useMemo } from "react";
45

56
/**
67
* Statistic interface definitions
@@ -18,27 +19,37 @@ const stats: Statistic[] = [
1819
{
1920
title: "testimonials.community.stats.card-1.title",
2021
description: "testimonials.community.stats.card-1.description",
21-
count: 16838,
22+
count: 22240,
2223
},
2324
{
2425
title: "testimonials.community.stats.card-2.title",
2526
description: "testimonials.community.stats.card-2.description",
26-
count: 2669,
27+
count: 3595,
2728
},
2829
{
2930
title: "testimonials.community.stats.card-3.title",
3031
description: "testimonials.community.stats.card-3.description",
31-
count: 6527,
32+
count: 8131,
3233
},
3334
];
3435
export default function CommunityStats() {
3536
const { t } = useTranslation();
37+
const digitFormatter = useMemo(() => new Intl.NumberFormat(), []);
38+
39+
const formattedStat = useMemo(
40+
() =>
41+
stats.map((stat: Statistic) => ({
42+
...stat,
43+
count: digitFormatter.format(stat.count),
44+
})),
45+
[digitFormatter]
46+
);
3647

3748
return (
3849
<div className="p-7 bg-primary rounded-3.5xl mx-auto text-white relative md:absolute md:top-28 lg:top-32 xl:w-1/3 md:w-4/6 z-10 sm:max-w-sm">
3950
<h3 className="m-0 text-4.5xl w-3/4">{t("testimonials.community.title")}</h3>
4051
<div className="relative divide-y divide-white divide-dotted">
41-
{stats.map((stat) => (
52+
{formattedStat.map((stat) => (
4253
<div key={stat.title} className="py-6">
4354
<span className="block text-.5xl mb-2">{stat.count}</span>
4455
<p className="text-base w-3/4 m-0">

0 commit comments

Comments
 (0)