Skip to content

Commit

Permalink
feat(AsideHeader): add sort callback for AsideHeader
Browse files Browse the repository at this point in the history
  • Loading branch information
jenshenJ committed Dec 5, 2024
1 parent bf6e826 commit adb757a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/AllPagesPanel/AllPagesPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export const AllPagesPanel: React.FC<AllPagesPanelProps> = (props) => {
newItems.splice(newIndex, 0, element);

onMenuItemsChanged?.(newItems);
editMenuProps?.onChangeItemsOrder?.(element, oldIndex, newIndex);
},
[onMenuItemsChanged],

Check warning on line 111 in src/components/AllPagesPanel/AllPagesPanel.tsx

View workflow job for this annotation

GitHub Actions / Verify Files

React Hook useCallback has a missing dependency: 'editMenuProps'. Either include it or remove the dependency array
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,9 @@ export const AsideHeaderShowcase: React.FC<AsideHeaderShowcaseProps> = ({
}}
onMenuMoreClick={() => console.log('onMenuMoreClick')}

Check warning on line 298 in src/components/AsideHeader/__stories__/AsideHeaderShowcase.tsx

View workflow job for this annotation

GitHub Actions / Verify Files

Unexpected console statement
onAllPagesClick={() => console.log('onAllPagesClick')}

Check warning on line 299 in src/components/AsideHeader/__stories__/AsideHeaderShowcase.tsx

View workflow job for this annotation

GitHub Actions / Verify Files

Unexpected console statement
editMenuProps={{enableSorting: true}}
editMenuProps={{
enableSorting: true,
}}
/>
</div>
);
Expand Down
1 change: 1 addition & 0 deletions src/components/AsideHeader/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export interface EditMenuProps {
onToggleMenuItem?: (changedItem: MenuItem) => void;
onResetSettingsToDefault?: () => void;
enableSorting?: boolean;
onChangeItemsOrder?: (changedItem: MenuItem, oldIndex: number, newIndex: number) => void;
}

export interface AsideHeaderGeneralProps extends QAProps {
Expand Down

0 comments on commit adb757a

Please sign in to comment.