refactor: icon picker add asterisk option (#2496)
* fix: added `withAsterisk` property to `IconPicker`, defaulted to true so it's backwards compatible * fix: `icon-picker.tsx` formatting --------- Co-authored-by: Andre Silva <asilva01@acuitysso.com>
This commit is contained in:
@@ -33,9 +33,17 @@ interface IconPickerProps {
|
|||||||
error?: string | null;
|
error?: string | null;
|
||||||
onFocus?: FocusEventHandler;
|
onFocus?: FocusEventHandler;
|
||||||
onBlur?: FocusEventHandler;
|
onBlur?: FocusEventHandler;
|
||||||
|
withAsterisk?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const IconPicker = ({ value: propsValue, onChange, error, onFocus, onBlur }: IconPickerProps) => {
|
export const IconPicker = ({
|
||||||
|
value: propsValue,
|
||||||
|
onChange,
|
||||||
|
error,
|
||||||
|
onFocus,
|
||||||
|
onBlur,
|
||||||
|
withAsterisk = true,
|
||||||
|
}: IconPickerProps) => {
|
||||||
const [value, setValue] = useUncontrolled({
|
const [value, setValue] = useUncontrolled({
|
||||||
value: propsValue,
|
value: propsValue,
|
||||||
onChange,
|
onChange,
|
||||||
@@ -145,7 +153,7 @@ export const IconPicker = ({ value: propsValue, onChange, error, onFocus, onBlur
|
|||||||
setSearch(value || "");
|
setSearch(value || "");
|
||||||
}}
|
}}
|
||||||
rightSectionPointerEvents="none"
|
rightSectionPointerEvents="none"
|
||||||
withAsterisk
|
withAsterisk={withAsterisk}
|
||||||
error={error}
|
error={error}
|
||||||
label={tCommon("iconPicker.label")}
|
label={tCommon("iconPicker.label")}
|
||||||
placeholder={tCommon("iconPicker.header", { countIcons: String(data?.countIcons ?? 0) })}
|
placeholder={tCommon("iconPicker.header", { countIcons: String(data?.countIcons ?? 0) })}
|
||||||
|
|||||||
Reference in New Issue
Block a user