From b2aaac01db759bb5838fed54bbf2794ca5fd85b7 Mon Sep 17 00:00:00 2001 From: Ammar Ahmed Date: Fri, 7 Mar 2025 12:02:50 +0500 Subject: [PATCH] mobile: add missing check when dragging to end --- .../mobile/app/components/side-menu/index.tsx | 48 ++++++++++++++----- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/apps/mobile/app/components/side-menu/index.tsx b/apps/mobile/app/components/side-menu/index.tsx index f8a434a7a..4a40eaf38 100644 --- a/apps/mobile/app/components/side-menu/index.tsx +++ b/apps/mobile/app/components/side-menu/index.tsx @@ -53,6 +53,7 @@ import { useSideMenuNotebookSelectionStore, useSideMenuTagsSelectionStore } from "./stores"; +import { useSideBarDraggingStore } from "./dragging-store"; const renderScene = SceneMap({ home: SideMenuHome, notebooks: SideMenuNotebooks, @@ -108,6 +109,7 @@ const TabBar = ( options: Record> | undefined; } ) => { + const dragging = useSideBarDraggingStore((state) => state.dragging); const { colors, isDark } = useThemeColors(); const groupOptions = useGroupOptions( props.navigationState.index === 1 ? "notebook" : "tags" @@ -380,19 +382,39 @@ const TabBar = ( ) : null} {props.navigationState.index === 0 ? ( - { - useThemeStore.getState().setColorScheme(); - }} - style={{ - width: 28, - height: 28 - }} - testID="sidebar-theme-button" - color={colors.primary.icon} - name={isDark ? "weather-night" : "weather-sunny"} - size={AppFontSize.lg - 2} - /> + <> + { + useThemeStore.getState().setColorScheme(); + }} + style={{ + width: 28, + height: 28 + }} + testID="sidebar-theme-button" + color={colors.primary.icon} + name={isDark ? "weather-night" : "weather-sunny"} + size={AppFontSize.lg - 2} + /> + + {dragging ? ( + { + useSideBarDraggingStore.setState({ + dragging: false + }); + }} + style={{ + width: 28, + height: 28 + }} + testID="check" + color={colors.primary.icon} + name={"check"} + size={AppFontSize.lg - 2} + /> + ) : null} + ) : null}