* MM-10193 for landscape Feature Commit for MM-10193 to the landscape feature with latest pull. This is the initial commit with SafeAreaView in place, but should not be merged into master as this is step one and not suitable for production. Another commit will be following with adjustments to allow SafeAreaView to display correctly for users. * MM-10193 for landscape Feature Commit for MM-10193 to the landscape feature with latest pull. This is the initial commit with SafeAreaView in place, but should not be merged into master as this is step one and not suitable for production. Another commit will be following with adjustments to allow SafeAreaView to display correctly for users. * MM-10193 Extend design elements for iPhoneX SafeAreaViews This is the second portion of the MM-10193 changes for the landscape feature. This item was to extend the design elements for the application into the SafeAreaView so the application looks uniform on the iPhoneX. * MM-10193 Patch for Snapshot tests and eslint * MM-10193 Re-Patch These chanbes mistakenly got reverted from last Patch * MM-10193 Updates for PR Fixed the 4 screens from the text box that were missed. Updated the padding to run from a method. * Revert "MM-10193 Updates for PR" This reverts commit fe8d650ce3ca2828d8c94e4af470649aa2582ec1. * MM-10193 Updates for PR This reverts commit 4966d83d5401720d26ca22a55cf8f92f1657b7e2. Applied Updated Snapshots * MM-10193 Updated Modifier for iphone_x_spacing Updated Modifier for iphone_x_spacing * MM-10193 Updates for Review Review changes for Post Textbox and a few states that were unavailable. * MM-10193 Fix Longpress padding Fixed longpress padding for Channel Info and Edit Post views. * MM-10193 Update isLandscape Updated isLandscape to pull directly from dimensions. Updated padding for Recent Mentions and Flagged Posts. * MM-10193 Updates for review longpost Updated for longpost padding. Fixed issue with notifications not padding right correctly. * MM-10193 Update with Cleanup Reverted Cocoapods back to 1.5.3. Cleaned up spacing in two files. * MM-10193 Merge Conflict Updates Updates to resolve merge conflicts
170 lines
6.6 KiB
JavaScript
170 lines
6.6 KiB
JavaScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import React from 'react';
|
|
|
|
import {
|
|
ScrollView,
|
|
View,
|
|
} from 'react-native';
|
|
import {Preferences} from 'mattermost-redux/constants';
|
|
|
|
import FormattedText from 'app/components/formatted_text';
|
|
import StatusBar from 'app/components/status_bar';
|
|
import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme';
|
|
import {t} from 'app/utils/i18n';
|
|
import {paddingHorizontal as padding} from 'app/components/safe_area_view/iphone_x_spacing';
|
|
import Section from 'app/screens/settings/section';
|
|
import SectionItem from 'app/screens/settings/section_item';
|
|
|
|
import NotificationSettingsEmailBase from './notification_settings_email_base';
|
|
|
|
class NotificationSettingsEmailIos extends NotificationSettingsEmailBase {
|
|
renderEmailSection() {
|
|
const {
|
|
enableEmailBatching,
|
|
sendEmailNotifications,
|
|
siteName,
|
|
theme,
|
|
isLandscape,
|
|
} = this.props;
|
|
const {newInterval} = this.state;
|
|
const style = getStyleSheet(theme);
|
|
|
|
return (
|
|
<Section
|
|
headerId={t('mobile.notification_settings.email.send')}
|
|
headerDefaultMessage='SEND EMAIL NOTIFICATIONS'
|
|
footerId={t('user.settings.notifications.emailInfo')}
|
|
footerDefaultMessage='Email notifications are sent for mentions and direct messages when you are offline or away from {siteName} for more than 5 minutes.'
|
|
footerValues={{siteName}}
|
|
disableFooter={!sendEmailNotifications}
|
|
theme={theme}
|
|
isLandscape={isLandscape}
|
|
>
|
|
{sendEmailNotifications &&
|
|
<View>
|
|
<SectionItem
|
|
label={(
|
|
<FormattedText
|
|
id='user.settings.notifications.email.immediately'
|
|
defaultMessage='Immediately'
|
|
/>
|
|
)}
|
|
action={this.setEmailInterval}
|
|
actionType='select'
|
|
actionValue={Preferences.INTERVAL_IMMEDIATE.toString()}
|
|
selected={newInterval === Preferences.INTERVAL_IMMEDIATE.toString()}
|
|
theme={theme}
|
|
isLandscape={isLandscape}
|
|
/>
|
|
<View style={style.separator}/>
|
|
{enableEmailBatching &&
|
|
<View>
|
|
<SectionItem
|
|
label={(
|
|
<FormattedText
|
|
id='mobile.user.settings.notifications.email.fifteenMinutes'
|
|
defaultMessage='Every 15 minutes'
|
|
/>
|
|
)}
|
|
action={this.setEmailInterval}
|
|
actionType='select'
|
|
actionValue={Preferences.INTERVAL_FIFTEEN_MINUTES.toString()}
|
|
selected={newInterval === Preferences.INTERVAL_FIFTEEN_MINUTES.toString()}
|
|
theme={theme}
|
|
isLandscape={isLandscape}
|
|
/>
|
|
<View style={style.separator}/>
|
|
<SectionItem
|
|
label={(
|
|
<FormattedText
|
|
id='user.settings.notifications.email.everyHour'
|
|
defaultMessage='Every hour'
|
|
/>
|
|
)}
|
|
action={this.setEmailInterval}
|
|
actionType='select'
|
|
actionValue={Preferences.INTERVAL_HOUR.toString()}
|
|
selected={newInterval === Preferences.INTERVAL_HOUR.toString()}
|
|
theme={theme}
|
|
isLandscape={isLandscape}
|
|
/>
|
|
<View style={style.separator}/>
|
|
</View>
|
|
}
|
|
<SectionItem
|
|
label={(
|
|
<FormattedText
|
|
id='user.settings.notifications.email.never'
|
|
defaultMessage='Never'
|
|
/>
|
|
)}
|
|
action={this.setEmailInterval}
|
|
actionType='select'
|
|
actionValue={Preferences.INTERVAL_NEVER.toString()}
|
|
selected={newInterval === Preferences.INTERVAL_NEVER.toString()}
|
|
theme={theme}
|
|
isLandscape={isLandscape}
|
|
/>
|
|
</View>
|
|
}
|
|
{!sendEmailNotifications &&
|
|
<FormattedText
|
|
id='user.settings.general.emailHelp2'
|
|
defaultMessage='Email has been disabled by your System Administrator. No notification emails will be sent until it is enabled.'
|
|
style={[style.disabled, padding(isLandscape)]}
|
|
/>
|
|
}
|
|
</Section>
|
|
);
|
|
}
|
|
|
|
render() {
|
|
const {theme} = this.props;
|
|
const style = getStyleSheet(theme);
|
|
|
|
return (
|
|
<View style={style.container}>
|
|
<StatusBar/>
|
|
<ScrollView
|
|
style={style.scrollView}
|
|
contentContainerStyle={style.scrollViewContent}
|
|
alwaysBounceVertical={false}
|
|
>
|
|
{this.renderEmailSection()}
|
|
</ScrollView>
|
|
</View>
|
|
);
|
|
}
|
|
}
|
|
|
|
const getStyleSheet = makeStyleSheetFromTheme((theme) => {
|
|
return {
|
|
container: {
|
|
flex: 1,
|
|
backgroundColor: theme.centerChannelBg,
|
|
},
|
|
separator: {
|
|
backgroundColor: changeOpacity(theme.centerChannelColor, 0.1),
|
|
flex: 1,
|
|
height: 1,
|
|
marginLeft: 15,
|
|
},
|
|
scrollView: {
|
|
flex: 1,
|
|
backgroundColor: changeOpacity(theme.centerChannelColor, 0.06),
|
|
},
|
|
scrollViewContent: {
|
|
paddingVertical: 35,
|
|
},
|
|
disabled: {
|
|
color: theme.centerChannelColor,
|
|
fontSize: 15,
|
|
paddingHorizontal: 15,
|
|
paddingVertical: 10,
|
|
},
|
|
};
|
|
});
|
|
|
|
export default NotificationSettingsEmailIos;
|