Skip to content

Commit 5e745fa

Browse files
committed
fix: icon size
1 parent 19f73ae commit 5e745fa

File tree

3 files changed

+27
-18
lines changed

3 files changed

+27
-18
lines changed

src/components/DoughnutMetrics/DoughnutMetrics.tsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22

3-
import type {TextProps} from '@gravity-ui/uikit';
3+
import type {HelpMarkProps, TextProps} from '@gravity-ui/uikit';
44
import {Flex, HelpMark, Text} from '@gravity-ui/uikit';
55

66
import {cn} from '../../utils/cn';
@@ -17,16 +17,27 @@ interface LegendProps {
1717
variant?: TextProps['variant'];
1818
color?: TextProps['color'];
1919
note?: React.ReactNode;
20+
noteIconSize?: HelpMarkProps['iconSize'];
2021
}
2122

22-
function Legend({children, variant = 'subheader-3', color = 'primary', note}: LegendProps) {
23+
function Legend({
24+
children,
25+
variant = 'subheader-3',
26+
color = 'primary',
27+
note,
28+
noteIconSize,
29+
}: LegendProps) {
2330
return (
2431
<Flex gap={1} alignItems="center">
2532
<Text variant={variant} color={color} className={b('legend')} as="div">
2633
{children}
2734
</Text>
2835
{note && (
29-
<HelpMark className={b('legend-note')} popoverProps={{placement: 'right'}}>
36+
<HelpMark
37+
iconSize={noteIconSize || 'm'}
38+
className={b('legend-note')}
39+
popoverProps={{placement: 'right'}}
40+
>
3041
{note}
3142
</HelpMark>
3243
)}

src/containers/Tenant/Diagnostics/TenantOverview/TabCard/TabCard.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
.tenant-tab-card {
22
border-radius: var(--g-border-radius-s);
33

4-
&__help-icon {
5-
color: var(--g-color-text-hint);
6-
}
7-
84
&__card-container {
95
padding: var(--g-spacing-4);
106

src/containers/Tenant/Diagnostics/TenantOverview/TabCard/TabCard.tsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Card, Flex, HelpMark, Text} from '@gravity-ui/uikit';
1+
import {Card, Flex} from '@gravity-ui/uikit';
22

33
import {DoughnutMetrics} from '../../../../../components/DoughnutMetrics/DoughnutMetrics';
44
import {formatBytes} from '../../../../../utils/bytesParsers';
@@ -64,17 +64,19 @@ export function TabCard({
6464
{formattedPercentage}
6565
</DoughnutMetrics.Value>
6666
</DoughnutMetrics>
67-
<Flex direction="column" gap={1}>
68-
<Text variant="subheader-2" color="primary">
67+
<div className={b('legend-wrapper')}>
68+
<DoughnutMetrics.Legend variant="subheader-2">
6969
{formattedValue}
70-
</Text>
71-
<Flex alignItems="center" gap={1}>
72-
<Text variant="body-1" color="secondary">
73-
{sublabel || label}
74-
</Text>
75-
{helpText && <HelpMark className={b('help-icon')}>{helpText}</HelpMark>}
76-
</Flex>
77-
</Flex>
70+
</DoughnutMetrics.Legend>
71+
<DoughnutMetrics.Legend
72+
variant="body-1"
73+
color="secondary"
74+
note={helpText}
75+
noteIconSize="s"
76+
>
77+
{sublabel || label}
78+
</DoughnutMetrics.Legend>
79+
</div>
7880
</Flex>
7981
</Card>
8082
</div>

0 commit comments

Comments
 (0)