diff --git a/native/chat/settings/thread-settings-notifications.react.js b/native/chat/settings/thread-settings-notifications.react.js
--- a/native/chat/settings/thread-settings-notifications.react.js
+++ b/native/chat/settings/thread-settings-notifications.react.js
@@ -1,15 +1,16 @@
// @flow
import * as React from 'react';
-import { View } from 'react-native';
+import { View, Text } from 'react-native';
import { useThreadSettingsNotifications } from 'lib/shared/thread-settings-notifications-utils.js';
import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import EnumSettingsOption from '../../components/enum-settings-option.react.js';
+import SWMansionIcon from '../../components/swmansion-icon.react.js';
import HeaderRightTextButton from '../../navigation/header-right-text-button.react.js';
import type { NavigationRoute } from '../../navigation/route-names.js';
-import { useStyles } from '../../themes/colors.js';
+import { useStyles, useColors } from '../../themes/colors.js';
import AllNotifsIllustration from '../../vectors/all-notifs-illustration.react.js';
import BadgeNotifsIllustration from '../../vectors/badge-notifs-illustration.react.js';
import MutedNotifsIllustration from '../../vectors/muted-notifs-illustration.react.js';
@@ -19,6 +20,112 @@
+threadInfo: ThreadInfo,
};
+type NotificationDescriptionProps = {
+ +bannerNotifsEnabled: boolean,
+ +badgeCountEnabled: boolean,
+ +livesInFocusedTab: boolean,
+};
+
+function NotificationDescription(
+ props: NotificationDescriptionProps,
+): React.Node {
+ const { bannerNotifsEnabled, badgeCountEnabled, livesInFocusedTab } = props;
+
+ const styles = useStyles(unboundStyles);
+ const colors = useColors();
+
+ const bannerNotifsDescriptionTextStyles = React.useMemo(() => {
+ const style = [styles.notificationOptionDescriptionText];
+
+ if (!bannerNotifsEnabled) {
+ style.push(styles.notificationOptionDescriptionTextDisabled);
+ }
+
+ return style;
+ }, [
+ bannerNotifsEnabled,
+ styles.notificationOptionDescriptionText,
+ styles.notificationOptionDescriptionTextDisabled,
+ ]);
+
+ const badgeCountDescriptionTextStyles = React.useMemo(() => {
+ const style = [styles.notificationOptionDescriptionText];
+
+ if (!badgeCountEnabled) {
+ style.push(styles.notificationOptionDescriptionTextDisabled);
+ }
+
+ return style;
+ }, [
+ badgeCountEnabled,
+ styles.notificationOptionDescriptionText,
+ styles.notificationOptionDescriptionTextDisabled,
+ ]);
+
+ return (
+ <>
+
+
+ Banner notifs
+
+
+
+ Badge count
+
+
+
+
+ Lives in {livesInFocusedTab ? 'Focused' : 'Background'} tab
+
+
+ >
+ );
+}
+
+const allNotificationsDescription = (
+
+);
+
+const badgeOnlyDescription = (
+
+);
+
+const mutedDescription = (
+
+);
+
type Props = {
+navigation: ChatNavigationProp<'ThreadSettingsNotifications'>,
+route: NavigationRoute<'ThreadSettingsNotifications'>,
@@ -89,7 +196,7 @@
name="Focused (enabled)"
enumValue={notificationSettings === 'focused'}
onEnumValuePress={onFocusedSelected}
- description=""
+ description={allNotificationsDescription}
icon={allNotificationsIllustration}
/>
@@ -98,7 +205,7 @@
name="Focused (badge only)"
enumValue={notificationSettings === 'badge-only'}
onEnumValuePress={onBadgeOnlySelected}
- description=""
+ description={badgeOnlyDescription}
icon={badgeOnlyIllustration}
/>
@@ -107,7 +214,7 @@
name="Background"
enumValue={notificationSettings === 'background'}
onEnumValuePress={onBackgroundSelected}
- description=""
+ description={mutedDescription}
icon={mutedIllustration}
/>
@@ -124,6 +231,20 @@
justifyContent: 'center',
paddingHorizontal: 16,
},
+ notificationOptionDescriptionListItem: {
+ flexDirection: 'row',
+ alignItems: 'center',
+ marginTop: 4,
+ },
+ notificationOptionDescriptionText: {
+ color: 'panelForegroundSecondaryLabel',
+ marginLeft: 4,
+ fontSize: 12,
+ },
+ notificationOptionDescriptionTextDisabled: {
+ textDecorationLine: 'line-through',
+ color: 'panelSecondaryForeground',
+ },
};
export default ThreadSettingsNotifications;
diff --git a/native/components/enum-settings-option.react.js b/native/components/enum-settings-option.react.js
--- a/native/components/enum-settings-option.react.js
+++ b/native/components/enum-settings-option.react.js
@@ -11,7 +11,7 @@
type EnumSettingsOptionProps = {
+icon?: string | React.Node,
+name: string,
- +description: string,
+ +description: string | React.Node,
+enumValue: boolean,
+onEnumValuePress: () => mixed,
+type?: InputType,
@@ -82,12 +82,20 @@
[enumValue, enumInputFilledStyles],
);
+ const descriptionElement = React.useMemo(() => {
+ if (typeof description === 'string') {
+ return {description};
+ }
+
+ return description;
+ }, [description, styles.enumInfoDescription]);
+
return (
{enumIcon}
{name}
- {description}
+ {descriptionElement}