fix list selection and other tickets

This commit is contained in:
Thomas Demirdjian
2025-09-09 11:57:21 +02:00
parent 69977aba2b
commit 11f65023b7
23 changed files with 483 additions and 1397 deletions
@@ -31,9 +31,13 @@ import { FONT_FAMILY } from "../../styles/Fonts";
import { size } from "../../styles/Style";
let externalOpen;
let externalClose;
export const openComments = (projectId) => {
if (typeof externalOpen === "function") externalOpen(projectId);
};
export const closeComments = () => {
if (typeof externalClose === "function") externalClose();
};
const formatRelativeTime = (date) => {
try {
@@ -67,8 +71,14 @@ const CommentsBottomSheet = () => {
setProjectId(pid || null);
requestAnimationFrame(() => modalRef.current?.present());
};
externalClose = () => {
try {
modalRef.current?.dismiss?.();
} catch {}
};
return () => {
externalOpen = undefined;
externalClose = undefined;
};
}, []);
@@ -141,10 +151,10 @@ const CommentsBottomSheet = () => {
{...props}
appearsOnIndex={0}
disappearsOnIndex={-1}
pressBehavior={typing ? "none" : "close"}
pressBehavior="close"
/>
),
[typing]
[]
);
const handleScroll = useCallback(
@@ -170,14 +180,19 @@ const CommentsBottomSheet = () => {
snapPoints={snapPoints}
keyboardBehavior="interactive" // linput est dans le contenu → mode interactif OK
keyboardBlurBehavior="restore"
enablePanDownToClose={!typing} // évite un dismiss pendant la frappe
enableContentPanningGesture={!typing}
enablePanDownToClose
enableContentPanningGesture
stackBehavior="push"
topInset={insets.top}
bottomInset={insets.bottom}
backdropComponent={renderBackdrop}
handleIndicatorStyle={{ backgroundColor: Palette.white }}
backgroundStyle={{ backgroundColor: "transparent" }}
onDismiss={() => {
setProjectId(null);
setTyping(false);
setText("");
}}
>
<BlurView
intensity={20}
@@ -192,6 +207,17 @@ const CommentsBottomSheet = () => {
}
>
<View style={{ paddingTop: 10, paddingBottom: 8 }}>
<Pressable
onPress={() => modalRef.current?.dismiss?.()}
style={{ position: "absolute", right: 10, top: 8, padding: 6 }}
hitSlop={8}
>
<Image
source={icons.close}
style={{ width: 22, height: 22, tintColor: Palette.white }}
resizeMode="contain"
/>
</Pressable>
<Text
style={{
fontSize: 22,