mattermost-mobile/app/screens/settings/notification_push/push_thread.tsx
Avinash Lingaloo 431406f09b
MM-45221 - Gekidou Settings fixes - part 1 (#6472)
* modifying setting option

* navigates to email screen

* UI construction [in progress]

* hooking up withObservables

* email settings - need to save now

* adding a bit of paddings

* setting initial value

* Update notification_email.tsx

* UI Polish - main setting screen

* UI Polish - Mention

* UI Polish - Notification main screen

* code clean up

* code clean up

* UI Polish Notification

* UI Polish

* code clean up

* UI Polish - OOO

* fix observable for email interval

* fix ooo

* fix ooo

* added setting_row_label component

* further clean up

* UI Polish - Display - [ IN PROGRESS ]

* UI Polish - Display - [ IN PROGRESS ]

* UI Polish - Timezone Select [ IN PROGRESS ]

* Update index.test.tsx.snap

* Update app/screens/settings/notification_email/notification_email.tsx

Co-authored-by: Daniel Espino García <larkox@gmail.com>

* refactor after review

* update option_item so that action can accept type React.Dispatch<React.SetStateAction

Co-authored-by: Daniel Espino García <larkox@gmail.com>
2022-07-15 13:32:25 +04:00

54 lines
1.6 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react';
import {useIntl} from 'react-intl';
import {StyleSheet} from 'react-native';
import {t} from '@i18n';
import SettingBlock from '../setting_block';
import SettingOption from '../setting_option';
import SettingSeparator from '../settings_separator';
const styles = StyleSheet.create({
area: {
paddingHorizontal: 16,
},
});
const headerText = {
id: t('notification_settings.push_threads'),
defaultMessage: 'Thread reply notifications',
};
const footerText = {
id: t('notification_settings.push_threads.info'),
defaultMessage: 'When enabled, any reply to a thread you\'re following will send a mobile push notification',
};
type MobilePushThreadProps = {
onMobilePushThreadChanged: (status: string) => void;
pushThread: PushStatus;
}
const MobilePushThread = ({pushThread, onMobilePushThreadChanged}: MobilePushThreadProps) => {
const intl = useIntl();
return (
<SettingBlock
headerText={headerText}
footerText={footerText}
containerStyles={styles.area}
>
<SettingOption
action={onMobilePushThreadChanged}
label={intl.formatMessage({id: 'notification_settings.push_threads.description', defaultMessage: 'Notify me about all replies to threads I\'m following'})}
selected={pushThread === 'all'}
type='toggle'
/>
<SettingSeparator/>
</SettingBlock>
);
};
export default MobilePushThread;