🐛 remove icon alignment on column stat layout
This commit is contained in:
@@ -9,7 +9,6 @@ import {
|
|||||||
TablerIconsProps,
|
TablerIconsProps,
|
||||||
} from '@tabler/icons-react';
|
} from '@tabler/icons-react';
|
||||||
import { useTranslation } from 'next-i18next';
|
import { useTranslation } from 'next-i18next';
|
||||||
import React from 'react';
|
|
||||||
import { useConfigContext } from '~/config/provider';
|
import { useConfigContext } from '~/config/provider';
|
||||||
import { RouterOutputs, api } from '~/utils/api';
|
import { RouterOutputs, api } from '~/utils/api';
|
||||||
|
|
||||||
@@ -120,6 +119,7 @@ type StatCardProps = {
|
|||||||
const StatCard = ({ item, data, usePiHoleColors }: StatCardProps) => {
|
const StatCard = ({ item, data, usePiHoleColors }: StatCardProps) => {
|
||||||
const { t } = useTranslation('modules/dns-hole-summary');
|
const { t } = useTranslation('modules/dns-hole-summary');
|
||||||
const { ref, height, width } = useElementSize();
|
const { ref, height, width } = useElementSize();
|
||||||
|
const isLong = width > height + 20;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
@@ -138,14 +138,14 @@ const StatCard = ({ item, data, usePiHoleColors }: StatCardProps) => {
|
|||||||
w="100%"
|
w="100%"
|
||||||
align="center"
|
align="center"
|
||||||
justify="space-evenly"
|
justify="space-evenly"
|
||||||
direction={width > height + 20 ? 'row' : 'column'}
|
direction={isLong ? 'row' : 'column'}
|
||||||
>
|
>
|
||||||
<item.icon size={30} style={{ margin: '0 10' }} />
|
<item.icon size={30} style={{ margin: '0 10' }} />
|
||||||
<Flex
|
<Flex
|
||||||
justify="center"
|
justify="center"
|
||||||
direction="column"
|
direction="column"
|
||||||
style={{
|
style={{
|
||||||
flex: 1,
|
flex: isLong ? 1 : undefined,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Text align="center" lh={1.2} size="md" weight="bold">
|
<Text align="center" lh={1.2} size="md" weight="bold">
|
||||||
|
|||||||
Reference in New Issue
Block a user