Skip to content

Commit 71059bb

Browse files
committed
fixes
1 parent df15c46 commit 71059bb

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

packages/compass-components/src/components/drawer-portal.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ type DrawerSectionProps = Omit<SectionData, 'content' | 'onClick'> & {
3434

3535
type DrawerOpenStateContextValue = boolean;
3636

37-
type DrawerSetOpenStateContextValue = {
38-
setIsDrawerOpen: (isOpen: boolean) => void;
39-
};
37+
type DrawerSetOpenStateContextValue = (isOpen: boolean) => void;
4038

4139
type DrawerActionsContextValue = {
4240
current: {
@@ -53,9 +51,7 @@ const DrawerOpenStateContext =
5351
React.createContext<DrawerOpenStateContextValue>(false);
5452

5553
const DrawerSetOpenStateContext =
56-
React.createContext<DrawerSetOpenStateContextValue>({
57-
setIsDrawerOpen: () => {},
58-
});
54+
React.createContext<DrawerSetOpenStateContextValue>(() => {});
5955

6056
const DrawerActionsContext = React.createContext<DrawerActionsContextValue>({
6157
current: {
@@ -133,9 +129,7 @@ export const DrawerContentProvider: React.FunctionComponent = ({
133129
return (
134130
<DrawerStateContext.Provider value={drawerState}>
135131
<DrawerOpenStateContext.Provider value={drawerOpenState}>
136-
<DrawerSetOpenStateContext.Provider
137-
value={{ setIsDrawerOpen: setDrawerOpenState }}
138-
>
132+
<DrawerSetOpenStateContext.Provider value={setDrawerOpenState}>
139133
<DrawerActionsContext.Provider value={drawerActions}>
140134
{children}
141135
</DrawerActionsContext.Provider>
@@ -152,7 +146,7 @@ const DrawerContextGrabber: React.FunctionComponent = ({ children }) => {
152146
actions.current.openDrawer = drawerToolbarContext.openDrawer;
153147
actions.current.closeDrawer = drawerToolbarContext.closeDrawer;
154148
useEffect(() => {
155-
openStateSetter.setIsDrawerOpen(drawerToolbarContext.isDrawerOpen);
149+
openStateSetter(drawerToolbarContext.isDrawerOpen);
156150
}, [drawerToolbarContext.isDrawerOpen, openStateSetter]);
157151
return <>{children}</>;
158152
};

packages/compass-data-modeling/src/components/diagram-editor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ const DiagramContent: React.FunctionComponent<{
133133
const isDarkMode = useDarkMode();
134134
const diagram = useRef(useDiagram());
135135
const { openDrawer } = useDrawerActions();
136-
const { isOpen: isDrawerOpen } = useDrawerState();
136+
const { isDrawerOpen } = useDrawerState();
137137

138138
const setDiagramContainerRef = useCallback((ref: HTMLDivElement | null) => {
139139
if (ref) {

0 commit comments

Comments
 (0)