diff --git a/app/components/block/index.tsx b/app/components/block/index.tsx
index 036474f33..f293c679f 100644
--- a/app/components/block/index.tsx
+++ b/app/components/block/index.tsx
@@ -20,13 +20,6 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
fontSize: 13,
color: changeOpacity(theme.centerChannelColor, 0.5),
},
- items: {
- backgroundColor: theme.centerChannelBg,
- borderTopWidth: 1,
- borderBottomWidth: 1,
- borderTopColor: changeOpacity(theme.centerChannelColor, 0.1),
- borderBottomColor: changeOpacity(theme.centerChannelColor, 0.1),
- },
footer: {
marginTop: 10,
marginHorizontal: 15,
@@ -36,13 +29,13 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
};
});
-type SectionText = {
+export type SectionText = {
id: string;
defaultMessage: string;
values?: MessageDescriptor;
}
-type SectionProps = {
+export type BlockProps = {
children: React.ReactNode;
disableFooter?: boolean;
disableHeader?: boolean;
@@ -62,7 +55,7 @@ const Block = ({
headerStyles,
headerText,
footerStyles,
-}: SectionProps) => {
+}: BlockProps) => {
const theme = useTheme();
const styles = getStyleSheet(theme);
@@ -76,7 +69,7 @@ const Block = ({
style={[styles.header, headerStyles]}
/>
}
-
+
{children}
{(footerText && !disableFooter) &&
diff --git a/app/components/common_post_options/base_option/index.tsx b/app/components/common_post_options/base_option/index.tsx
index 10f534229..c5d06f426 100644
--- a/app/components/common_post_options/base_option/index.tsx
+++ b/app/components/common_post_options/base_option/index.tsx
@@ -52,14 +52,13 @@ const BaseOption = ({
return (
);
};
diff --git a/app/components/menu_item/__snapshots__/index.test.tsx.snap b/app/components/menu_item/__snapshots__/index.test.tsx.snap
index 39d2569e3..3850e1731 100644
--- a/app/components/menu_item/__snapshots__/index.test.tsx.snap
+++ b/app/components/menu_item/__snapshots__/index.test.tsx.snap
@@ -110,10 +110,13 @@ exports[`DrawerItem should match snapshot 1`] = `
diff --git a/app/components/menu_item/index.tsx b/app/components/menu_item/index.tsx
index 8f34bffb0..44d43c664 100644
--- a/app/components/menu_item/index.tsx
+++ b/app/components/menu_item/index.tsx
@@ -7,6 +7,7 @@ import {Platform, StyleProp, TextStyle, View, ViewStyle} from 'react-native';
import CompassIcon from '@components/compass_icon';
import FormattedText from '@components/formatted_text';
import TouchableWithFeedback from '@components/touchable_with_feedback';
+import {useTheme} from '@context/theme';
import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme';
export const ITEM_HEIGHT = 50;
@@ -64,6 +65,7 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
export type MenuItemProps = {
centered?: boolean;
+ chevronStyle?: StyleProp;
containerStyle?: StyleProp;
defaultMessage?: string;
i18nId?: string;
@@ -78,24 +80,34 @@ export type MenuItemProps = {
onPress: () => void;
rightComponent?: ReactNode;
separator?: boolean;
+ separatorStyle?: StyleProp;
showArrow?: boolean;
testID: string;
- theme: Theme;
};
-const MenuItem = (props: MenuItemProps) => {
- const {
- centered, containerStyle, defaultMessage = '', i18nId, iconContainerStyle, iconName, isDestructor = false,
- isLink = false, labelComponent, labelStyle, leftComponent, messageValues, onPress, rightComponent,
- separator = true, showArrow = false, testID, theme,
- } = props;
-
+const MenuItem = ({
+ centered,
+ chevronStyle,
+ containerStyle,
+ defaultMessage = '',
+ i18nId,
+ iconContainerStyle,
+ iconName,
+ isDestructor = false,
+ isLink = false,
+ labelComponent,
+ labelStyle,
+ leftComponent,
+ messageValues,
+ onPress,
+ rightComponent,
+ separator = true,
+ separatorStyle,
+ showArrow = false,
+ testID,
+}: MenuItemProps) => {
+ const theme = useTheme();
const style = getStyleSheet(theme);
- const destructor: any = {};
- if (isDestructor) {
- destructor.color = theme.errorTextColor;
- }
-
let icon;
if (leftComponent) {
icon = leftComponent;
@@ -103,7 +115,7 @@ const MenuItem = (props: MenuItemProps) => {
icon = (
);
}
@@ -119,7 +131,7 @@ const MenuItem = (props: MenuItemProps) => {
style={[
style.label,
labelStyle,
- destructor,
+ isDestructor && {color: theme.errorTextColor},
centered ? style.centerLabel : {},
isLink && style.linkContainer,
]}
@@ -144,15 +156,15 @@ const MenuItem = (props: MenuItemProps) => {
{label}
+ {rightComponent}
{Boolean(showArrow) && (
)}
- {rightComponent}
- {Boolean(separator) && ()}
+ {Boolean(separator) && ()}
);
diff --git a/app/components/option_item/index.tsx b/app/components/option_item/index.tsx
index c68f176a0..a4e8a2743 100644
--- a/app/components/option_item/index.tsx
+++ b/app/components/option_item/index.tsx
@@ -2,15 +2,15 @@
// See LICENSE.txt for license information.
import React, {useCallback, useMemo} from 'react';
-import {Platform, StyleProp, Switch, Text, TouchableOpacity, View, ViewStyle} from 'react-native';
+import {Platform, StyleProp, Switch, Text, TextStyle, TouchableOpacity, View, ViewStyle} from 'react-native';
import CompassIcon from '@components/compass_icon';
import {useTheme} from '@context/theme';
import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme';
import {typography} from '@utils/typography';
-type Props = {
- action?: (value: string | boolean) => void;
+export type OptionItemProps = {
+ action?: (React.Dispatch>)|((value: string | boolean) => void) ;
description?: string;
inline?: boolean;
destructive?: boolean;
@@ -22,6 +22,8 @@ type Props = {
type: OptionType;
value?: string;
containerStyle?: StyleProp;
+ optionLabelTextStyle?: StyleProp;
+ optionDescriptionTextStyle?: StyleProp;
}
const OptionType = {
@@ -95,10 +97,21 @@ const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => {
});
const OptionItem = ({
- action, description, destructive, icon,
- info, inline = false, label, selected,
- testID = 'optionItem', type, value, containerStyle,
-}: Props) => {
+ action,
+ containerStyle,
+ description,
+ destructive,
+ icon,
+ info,
+ inline = false,
+ label,
+ optionDescriptionTextStyle,
+ optionLabelTextStyle,
+ selected,
+ testID = 'optionItem',
+ type,
+ value,
+}: OptionItemProps) => {
const theme = useTheme();
const styles = getStyleSheet(theme);
@@ -181,14 +194,14 @@ const OptionItem = ({
)}
{label}
{Boolean(description) &&
{description}
@@ -199,10 +212,11 @@ const OptionItem = ({
{Boolean(actionComponent || info) &&
- {Boolean(info) &&
-
- {info}
-
+ {
+ Boolean(info) &&
+
+ {info}
+
}
{actionComponent}
diff --git a/app/constants/screens.ts b/app/constants/screens.ts
index de537b977..afc5ff1f9 100644
--- a/app/constants/screens.ts
+++ b/app/constants/screens.ts
@@ -49,6 +49,7 @@ export const SETTINGS_DISPLAY_TIMEZONE = 'SettingsDisplayTimezone';
export const SETTINGS_DISPLAY_TIMEZONE_SELECT = 'SettingsDisplayTimezoneSelect';
export const SETTINGS_NOTIFICATION = 'SettingsNotification';
export const SETTINGS_NOTIFICATION_AUTO_RESPONDER = 'SettingsNotificationAutoResponder';
+export const SETTINGS_NOTIFICATION_EMAIL = 'SettingsNotificationEmail';
export const SETTINGS_NOTIFICATION_MENTION = 'SettingsNotificationMention';
export const SETTINGS_NOTIFICATION_PUSH = 'SettingsNotificationPush';
export const SNACK_BAR = 'SnackBar';
@@ -108,6 +109,7 @@ export default {
SETTINGS_DISPLAY_TIMEZONE_SELECT,
SETTINGS_NOTIFICATION,
SETTINGS_NOTIFICATION_AUTO_RESPONDER,
+ SETTINGS_NOTIFICATION_EMAIL,
SETTINGS_NOTIFICATION_MENTION,
SETTINGS_NOTIFICATION_PUSH,
SNACK_BAR,
diff --git a/app/screens/home/account/components/options/custom_status/index.tsx b/app/screens/home/account/components/options/custom_status/index.tsx
index 4e9b84582..bde92e0e2 100644
--- a/app/screens/home/account/components/options/custom_status/index.tsx
+++ b/app/screens/home/account/components/options/custom_status/index.tsx
@@ -88,7 +88,6 @@ const CustomStatus = ({isCustomStatusExpirySupported, isTablet, currentUser}: Cu
/>}
separator={false}
onPress={goToCustomStatusScreen}
- theme={theme}
/>
);
};
diff --git a/app/screens/home/account/components/options/index.tsx b/app/screens/home/account/components/options/index.tsx
index 6c468ceec..587b38952 100644
--- a/app/screens/home/account/components/options/index.tsx
+++ b/app/screens/home/account/components/options/index.tsx
@@ -89,7 +89,6 @@ const AccountOptions = ({user, enableCustomUserStatuses, isCustomStatusExpirySup
{
return (
)}
- iconName='exit-to-app'
- isDestructor={true}
onPress={onLogout}
separator={false}
- theme={theme}
+ testID='account.logout.action'
/>
);
};
diff --git a/app/screens/home/account/components/options/settings/index.tsx b/app/screens/home/account/components/options/settings/index.tsx
index 5a7804e5b..e2134be8a 100644
--- a/app/screens/home/account/components/options/settings/index.tsx
+++ b/app/screens/home/account/components/options/settings/index.tsx
@@ -15,10 +15,9 @@ import {preventDoubleTap} from '@utils/tap';
type Props = {
isTablet: boolean;
style: TextStyle;
- theme: Theme;
}
-const Settings = ({isTablet, style, theme}: Props) => {
+const Settings = ({isTablet, style}: Props) => {
const intl = useIntl();
const openSettings = useCallback(preventDoubleTap(() => {
@@ -34,7 +33,7 @@ const Settings = ({isTablet, style, theme}: Props) => {
return (