fix(dns-hole-summary): remove inconsistency for position of text (#2568)
This commit is contained in:
@@ -152,6 +152,7 @@ interface StatCardProps {
|
|||||||
const StatCard = ({ item, data, usePiHoleColors, t }: StatCardProps) => {
|
const StatCard = ({ item, data, usePiHoleColors, t }: StatCardProps) => {
|
||||||
const { ref, height, width } = useElementSize();
|
const { ref, height, width } = useElementSize();
|
||||||
const isLong = width > height + 20;
|
const isLong = width > height + 20;
|
||||||
|
const canStackText = height > 32;
|
||||||
const hideLabel = (height <= 32 && width <= 256) || (height <= 64 && width <= 92);
|
const hideLabel = (height <= 32 && width <= 256) || (height <= 64 && width <= 92);
|
||||||
const tooltip = item.tooltip?.(data, t);
|
const tooltip = item.tooltip?.(data, t);
|
||||||
const board = useRequiredBoard();
|
const board = useRequiredBoard();
|
||||||
@@ -182,7 +183,7 @@ const StatCard = ({ item, data, usePiHoleColors, t }: StatCardProps) => {
|
|||||||
className="summary-card-texts"
|
className="summary-card-texts"
|
||||||
justify="center"
|
justify="center"
|
||||||
align="center"
|
align="center"
|
||||||
direction={isLong ? "row" : "column"}
|
direction={isLong && !canStackText ? "row" : "column"}
|
||||||
style={{
|
style={{
|
||||||
flex: isLong ? 1 : undefined,
|
flex: isLong ? 1 : undefined,
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user