From 086c784b0e4e80cbe3eb5bea29b3a6447f186070 Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Tue, 25 Apr 2023 11:17:40 +0500 Subject: [PATCH] mobile: fix configure toolbar sheet close with swipe --- apps/mobile/app/components/sheets/sort/index.js | 2 -- .../app/screens/settings/editor/tool-sheet.tsx | 13 ++++--------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/apps/mobile/app/components/sheets/sort/index.js b/apps/mobile/app/components/sheets/sort/index.js index 766b6418e..1e26410da 100644 --- a/apps/mobile/app/components/sheets/sort/index.js +++ b/apps/mobile/app/components/sheets/sort/index.js @@ -25,7 +25,6 @@ import Navigation from "../../../services/navigation"; import { useThemeStore } from "../../../stores/use-theme-store"; import { GROUP, SORT } from "../../../utils/constants"; import { refreshNotesPage } from "../../../utils/events"; -import layoutmanager from "../../../utils/layout-manager"; import { SIZE } from "../../../utils/size"; import { Button } from "../../ui/button"; import Seperator from "../../ui/seperator"; @@ -39,7 +38,6 @@ const Sort = ({ type, screen }) => { const updateGroupOptions = async (_groupOptions) => { await db.settings.setGroupOptions(type, _groupOptions); - layoutmanager.withSpringAnimation(600); setGroupOptions(_groupOptions); setTimeout(() => { if (screen !== "TopicSheet") Navigation.queueRoutesForUpdate(screen); diff --git a/apps/mobile/app/screens/settings/editor/tool-sheet.tsx b/apps/mobile/app/screens/settings/editor/tool-sheet.tsx index acc58f7d6..4e66fd419 100644 --- a/apps/mobile/app/screens/settings/editor/tool-sheet.tsx +++ b/apps/mobile/app/screens/settings/editor/tool-sheet.tsx @@ -20,8 +20,6 @@ along with this program. If not, see . import { ToolId } from "@notesnook/editor/dist/toolbar"; import React, { RefObject } from "react"; import { View } from "react-native"; -import ActionSheet from "react-native-actions-sheet"; -import { ScrollView } from "react-native-gesture-handler"; import { PressableButton } from "../../../components/ui/pressable"; import { SvgView } from "../../../components/ui/svg"; import Paragraph from "../../../components/ui/typography/paragraph"; @@ -34,13 +32,14 @@ import { getToolIcon, getUngroupedTools } from "./toolbar-definition"; +import { ActionSheetRef, ScrollView } from "react-native-actions-sheet"; export default function ToolSheet({ group, fwdRef }: { group: DraggableItem; - fwdRef: RefObject; + fwdRef: RefObject; }) { const colors = useThemeStore((state) => state.colors); const data = useDragState((state) => state.data); @@ -50,6 +49,7 @@ export default function ToolSheet({ (item: ToolId) => { const tool = findToolById(item); const iconSvgString = tool ? getToolIcon(tool.icon as ToolId) : null; + if (item === "none") return; return ( - { - fwdRef.current?.handleChildScrollEnd(); - }} - nestedScrollEnabled={true} - > + {!ungrouped || ungrouped.length === 0 ? (