Skip to content

Commit

Permalink
X2-8421 | fix: call drawer.onClose when drawer is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
VitalyDevico committed Jan 8, 2024
1 parent df91881 commit a75a5c0
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/components/Sidebar/Sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,14 @@ export const Sidebar = ({
const hideRightDrawer = rightDrawer?.count <= 0 || !rightDrawer;

const handleOnClose = (direction, closeDrawer) => {
if (direction === "left") {
if (closeDrawer) {
if (closeDrawer) {
if (direction === "left") {
setIsLeftDrawerOpen(false);
}

leftDrawer.onClose?.();
} else {
if (closeDrawer) {
leftDrawer.onClose?.();
} else {
setIsRightDrawerOpen(false);
rightDrawer.onClose?.();
}

rightDrawer.onClose?.();
}
};

Expand Down

0 comments on commit a75a5c0

Please sign in to comment.