فهرست منبع

fixed bottom insets for android

Viktoriia 3 هفته پیش
والد
کامیت
68d65a65e4

+ 6 - 5
src/screens/InAppScreens/MessagesScreen/Components/MoreModal.tsx

@@ -80,8 +80,8 @@ const MoreModal = () => {
 
   const [chatData, setChatData] = useState<
     | (ChatProps & {
-        token: string;
-      })
+      token: string;
+    })
     | null
   >(null);
   const [name, setName] = useState<string | null>(null);
@@ -92,8 +92,8 @@ const MoreModal = () => {
   const handleSheetOpen = (
     payload:
       | (ChatProps & {
-          token: string;
-        })
+        token: string;
+      })
       | null
   ) => {
     setChatData(payload);
@@ -301,9 +301,10 @@ const MoreModal = () => {
       containerStyle={styles.sheetContainer}
       defaultOverlayOpacity={0.5}
       indicatorStyle={{ backgroundColor: 'transparent' }}
+      safeAreaInsets={{ top: insets.top, bottom: insets.bottom || 24, left: 0, right: 0 }}
     >
       {chatData && (
-        <View style={[styles.container, { paddingBottom: 8 + insets.bottom }]}>
+        <View style={[styles.container]}>
           <TouchableOpacity
             style={styles.header}
             onPress={() => {

+ 7 - 5
src/screens/InAppScreens/MessagesScreen/Components/UserOptionsModal.tsx

@@ -11,9 +11,10 @@ import BanIcon from 'assets/icons/messages/ban.svg';
 import UserTieIcon from 'assets/icons/messages/user-tie.svg';
 import RemoveUserTieIcon from 'assets/icons/messages/crossed-user-tie.svg';
 import UserIcon from 'assets/icons/messages/user-solid.svg';
+import { useSafeAreaInsets } from 'react-native-safe-area-context';
 
 const UserOptionsModal = () => {
-  const navigation = useNavigation();
+  const insets = useSafeAreaInsets();
 
   const [userData, setUserData] = useState<any>(null);
   const { mutateAsync: setAdmin } = usePostSetGroupAdminMutation();
@@ -24,10 +25,10 @@ const UserOptionsModal = () => {
   const handleSheetOpen = (
     payload:
       | (ChatProps & {
-          token: string;
-          refetch: () => void;
-          refetchBlocked: () => void;
-        })
+        token: string;
+        refetch: () => void;
+        refetchBlocked: () => void;
+      })
       | null
   ) => {
     setUserData(payload);
@@ -97,6 +98,7 @@ const UserOptionsModal = () => {
       containerStyle={styles.sheetContainer}
       defaultOverlayOpacity={0.5}
       indicatorStyle={{ backgroundColor: 'transparent' }}
+      safeAreaInsets={{ top: insets.top, bottom: insets.bottom || 24, left: 0, right: 0 }}
     >
       {userData && (
         <View style={[styles.container, { paddingBottom: 8 }]}>