Skip to content

Commit 2e950b0

Browse files
committed
fix: length of charts
1 parent ae327e0 commit 2e950b0

File tree

4 files changed

+52
-4
lines changed

4 files changed

+52
-4
lines changed

public/locales/en.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,15 @@
425425
"inactive": "Coming soon...",
426426
"activate": "Activate"
427427
},
428+
"KyvernoHint": {
429+
"title": "Kyverno",
430+
"subtitle": "Enforce policies",
431+
"activeStatus": "Active v",
432+
"progressAvailable": "Available",
433+
"noResources": "No Resources",
434+
"inactive": "Inactive",
435+
"activate": "Activate"
436+
},
428437
"common": {
429438
"loading": "Loading...",
430439
"errorLoadingResources": "Error loading resources",

src/components/BentoGrid/ComponentCard/ComponentCard.module.css

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,30 @@
5656
padding: 0 0.5rem;
5757
}
5858

59+
.progressBarContainerSmall {
60+
display: flex;
61+
gap: 8px;
62+
width: 100%;
63+
max-width: 400px;
64+
padding: 0 0.5rem;
65+
}
66+
67+
.progressBarContainerMedium {
68+
display: flex;
69+
gap: 8px;
70+
width: 100%;
71+
max-width: 600px;
72+
padding: 0 0.75rem;
73+
}
74+
75+
.progressBarContainerLarge {
76+
display: flex;
77+
gap: 8px;
78+
width: 100%;
79+
max-width: none;
80+
padding: 0 1rem;
81+
}
82+
5983
.progressBar {
6084
width: 100%;
6185
}

src/components/BentoGrid/ComponentCard/ComponentCard.tsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const ComponentCard: React.FC<GenericHintProps & { onClick?: () => void;
3838
/>
3939
}
4040
titleText={config.title}
41-
subtitleText={config.subtitle}
41+
subtitleText={size === 'small' ? undefined : config.subtitle}
4242
interactive={enabled}
4343
/>
4444
}
@@ -65,14 +65,29 @@ export const ComponentCard: React.FC<GenericHintProps & { onClick?: () => void;
6565
)}
6666

6767
<div className={styles.contentContainer}>
68-
<div className={styles.progressBarContainer}>
68+
<div className={
69+
size === 'small' ? styles.progressBarContainerSmall :
70+
size === 'medium' ? styles.progressBarContainerMedium :
71+
styles.progressBarContainerLarge
72+
}>
6973
<MultiPercentageBar
7074
segments={hintState.segments}
7175
className={styles.progressBar}
7276
label={hintState.label}
7377
showPercentage={hintState.showPercentage}
7478
isHealthy={hintState.isHealthy}
7579
showOnlyNonZero={hintState.showOnlyNonZero ?? true}
80+
barWidth={
81+
size === 'small' ? '80%' :
82+
size === 'medium' ? '85%' :
83+
'90%'
84+
}
85+
barHeight={size === 'small' ? '8px' : '12px'}
86+
barMaxWidth={
87+
size === 'small' ? '400px' :
88+
size === 'medium' ? '600px' :
89+
'none'
90+
}
7691
/>
7792
</div>
7893
</div>

src/components/BentoGrid/ComponentCard/componentConfigs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ export const useKyvernoHintConfig = (): GenericHintConfig => {
5656
const { t } = useTranslation();
5757

5858
return {
59-
title: "Kyverno",
60-
subtitle: "Enfore policies",
59+
title: t('Hints.KyvernoHint.title'),
60+
subtitle: t('Hints.KyvernoHint.subtitle'),
6161
iconSrc: '/kyverno.svg',
6262
iconAlt: 'Kyverno',
6363
iconStyle: { borderRadius: '0' }, // Vault icon should not be rounded

0 commit comments

Comments
 (0)