Skip to content

Commit

Permalink
Refactor using modern ES6 features
Browse files Browse the repository at this point in the history
  • Loading branch information
Onitoxan committed Aug 6, 2024
1 parent c4a1fdf commit d93a12e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ const AsyncAutocompleteSelect = ({
onClose: () => {
setOpen(false);
},
open: open,
open,
isOptionEqualToValue: (option, value) => option.value === value.value,
options: options,
options,
getOptionLabel: (op) => (typeof op === 'string' ? op : op.displayLabel),
filterSelectedOptions: true,
filterOptions: (x) => x,
Expand All @@ -122,7 +122,7 @@ const AsyncAutocompleteSelect = ({
onInputChange: (_, newInputValue) => {
setInputValue(newInputValue);
},
loading: loading,
loading,
renderOption: (props, option) => {
return (
<li {...props} key={option.value}>
Expand Down
2 changes: 1 addition & 1 deletion libs/hpc-ui/src/lib/components/form-fields/checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const CheckBox = ({
const configCheckBox: FormControlLabelProps = {
...field,
...otherProps,
label: label,
label,
id: name,
control: (
<Checkbox
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ const MultiTextField = ({
): TextFieldProps => {
return {
...params,
label: label,
placeholder: placeholder,
label,
placeholder,
size: 'small',
type: 'text',
InputProps:
Expand Down
2 changes: 1 addition & 1 deletion libs/hpc-ui/src/lib/components/form-fields/switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const Switch = ({
const configCheckBox: FormControlLabelProps = {
...field,
...otherProps,
label: label,
label,
id: name,
control: <SwitchMUI checked={field.value} size={size} color={color} />,
};
Expand Down
4 changes: 2 additions & 2 deletions libs/hpc-ui/src/lib/components/form-fields/text-field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ const TextFieldWrapper = ({
const configTextField: TextFieldProps = {
...field,
...otherProps,
label: label,
label,
id: name,
multiline: textarea,
maxRows: 5,
required,
placeholder: placeholder,
placeholder,
size: 'small',
type: 'text',
};
Expand Down

0 comments on commit d93a12e

Please sign in to comment.