mattermost-mobile/app/components/files_search/file_options/mobile_options.tsx
Ashish Dhama 100a760502
[MM-44655] : Add channel files screen (#7223)
* add channel files screen

* fix filtering

* refactor code and fix style

* add search and some refactoring

* fix lint

* refactoring

* move file filters to files directory

* fix dependecy

* UX fixes and minor memo dependency changes

* fix empty state on Ipad

* fix search issues

* fix lint error

* fix search issue

* fix loading on filter changes

* show different text if no files found when filter is applied

* feedback review

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2023-04-14 18:33:11 -04:00

50 lines
1.3 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';
import type {EdgeInsets} from 'react-native-safe-area-context';
type Props = {
fileInfo: FileInfo;
insets: EdgeInsets;
numOptions: number;
setAction: (action: GalleryAction) => void;
theme: Theme;
}
export const showMobileOptionsBottomSheet = ({
fileInfo,
insets,
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, insets.bottom) + HEADER_HEIGHT,
],
theme,
title: '',
});
};