diff --git a/app/components/announcement_banner/announcement_banner.tsx b/app/components/announcement_banner/announcement_banner.tsx index 70fbd87bc..242a803a6 100644 --- a/app/components/announcement_banner/announcement_banner.tsx +++ b/app/components/announcement_banner/announcement_banner.tsx @@ -9,7 +9,6 @@ import { View, } from 'react-native'; import Animated, {useAnimatedStyle, useSharedValue, withTiming} from 'react-native-reanimated'; -import {useSafeAreaInsets} from 'react-native-safe-area-context'; import {dismissAnnouncement} from '@actions/local/systems'; import CompassIcon from '@components/compass_icon'; @@ -85,7 +84,6 @@ const AnnouncementBanner = ({ const intl = useIntl(); const serverUrl = useServerUrl(); const height = useSharedValue(0); - const {bottom} = useSafeAreaInsets(); const theme = useTheme(); const [visible, setVisible] = useState(false); const style = getStyle(theme); @@ -107,7 +105,6 @@ const AnnouncementBanner = ({ const snapPoint = bottomSheetSnapPoint( 1, SNAP_POINT_WITHOUT_DISMISS + (allowDismissal ? DISMISS_BUTTON_HEIGHT : 0), - bottom, ); bottomSheet({ @@ -117,7 +114,7 @@ const AnnouncementBanner = ({ snapPoints: [1, snapPoint], theme, }); - }, [theme.sidebarHeaderTextColor, intl.locale, renderContent, allowDismissal, bottom]); + }, [theme.sidebarHeaderTextColor, intl.locale, renderContent, allowDismissal]); const handleDismiss = useCallback(() => { dismissAnnouncement(serverUrl, bannerText); diff --git a/app/components/channel_bookmarks/add_bookmark.tsx b/app/components/channel_bookmarks/add_bookmark.tsx index 2a71f4a68..32bc92957 100644 --- a/app/components/channel_bookmarks/add_bookmark.tsx +++ b/app/components/channel_bookmarks/add_bookmark.tsx @@ -3,14 +3,13 @@ import React, {useCallback} from 'react'; import {useIntl} from 'react-intl'; -import {Alert, View, type Insets} from 'react-native'; -import {useSafeAreaInsets} from 'react-native-safe-area-context'; +import {Alert, Platform, View, type Insets} from 'react-native'; import Button from '@components/button'; import {ITEM_HEIGHT} from '@components/option_item'; import {Screens} from '@constants'; import {useTheme} from '@context/theme'; -import {TITLE_HEIGHT} from '@screens/bottom_sheet'; +import {BOTTOM_SHEET_ANDROID_OFFSET, TITLE_HEIGHT} from '@screens/bottom_sheet'; import {bottomSheet, showModal} from '@screens/navigation'; import {bottomSheetSnapPoint} from '@utils/helpers'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; @@ -81,7 +80,6 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => ({ const AddBookmark = ({bookmarksCount, channelId, currentUserId, canUploadFiles, showLarge}: Props) => { const theme = useTheme(); const {formatMessage} = useIntl(); - const {bottom} = useSafeAreaInsets(); const styles = getStyleSheet(theme); const onPress = useCallback(() => { @@ -126,14 +124,19 @@ const AddBookmark = ({bookmarksCount, channelId, currentUserId, canUploadFiles, /> ); + let height = bottomSheetSnapPoint(1, (2 * ITEM_HEIGHT)) + TITLE_HEIGHT; + if (Platform.OS === 'android') { + height += BOTTOM_SHEET_ANDROID_OFFSET; + } + bottomSheet({ title: formatMessage({id: 'channel_info.add_bookmark', defaultMessage: 'Add a bookmark'}), renderContent, - snapPoints: [1, bottomSheetSnapPoint(1, (2 * ITEM_HEIGHT), bottom) + TITLE_HEIGHT], + snapPoints: [1, height], theme, closeButtonId: 'close-channel-quick-actions', }); - }, [bottom, bookmarksCount, canUploadFiles, currentUserId, channelId, theme]); + }, [bookmarksCount, canUploadFiles, formatMessage, theme, channelId, currentUserId]); const button = (