Skip to content

Commit ee60603

Browse files
committed
Menubar/contexts: update to make all handlers optional
1 parent 3af8347 commit ee60603

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

client/components/Menubar/contexts.tsx

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,26 @@ export const MenuOpenContext = createContext<string>('none');
77
interface MenubarContextType {
88
createMenuHandlers: (
99
id: string
10-
) => {
10+
) => Partial<{
1111
onMouseOver: (e: React.MouseEvent) => void;
1212
onClick: (e: React.MouseEvent) => void;
1313
onBlur: (e: React.FocusEvent) => void;
1414
onFocus: (e: React.FocusEvent) => void;
15-
};
15+
}>;
1616
createMenuItemHandlers: (
1717
id: string
18-
) => {
18+
) => Partial<{
1919
onMouseUp: (e: React.MouseEvent) => void;
2020
onBlur: (e: React.FocusEvent) => void;
2121
onFocus: (e: React.FocusEvent) => void;
22-
};
22+
}>;
2323
toggleMenuOpen: (id: string) => void;
2424
hasFocus: boolean;
2525
}
2626

2727
export const MenubarContext = createContext<MenubarContextType>({
28-
createMenuHandlers: () => ({
29-
onMouseOver: () => {},
30-
onClick: () => {},
31-
onBlur: () => {},
32-
onFocus: () => {}
33-
}),
34-
createMenuItemHandlers: () => ({
35-
onMouseUp: () => {},
36-
onBlur: () => {},
37-
onFocus: () => {}
38-
}),
28+
createMenuHandlers: () => ({}),
29+
createMenuItemHandlers: () => ({}),
3930
toggleMenuOpen: () => {},
4031
hasFocus: false
4132
});

0 commit comments

Comments
 (0)