refactor(web/input): add missing icon prop to color type

This commit is contained in:
Luke
2023-01-20 10:30:42 +01:00
parent e298b13607
commit fcf33dbdfe
2 changed files with 3 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ import { IColorInput } from '../../../../interfaces/dialog';
import { Control, useController } from 'react-hook-form'; import { Control, useController } from 'react-hook-form';
import { FormValues } from '../../InputDialog'; import { FormValues } from '../../InputDialog';
import { ColorInput } from '@mantine/core'; import { ColorInput } from '@mantine/core';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
interface Props { interface Props {
row: IColorInput; row: IColorInput;
@@ -31,6 +32,7 @@ const ColorField: React.FC<Props> = (props) => {
defaultValue={props.row.default} defaultValue={props.row.default}
format={props.row.format} format={props.row.format}
withAsterisk={props.row.required} withAsterisk={props.row.required}
icon={props.row.icon && <FontAwesomeIcon icon={props.row.icon} fixedWidth />}
/> />
); );
}; };

View File

@@ -66,6 +66,7 @@ export interface IColorInput {
description?: string; description?: string;
format?: 'hex' | 'hexa' | 'rgb' | 'rgba' | 'hsl' | 'hsla'; format?: 'hex' | 'hexa' | 'rgb' | 'rgba' | 'hsl' | 'hsla';
required?: boolean; required?: boolean;
icon?: IconProp;
} }
export interface IDateInput { export interface IDateInput {