* 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>
50 lines
1.3 KiB
TypeScript
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: '',
|
|
});
|
|
};
|