mattermost-mobile/app/components/files_search/file_options/mobile_options.tsx
Elias Nahum 7cb2ee75b3
Fix bottomSheet bottom insets (#8331)
* Fix bottomSheet bottom insets

* fix search team picker on android

* ux review

* fix footer padding for message priority modal on iPad
2024-11-29 12:50:09 +08:00

47 lines
1.2 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react';
import {ITEM_HEIGHT} from '@components/slide_up_panel_item';
import {bottomSheet} from '@screens/navigation';
import {bottomSheetSnapPoint} from '@utils/helpers';
import Header, {HEADER_HEIGHT} from './header';
import OptionMenus from './option_menus';
import type {GalleryAction} from '@typings/screens/gallery';
type Props = {
fileInfo: FileInfo;
numOptions: number;
setAction: (action: GalleryAction) => void;
theme: Theme;
}
export const showMobileOptionsBottomSheet = ({
fileInfo,
numOptions,
setAction,
theme,
}: Props) => {
const renderContent = () => (
<>
<Header fileInfo={fileInfo}/>
<OptionMenus
setAction={setAction}
fileInfo={fileInfo}
/>
</>
);
bottomSheet({
closeButtonId: 'close-search-file-options',
renderContent,
snapPoints: [
1,
bottomSheetSnapPoint(numOptions, ITEM_HEIGHT) + HEADER_HEIGHT,
],
theme,
title: '',
});
};