fix: rtl common translation unnecessary (#1246)

* fix: rtl common translation unnecessary

* fix: format issue
This commit is contained in:
Meier Lukas
2024-10-05 16:31:15 +02:00
committed by GitHub
parent b14f82b4bb
commit 770768eb21
13 changed files with 40 additions and 95 deletions

View File

@@ -100,14 +100,11 @@ const stats = [
},
{
icon: IconPercentage,
value: (data, t) =>
t("common.rtl", {
value: formatNumber(
data.reduce((count, { adsBlockedTodayPercentage }) => count + adsBlockedTodayPercentage, 0),
2,
),
symbol: "%",
}),
value: (data) =>
`${formatNumber(
data.reduce((count, { adsBlockedTodayPercentage }) => count + adsBlockedTodayPercentage, 0),
2,
)}%`,
label: (t) => t("widget.dnsHoleSummary.data.adsBlockedTodayPercentage"),
color: "rgba(255, 165, 20, 0.4)", // YELLOW
},
@@ -135,7 +132,7 @@ const stats = [
interface StatItem {
icon: TablerIcon;
value: (x: DnsHoleSummary[], t: TranslationFunction) => string;
value: (x: DnsHoleSummary[]) => string;
label: stringOrTranslation;
color: string;
}
@@ -184,14 +181,14 @@ const StatCard = ({ item, data, usePiHoleColors, t }: StatCardProps) => {
gap="1cqmin"
>
<Text
key={item.value(data, t)}
key={item.value(data)}
className="summary-card-value text-flash"
ta="center"
size="20cqmin"
fw="bold"
style={{ "--glow-size": "2.5cqmin" }}
>
{item.value(data, t)}
{item.value(data)}
</Text>
{item.label && (
<Text className="summary-card-label" ta="center" size="15cqmin">