Skip to content

Commit

Permalink
fix: naming handle instead of on
Browse files Browse the repository at this point in the history
  • Loading branch information
magrinj committed Nov 29, 2024
1 parent e7e1051 commit be8df9e
Showing 1 changed file with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ export const ObjectOptionsDropdownRecordGroupFieldsContent = () => {
filteredRecordGroupFieldMetadataItems,
} = useSearchRecordGroupField();

const { handleRecordGroupFieldChange, resetRecordGroupField } =
useHandleRecordGroupField({
viewBarComponentId: recordIndexId,
});
const {
handleRecordGroupFieldChange: setRecordGroupField,
resetRecordGroupField,
} = useHandleRecordGroupField({
viewBarComponentId: recordIndexId,
});

const newFieldSettingsUrl = getSettingsPagePath(
SettingsPath.ObjectNewFieldSelect,
Expand All @@ -74,13 +76,15 @@ export const ObjectOptionsDropdownRecordGroupFieldsContent = () => {
navigationMemorizedUrlState,
);

const onResetRecordGroupField = () => {
const handleResetRecordGroupField = () => {
resetRecordGroupField();
closeDropdown();
};

const onRecordGroupFieldChange = (fieldMetadataItem: FieldMetadataItem) => {
handleRecordGroupFieldChange(fieldMetadataItem);
const handleRecordGroupFieldChange = (
fieldMetadataItem: FieldMetadataItem,
) => {
setRecordGroupField(fieldMetadataItem);
closeDropdown();
};

Expand Down Expand Up @@ -111,13 +115,13 @@ export const ObjectOptionsDropdownRecordGroupFieldsContent = () => {
<MenuItemSelect
text="None"
selected={!isDefined(recordGroupFieldMetadataItem)}
onClick={onResetRecordGroupField}
onClick={handleResetRecordGroupField}
/>
{filteredRecordGroupFieldMetadataItems.map((fieldMetadataItem) => (
<MenuItemSelect
key={fieldMetadataItem.id}
selected={fieldMetadataItem.id === recordGroupFieldMetadataItem?.id}
onClick={() => onRecordGroupFieldChange(fieldMetadataItem)}
onClick={() => handleRecordGroupFieldChange(fieldMetadataItem)}
LeftIcon={getIcon(fieldMetadataItem.icon)}
text={fieldMetadataItem.label}
/>
Expand Down

0 comments on commit be8df9e

Please sign in to comment.