Skip to content

Commit

Permalink
Make all properties except panelId mandatory in ToolsPanelContext
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw committed Sep 23, 2021
1 parent d4674f1 commit 1f833ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions packages/components/src/tools-panel/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import type { ToolsPanelContext as ToolsPanelContextType } from './types';
const noop = () => undefined;

export const ToolsPanelContext = createContext< ToolsPanelContextType >( {
menuItems: { default: {}, optional: {} },
hasMenuItems: false,
isResetting: false,
registerPanelItem: noop,
deregisterPanelItem: noop,
flagItemCustomization: noop,
Expand Down
6 changes: 3 additions & 3 deletions packages/components/src/tools-panel/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ export type ToolsPanelMenuItems = {

export type ToolsPanelContext = {
panelId?: string;
menuItems?: ToolsPanelMenuItems;
hasMenuItems?: boolean;
menuItems: ToolsPanelMenuItems;
hasMenuItems: boolean;
registerPanelItem: ( item: ToolsPanelItem ) => void;
deregisterPanelItem: ( label: string ) => void;
flagItemCustomization: ( label: string ) => void;
isResetting?: boolean;
isResetting: boolean;
};

export type ToolsPanelControlsGroupProps = {
Expand Down

0 comments on commit 1f833ab

Please sign in to comment.