Skip to content

Commit e1fd6bf

Browse files
authored
refactor(core): rename InsertMenu->InsertMenuGroups (#6845)
1 parent 6d53c4c commit e1fd6bf

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

packages/sanity/src/core/form/inputs/ReferenceInput/ReferenceItem.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import {set, unset} from '../../patch'
3030
import {type ObjectItem, type ObjectItemProps} from '../../types'
3131
import {randomKey} from '../../utils/randomKey'
3232
import {createProtoArrayValue} from '../arrays/ArrayOfObjectsInput/createProtoArrayValue'
33-
import {InsertMenu} from '../arrays/ArrayOfObjectsInput/InsertMenu'
33+
import {InsertMenuGroups} from '../arrays/ArrayOfObjectsInput/InsertMenuGroups'
3434
import {RowLayout} from '../arrays/layouts/RowLayout'
3535
import {PreviewReferenceValue} from './PreviewReferenceValue'
3636
import {ReferenceFinalizeAlertStrip} from './ReferenceFinalizeAlertStrip'
@@ -216,7 +216,7 @@ export function ReferenceItem<Item extends ReferenceItemValue = ReferenceItemVal
216216
icon={DuplicateIcon}
217217
onClick={handleDuplicate}
218218
/>
219-
<InsertMenu onInsert={handleInsert} types={insertableTypes} />
219+
<InsertMenuGroups onInsert={handleInsert} types={insertableTypes} />
220220
</>
221221
)}
222222

packages/sanity/src/core/form/inputs/arrays/ArrayOfObjectsInput/Grid/GridItem.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {type ObjectItem, type ObjectItemProps} from '../../../../types'
2222
import {randomKey} from '../../../../utils/randomKey'
2323
import {CellLayout} from '../../layouts/CellLayout'
2424
import {createProtoArrayValue} from '../createProtoArrayValue'
25-
import {InsertMenu} from '../InsertMenu'
25+
import {InsertMenuGroups} from '../InsertMenuGroups'
2626

2727
type GridItemProps<Item extends ObjectItem> = Omit<ObjectItemProps<Item>, 'renderDefault'>
2828

@@ -154,7 +154,7 @@ export function GridItem<Item extends ObjectItem = ObjectItem>(props: GridItemPr
154154
icon={DuplicateIcon}
155155
onClick={handleDuplicate}
156156
/>
157-
<InsertMenu types={insertableTypes} onInsert={handleInsert} />
157+
<InsertMenuGroups types={insertableTypes} onInsert={handleInsert} />
158158
</Menu>
159159
}
160160
popover={MENU_POPOVER_PROPS}

packages/sanity/src/core/form/inputs/arrays/ArrayOfObjectsInput/InsertMenu.tsx renamed to packages/sanity/src/core/form/inputs/arrays/ArrayOfObjectsInput/InsertMenuGroups.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const MENU_POPOVER_PROPS: PopoverProps = {
1818
constrainSize: true,
1919
} as const
2020

21-
export const InsertMenu = memo(function InsertMenu(props: Props) {
21+
export const InsertMenuGroups = memo(function InsertMenuGroups(props: Props) {
2222
const {types, onInsert} = props
2323
const {t} = useTranslation()
2424
return (

packages/sanity/src/core/form/inputs/arrays/ArrayOfObjectsInput/List/PreviewItem.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {type ObjectItem, type ObjectItemProps} from '../../../../types'
2020
import {randomKey} from '../../../../utils/randomKey'
2121
import {RowLayout} from '../../layouts/RowLayout'
2222
import {createProtoArrayValue} from '../createProtoArrayValue'
23-
import {InsertMenu} from '../InsertMenu'
23+
import {InsertMenuGroups} from '../InsertMenuGroups'
2424

2525
type PreviewItemProps<Item extends ObjectItem> = Omit<ObjectItemProps<Item>, 'renderDefault'>
2626

@@ -137,7 +137,7 @@ export function PreviewItem<Item extends ObjectItem = ObjectItem>(props: Preview
137137
icon={DuplicateIcon}
138138
onClick={handleDuplicate}
139139
/>
140-
<InsertMenu types={insertableTypes} onInsert={handleInsert} />
140+
<InsertMenuGroups types={insertableTypes} onInsert={handleInsert} />
141141
</Menu>
142142
}
143143
popover={MENU_POPOVER_PROPS}

packages/sanity/src/core/form/inputs/arrays/ArrayOfPrimitivesInput/ItemRow.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {useTranslation} from '../../../../i18n'
99
import {FieldPresence} from '../../../../presence'
1010
import {FormFieldValidationStatus} from '../../../components/formField'
1111
import {type PrimitiveItemProps} from '../../../types/itemProps'
12-
import {InsertMenu} from '../ArrayOfObjectsInput/InsertMenu'
12+
import {InsertMenuGroups} from '../ArrayOfObjectsInput/InsertMenuGroups'
1313
import {RowLayout} from '../layouts/RowLayout'
1414
import {getEmptyValue} from './getEmptyValue'
1515

@@ -83,7 +83,7 @@ export const ItemRow = forwardRef(function ItemRow(
8383
icon={DuplicateIcon}
8484
onClick={handleDuplicate}
8585
/>
86-
<InsertMenu types={insertableTypes} onInsert={handleInsert} />
86+
<InsertMenuGroups types={insertableTypes} onInsert={handleInsert} />
8787
</Menu>
8888
}
8989
/>

0 commit comments

Comments
 (0)