mattermost-mobile/app/screens/settings/index.tsx
Avinash Lingaloo 8902c8e1c1
MM-39711 Gekidou Settings - Notification Main Screen (#6285)
* added chevron to menu item component

* starting with the skeleton

* starting with the skeleton

* starting with the skeleton

* starting with the skeleton

* remove extra line

* tested on tablets

* some corrections

* corrections as per review

* starting with notification skeleton

* attached notification settings to navigation

* added auto responder

* update translation

* update snapshot

* updated snapshot

* correction after review

* removed unnecessary screen

* refactored

* updated the testIDs

* Update Package.resolved

* refactor

* removed Mattermost as default server name

* fix ts

* refactored settings constant

* correction after review

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-05-19 08:47:49 -04:00

26 lines
887 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 {observeConfigValue} from '@queries/servers/system';
import {isValidUrl} from '@utils/url';
import Settings from './settings';
import type {WithDatabaseArgs} from '@typings/database/database';
const enhanced = withObservables([], ({database}: WithDatabaseArgs) => {
const siteName = observeConfigValue(database, 'SiteName');
const showHelp = observeConfigValue(database, 'HelpLink').pipe(switchMap((link) => of$(link ? isValidUrl(link) : false)));
return {
showHelp,
siteName,
};
});
export default withDatabase(enhanced(Settings));