Skip to content

Commit 1e9f2d5

Browse files
committed
fix: remove the update available variant
1 parent 99feaa4 commit 1e9f2d5

File tree

4 files changed

+6
-18
lines changed

4 files changed

+6
-18
lines changed

src/Assets/Icon/ic-sparkles.svg

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/Shared/Services/ToastManager/constants.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { ReactComponent as ICSuccess } from '@Icons/ic-success.svg'
55
import { ReactComponent as ICError } from '@Icons/ic-error.svg'
66
import { ReactComponent as ICWarning } from '@Icons/ic-warning.svg'
77
import { ReactComponent as ICLocked } from '@Icons/ic-locked.svg'
8-
import { ReactComponent as ICSparkles } from '@Icons/ic-sparkles.svg'
98
import { ReactComponent as ICClose } from '@Icons/ic-close.svg'
109
import { ToastVariantType } from './types'
1110

@@ -49,8 +48,4 @@ export const TOAST_VARIANT_TO_CONFIG_MAP: Record<
4948
icon: <ICLocked />,
5049
type: 'warning',
5150
},
52-
[ToastVariantType.updateAvailable]: {
53-
icon: <ICSparkles />,
54-
type: 'info',
55-
},
5651
}

src/Shared/Services/ToastManager/toastManager.service.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,16 @@ class ToastManager {
1919

2020
// eslint-disable-next-line class-methods-use-this
2121
showToast = (
22-
{ variant = ToastVariantType.info, ...toastProps }: ToastProps,
22+
{ variant = ToastVariantType.info, icon: customIcon, ...toastProps }: ToastProps,
2323
options: Pick<ToastOptions, 'autoClose'> = {},
2424
) => {
2525
const { icon, type } = TOAST_VARIANT_TO_CONFIG_MAP[variant]
2626

2727
return toast(<ToastContent {...toastProps} />, {
2828
...options,
29-
icon: () => <div className="dc__no-shrink flex dc__fill-available-space icon-dim-20">{icon}</div>,
29+
icon: () => (
30+
<div className="dc__no-shrink flex dc__fill-available-space icon-dim-20">{customIcon ?? icon}</div>
31+
),
3032
type,
3133
})
3234
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
import { ButtonProps } from '@Shared/Components'
2+
import { ReactElement } from 'react'
23

34
export enum ToastVariantType {
45
info = 'info',
56
success = 'success',
67
error = 'error',
78
warn = 'warn',
89
notAuthorized = 'notAuthorized',
9-
updateAvailable = 'updateAvailable',
1010
}
1111

1212
export interface ToastProps {
1313
title: string
1414
description?: string
15+
icon?: ReactElement
1516
variant?: ToastVariantType
1617
buttonProps?: ButtonProps
1718
}

0 commit comments

Comments
 (0)