Skip to content

Commit 5cd065f

Browse files
committed
chore: info block variant type fix
1 parent ccc9899 commit 5cd065f

File tree

4 files changed

+17
-23
lines changed

4 files changed

+17
-23
lines changed

src/Shared/Components/InfoBlock/InfoBlock.component.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ import {
2424
SIZE_TO_ICON_CLASS_MAP,
2525
VARIANT_TO_ICON_MAP,
2626
} from './constants'
27-
import { InfoBlockProps, InfoBlockVariant } from './types'
27+
import { InfoBlockProps } from './types'
2828

2929
const InfoBlock = ({
3030
layout = 'row',
31-
variant = InfoBlockVariant.INFORMATION,
31+
variant = 'information',
3232
size = ComponentSizeType.large,
3333
customIcon,
3434
buttonProps,

src/Shared/Components/InfoBlock/constants.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { ComponentSizeType } from '@Shared/constants'
17+
import { ComponentSizeType, InfoBlockVariant } from '@Shared/constants'
1818

1919
import { ButtonProps } from '../Button'
2020
import { Icon } from '../Icon'
21-
import { InfoBlockProps, InfoBlockVariant } from './types'
21+
import { InfoBlockProps } from './types'
2222

2323
export const VARIANT_TO_ICON_MAP: Record<InfoBlockVariant, InfoBlockProps['customIcon']> = {
2424
[InfoBlockVariant.ERROR]: <Icon name="ic-error" color="R500" />,

src/Shared/Components/InfoBlock/types.ts

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,11 @@
1616

1717
import { ReactElement, ReactNode } from 'react'
1818

19-
import { ComponentSizeType } from '@Shared/constants'
19+
import { ComponentSizeType, InfoBlockVariantType } from '@Shared/constants'
2020
import { BorderConfigType, ComponentLayoutType } from '@Shared/types'
2121

2222
import { ButtonComponentType, ButtonProps } from '../Button'
2323

24-
export enum InfoBlockVariant {
25-
ERROR = 'error',
26-
HELP = 'help',
27-
INFORMATION = 'information',
28-
SUCCESS = 'success',
29-
WARNING = 'warning',
30-
NEUTRAL = 'neutral',
31-
}
32-
33-
export type InfoBlockVariantType =
34-
| InfoBlockVariant.ERROR
35-
| InfoBlockVariant.HELP
36-
| InfoBlockVariant.INFORMATION
37-
| InfoBlockVariant.SUCCESS
38-
| InfoBlockVariant.WARNING
39-
| InfoBlockVariant.NEUTRAL
40-
4124
export type InfoBlockProps = {
4225
/**
4326
* @default 'row'

src/Shared/constants.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import { OptionType } from '@Common/Types'
1818

19-
import { InfoBlockProps, InfoBlockVariant } from './Components'
19+
import { InfoBlockProps } from './Components'
2020
import { CDMaterialSidebarType, ConfigKeysWithLockType, ConfigurationType, IconBaseColorType } from './types'
2121

2222
export const ARTIFACT_STATUS = {
@@ -555,6 +555,17 @@ export const ENTERPRISE_SUPPORT_LINK = 'enterprise@devtron.ai'
555555

556556
export const INVALID_LICENSE_KEY = 'inValid'
557557

558+
export enum InfoBlockVariant {
559+
ERROR = 'error',
560+
HELP = 'help',
561+
INFORMATION = 'information',
562+
SUCCESS = 'success',
563+
WARNING = 'warning',
564+
NEUTRAL = 'neutral',
565+
}
566+
567+
export type InfoBlockVariantType = 'error' | 'help' | 'information' | 'success' | 'warning' | 'neutral'
568+
558569
export const VARIANT_TO_BG_MAP: Record<InfoBlockProps['variant'], string> = {
559570
[InfoBlockVariant.ERROR]: 'bcr-1',
560571
[InfoBlockVariant.HELP]: 'bcv-1',

0 commit comments

Comments
 (0)