mattermost-mobile/app/screens/channel_files/index.ts
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

27 lines
937 B
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {withDatabase} from '@nozbe/watermelondb/DatabaseProvider';
import withObservables from '@nozbe/with-observables';
import {observeChannel} from '@queries/servers/channel';
import {observeCanDownloadFiles, observeConfigBooleanValue} from '@queries/servers/system';
import ChannelFiles from './channel_files';
import type {WithDatabaseArgs} from '@typings/database/database';
type Props = WithDatabaseArgs & {
channelId: string;
}
const enhance = withObservables(['channelId'], ({channelId, database}: Props) => {
const channel = observeChannel(database, channelId);
return {
channel,
canDownloadFiles: observeCanDownloadFiles(database),
publicLinkEnabled: observeConfigBooleanValue(database, 'EnablePublicLink'),
};
});
export default withDatabase(enhance(ChannelFiles));