mobile: fix configure toolbar sheet close with swipe

This commit is contained in:
ammarahm-ed
2023-04-25 11:17:40 +05:00
parent 8548940cb9
commit 086c784b0e
2 changed files with 4 additions and 11 deletions

View File

@@ -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);

View File

@@ -20,8 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
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<ActionSheet>;
fwdRef: RefObject<ActionSheetRef>;
}) {
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 (
<PressableButton
key={item}
@@ -109,12 +109,7 @@ export default function ToolSheet({
padding: 12
}}
>
<ScrollView
onMomentumScrollEnd={() => {
fwdRef.current?.handleChildScrollEnd();
}}
nestedScrollEnabled={true}
>
<ScrollView nestedScrollEnabled={true}>
{!ungrouped || ungrouped.length === 0 ? (
<Paragraph
style={{