Skip to content

Commit f6be851

Browse files
committed
fix: info icons
1 parent 0fb11f1 commit f6be851

File tree

5 files changed

+53
-15
lines changed

5 files changed

+53
-15
lines changed
Lines changed: 20 additions & 0 deletions
Loading

src/Assets/IconV2/ic-warning.svg

Lines changed: 22 additions & 0 deletions
Loading

src/Shared/Components/FormFieldWrapper/FormFieldInfo.tsx

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

17-
import { ReactComponent as ICWarning } from '@Icons/ic-warning.svg'
18-
import { ReactComponent as ICError } from '@Icons/ic-error.svg'
19-
import { ReactComponent as ICInfoFilledOverride } from '@Icons/ic-info-filled-override.svg'
2017
import { FormFieldInfoProps, FormInfoItemProps } from './types'
2118
import { getFormErrorElementId } from './utils'
19+
import { Icon } from '../Icon'
2220

2321
const FormInfoItem = ({ id, text, icon, textClass }: FormInfoItemProps) => (
2422
<div className="flexbox dc__gap-4 fs-11 lh-16 fw-4" id={id}>
25-
<span className="dc__no-shrink icon-dim-16 flex top dc__fill-available-space">{icon}</span>
23+
<Icon name={icon} size={16} color={null} />
2624
<span className={`dc__ellipsis-right__2nd-line ${textClass}`}>{text}</span>
2725
</div>
2826
)
2927

3028
const FormFieldInfo = ({ error, helperText, warningText, inputId }: FormFieldInfoProps) => (
3129
<div className="flex left column dc__gap-4">
32-
{!!error && (
33-
<FormInfoItem text={error} icon={<ICError />} textClass="cr-5" id={getFormErrorElementId(inputId)} />
34-
)}
30+
{!!error && <FormInfoItem text={error} icon="ic-error" textClass="cr-5" id={getFormErrorElementId(inputId)} />}
3531
{!!helperText && (
3632
<FormInfoItem
3733
text={helperText}
38-
icon={<ICInfoFilledOverride className="info-icon-n6" />}
34+
icon="ic-info-filled-override"
3935
textClass="cn-7"
4036
id={`${inputId}-helper-text`}
4137
/>
4238
)}
4339
{!!warningText && (
44-
<FormInfoItem
45-
text={warningText}
46-
icon={<ICWarning className="warning-icon-y7" />}
47-
textClass="cy-7"
48-
id={`${inputId}-warning-msg`}
49-
/>
40+
<FormInfoItem text={warningText} icon="ic-warning" textClass="cy-7" id={`${inputId}-warning-msg`} />
5041
)}
5142
</div>
5243
)

src/Shared/Components/FormFieldWrapper/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { ReactElement, ReactNode } from 'react'
1818
import { TooltipProps } from '@Common/Tooltip'
1919
import { InfoIconTippyProps } from '@Common/Types'
2020
import { BorderConfigType, ComponentLayoutType } from '@Shared/types'
21+
import { IconsProps } from '../Icon'
2122

2223
export type LabelOrAriaLabelType =
2324
| {
@@ -78,7 +79,7 @@ export interface FormInfoItemProps {
7879
id: FormFieldLabelProps['inputId']
7980
text: FormFieldInfoProps['error']
8081
textClass: string
81-
icon: ReactElement
82+
icon: IconsProps['name']
8283
}
8384

8485
export interface FormFieldWrapperProps

src/Shared/Components/Icon/Icon.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { ReactComponent as ICHeartRedAnimated } from '@IconsV2/ic-heart-red-anim
2727
import { ReactComponent as ICHeartRed } from '@IconsV2/ic-heart-red.svg'
2828
import { ReactComponent as ICHibernate } from '@IconsV2/ic-hibernate.svg'
2929
import { ReactComponent as ICInProgress } from '@IconsV2/ic-in-progress.svg'
30+
import { ReactComponent as ICInfoFilledOverride } from '@IconsV2/ic-info-filled-override.svg'
3031
import { ReactComponent as ICInfoOutline } from '@IconsV2/ic-info-outline.svg'
3132
import { ReactComponent as ICJobColor } from '@IconsV2/ic-job-color.svg'
3233
import { ReactComponent as ICMissing } from '@IconsV2/ic-missing.svg'
@@ -39,6 +40,7 @@ import { ReactComponent as ICSuccess } from '@IconsV2/ic-success.svg'
3940
import { ReactComponent as ICSuspended } from '@IconsV2/ic-suspended.svg'
4041
import { ReactComponent as ICTimeoutTwoDash } from '@IconsV2/ic-timeout-two-dash.svg'
4142
import { ReactComponent as ICUnknown } from '@IconsV2/ic-unknown.svg'
43+
import { ReactComponent as ICWarning } from '@IconsV2/ic-warning.svg'
4244

4345
// eslint-disable-next-line no-restricted-imports
4446
import { IconBase } from './IconBase'
@@ -72,6 +74,7 @@ export const iconMap = {
7274
'ic-heart-red': ICHeartRed,
7375
'ic-hibernate': ICHibernate,
7476
'ic-in-progress': ICInProgress,
77+
'ic-info-filled-override': ICInfoFilledOverride,
7578
'ic-info-outline': ICInfoOutline,
7679
'ic-job-color': ICJobColor,
7780
'ic-missing': ICMissing,
@@ -84,6 +87,7 @@ export const iconMap = {
8487
'ic-suspended': ICSuspended,
8588
'ic-timeout-two-dash': ICTimeoutTwoDash,
8689
'ic-unknown': ICUnknown,
90+
'ic-warning': ICWarning,
8791
}
8892

8993
export type IconName = keyof typeof iconMap

0 commit comments

Comments
 (0)