From e774b06fc2173eb094e2b698a93624a54cd37dff Mon Sep 17 00:00:00 2001 From: Meier Lukas Date: Tue, 11 Mar 2025 22:13:03 +0100 Subject: [PATCH] fix(dns-hole-summary): remove inconsistency for position of text (#2568) --- packages/widgets/src/dns-hole/summary/component.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/widgets/src/dns-hole/summary/component.tsx b/packages/widgets/src/dns-hole/summary/component.tsx index 32504a70d..b0636ff44 100644 --- a/packages/widgets/src/dns-hole/summary/component.tsx +++ b/packages/widgets/src/dns-hole/summary/component.tsx @@ -152,6 +152,7 @@ interface StatCardProps { const StatCard = ({ item, data, usePiHoleColors, t }: StatCardProps) => { const { ref, height, width } = useElementSize(); const isLong = width > height + 20; + const canStackText = height > 32; const hideLabel = (height <= 32 && width <= 256) || (height <= 64 && width <= 92); const tooltip = item.tooltip?.(data, t); const board = useRequiredBoard(); @@ -182,7 +183,7 @@ const StatCard = ({ item, data, usePiHoleColors, t }: StatCardProps) => { className="summary-card-texts" justify="center" align="center" - direction={isLong ? "row" : "column"} + direction={isLong && !canStackText ? "row" : "column"} style={{ flex: isLong ? 1 : undefined, }}