* Channel Info screen * Delete the channel & related data when archiving while viewing archived channels is off * feedback review * UX feedback * Add missing isOptionItem prop
28 lines
836 B
TypeScript
28 lines
836 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 {of as of$} from 'rxjs';
|
|
import {switchMap} from 'rxjs/operators';
|
|
|
|
import {observeChannel} from '@queries/servers/channel';
|
|
|
|
import Title from './title';
|
|
|
|
import type {WithDatabaseArgs} from '@typings/database/database';
|
|
|
|
type Props = WithDatabaseArgs & {
|
|
channelId: string;
|
|
}
|
|
|
|
const enhanced = withObservables(['channelId'], ({channelId, database}: Props) => {
|
|
const channel = observeChannel(database, channelId);
|
|
const displayName = channel.pipe(switchMap((c) => of$(c?.displayName)));
|
|
|
|
return {
|
|
displayName,
|
|
};
|
|
});
|
|
|
|
export default withDatabase(enhanced(Title));
|