mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-19 07:56:02 +01:00
refactor(web/input): add icon to date picker
This commit is contained in:
@@ -2,6 +2,7 @@ import { IDateInput } 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 { DatePicker } from '@mantine/dates';
|
import { DatePicker } from '@mantine/dates';
|
||||||
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
row: IDateInput;
|
row: IDateInput;
|
||||||
@@ -31,6 +32,7 @@ const DateField: React.FC<Props> = (props) => {
|
|||||||
inputFormat="DD/MM/YYYY"
|
inputFormat="DD/MM/YYYY"
|
||||||
withAsterisk={props.row.required}
|
withAsterisk={props.row.required}
|
||||||
clearable={props.row.clearable}
|
clearable={props.row.clearable}
|
||||||
|
icon={props.row.icon && <FontAwesomeIcon fixedWidth icon={props.row.icon} />}
|
||||||
minDate={props.row.min ? new Date(props.row.min) : undefined}
|
minDate={props.row.min ? new Date(props.row.min) : undefined}
|
||||||
maxDate={props.row.max ? new Date(props.row.max) : undefined}
|
maxDate={props.row.max ? new Date(props.row.max) : undefined}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -79,4 +79,5 @@ export interface IDateInput {
|
|||||||
clearable?: boolean;
|
clearable?: boolean;
|
||||||
min?: string;
|
min?: string;
|
||||||
max?: string;
|
max?: string;
|
||||||
|
icon?: IconProp;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user