Skip to content

Commit

Permalink
fix: rename render item method to wrap to
Browse files Browse the repository at this point in the history
  • Loading branch information
flops committed Sep 16, 2024
1 parent 4a59afa commit fe3998e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/ActionPanel/ActionPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ export const ActionPanel = (props: ActionPanelProps) => {

const content = (
<div ref={nodeRef} className={b(null, props.className)}>
{props.items.map(({renderItem, ...item}) => {
{props.items.map(({wrapTo, ...item}) => {
const key = `dk-action-panel-${item.id}`;
const children = <ActionPanelItemContainer key={key} item={item} />;

return renderItem ? renderItem({...item, key, children}) : children;
return wrapTo ? wrapTo({...item, key, children}) : children;
})}
</div>
);
Expand Down
4 changes: 2 additions & 2 deletions src/components/ActionPanel/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export type ActionPanelItem = {
qa?: string;
onClick?: () => void;
dragProps?: ItemDragProps;
renderItem?: (
props: Omit<ActionPanelItem, 'renderItem'> & {key: React.Key; children: React.ReactNode},
wrapTo?: (
props: Omit<ActionPanelItem, 'wrapTo'> & {key: React.Key; children: React.ReactNode},
) => React.ReactNode;
};

Expand Down

0 comments on commit fe3998e

Please sign in to comment.