Skip to content

Commit

Permalink
refactor(core): rename InsertMenu->InsertMenuGroups (#6845)
Browse files Browse the repository at this point in the history
  • Loading branch information
christianhg committed Jun 4, 2024
1 parent 6d53c4c commit e1fd6bf
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 @@ -30,7 +30,7 @@ import {set, unset} from '../../patch'
import {type ObjectItem, type ObjectItemProps} from '../../types'
import {randomKey} from '../../utils/randomKey'
import {createProtoArrayValue} from '../arrays/ArrayOfObjectsInput/createProtoArrayValue'
import {InsertMenu} from '../arrays/ArrayOfObjectsInput/InsertMenu'
import {InsertMenuGroups} from '../arrays/ArrayOfObjectsInput/InsertMenuGroups'
import {RowLayout} from '../arrays/layouts/RowLayout'
import {PreviewReferenceValue} from './PreviewReferenceValue'
import {ReferenceFinalizeAlertStrip} from './ReferenceFinalizeAlertStrip'
Expand Down Expand Up @@ -216,7 +216,7 @@ export function ReferenceItem<Item extends ReferenceItemValue = ReferenceItemVal
icon={DuplicateIcon}
onClick={handleDuplicate}
/>
<InsertMenu onInsert={handleInsert} types={insertableTypes} />
<InsertMenuGroups onInsert={handleInsert} types={insertableTypes} />
</>
)}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {type ObjectItem, type ObjectItemProps} from '../../../../types'
import {randomKey} from '../../../../utils/randomKey'
import {CellLayout} from '../../layouts/CellLayout'
import {createProtoArrayValue} from '../createProtoArrayValue'
import {InsertMenu} from '../InsertMenu'
import {InsertMenuGroups} from '../InsertMenuGroups'

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

Expand Down Expand Up @@ -154,7 +154,7 @@ export function GridItem<Item extends ObjectItem = ObjectItem>(props: GridItemPr
icon={DuplicateIcon}
onClick={handleDuplicate}
/>
<InsertMenu types={insertableTypes} onInsert={handleInsert} />
<InsertMenuGroups types={insertableTypes} onInsert={handleInsert} />
</Menu>
}
popover={MENU_POPOVER_PROPS}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const MENU_POPOVER_PROPS: PopoverProps = {
constrainSize: true,
} as const

export const InsertMenu = memo(function InsertMenu(props: Props) {
export const InsertMenuGroups = memo(function InsertMenuGroups(props: Props) {
const {types, onInsert} = props
const {t} = useTranslation()
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {type ObjectItem, type ObjectItemProps} from '../../../../types'
import {randomKey} from '../../../../utils/randomKey'
import {RowLayout} from '../../layouts/RowLayout'
import {createProtoArrayValue} from '../createProtoArrayValue'
import {InsertMenu} from '../InsertMenu'
import {InsertMenuGroups} from '../InsertMenuGroups'

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

Expand Down Expand Up @@ -137,7 +137,7 @@ export function PreviewItem<Item extends ObjectItem = ObjectItem>(props: Preview
icon={DuplicateIcon}
onClick={handleDuplicate}
/>
<InsertMenu types={insertableTypes} onInsert={handleInsert} />
<InsertMenuGroups types={insertableTypes} onInsert={handleInsert} />
</Menu>
}
popover={MENU_POPOVER_PROPS}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {useTranslation} from '../../../../i18n'
import {FieldPresence} from '../../../../presence'
import {FormFieldValidationStatus} from '../../../components/formField'
import {type PrimitiveItemProps} from '../../../types/itemProps'
import {InsertMenu} from '../ArrayOfObjectsInput/InsertMenu'
import {InsertMenuGroups} from '../ArrayOfObjectsInput/InsertMenuGroups'
import {RowLayout} from '../layouts/RowLayout'
import {getEmptyValue} from './getEmptyValue'

Expand Down Expand Up @@ -83,7 +83,7 @@ export const ItemRow = forwardRef(function ItemRow(
icon={DuplicateIcon}
onClick={handleDuplicate}
/>
<InsertMenu types={insertableTypes} onInsert={handleInsert} />
<InsertMenuGroups types={insertableTypes} onInsert={handleInsert} />
</Menu>
}
/>
Expand Down

0 comments on commit e1fd6bf

Please sign in to comment.