@planningcenter/chat-react-native 3.35.0-rc.3 → 3.35.0-rc.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/build/components/conversation/jump_to_bottom_button.d.ts +2 -1
- package/build/components/conversation/jump_to_bottom_button.d.ts.map +1 -1
- package/build/components/conversation/jump_to_bottom_button.js +39 -7
- package/build/components/conversation/jump_to_bottom_button.js.map +1 -1
- package/build/components/conversation/reply_shadow_message.d.ts +1 -2
- package/build/components/conversation/reply_shadow_message.d.ts.map +1 -1
- package/build/components/conversation/reply_shadow_message.js.map +1 -1
- package/build/components/conversation/unread_divider.d.ts +6 -0
- package/build/components/conversation/unread_divider.d.ts.map +1 -0
- package/build/components/conversation/unread_divider.js +59 -0
- package/build/components/conversation/unread_divider.js.map +1 -0
- package/build/contexts/conversation_context.d.ts +2 -0
- package/build/contexts/conversation_context.d.ts.map +1 -1
- package/build/contexts/conversation_context.js +13 -5
- package/build/contexts/conversation_context.js.map +1 -1
- package/build/hooks/use_conversation_messages.d.ts +2 -0
- package/build/hooks/use_conversation_messages.d.ts.map +1 -1
- package/build/hooks/use_conversation_messages.js +9 -5
- package/build/hooks/use_conversation_messages.js.map +1 -1
- package/build/hooks/use_conversation_messages_jolt_events.d.ts.map +1 -1
- package/build/hooks/use_conversation_messages_jolt_events.js +4 -4
- package/build/hooks/use_conversation_messages_jolt_events.js.map +1 -1
- package/build/hooks/use_conversations_actions.d.ts +5 -0
- package/build/hooks/use_conversations_actions.d.ts.map +1 -1
- package/build/hooks/use_conversations_actions.js +12 -0
- package/build/hooks/use_conversations_actions.js.map +1 -1
- package/build/hooks/use_flat_list_viewability.d.ts +20 -0
- package/build/hooks/use_flat_list_viewability.d.ts.map +1 -0
- package/build/hooks/use_flat_list_viewability.js +30 -0
- package/build/hooks/use_flat_list_viewability.js.map +1 -0
- package/build/hooks/use_jump_to_bottom_action.d.ts +9 -0
- package/build/hooks/use_jump_to_bottom_action.d.ts.map +1 -0
- package/build/hooks/use_jump_to_bottom_action.js +62 -0
- package/build/hooks/use_jump_to_bottom_action.js.map +1 -0
- package/build/hooks/use_jump_to_unread_anchor.d.ts +20 -0
- package/build/hooks/use_jump_to_unread_anchor.d.ts.map +1 -0
- package/build/hooks/use_jump_to_unread_anchor.js +53 -0
- package/build/hooks/use_jump_to_unread_anchor.js.map +1 -0
- package/build/hooks/use_jump_to_unread_gates.d.ts +5 -0
- package/build/hooks/use_jump_to_unread_gates.d.ts.map +1 -0
- package/build/hooks/use_jump_to_unread_gates.js +10 -0
- package/build/hooks/use_jump_to_unread_gates.js.map +1 -0
- package/build/hooks/use_mark_latest_message_read.d.ts +1 -1
- package/build/hooks/use_mark_latest_message_read.d.ts.map +1 -1
- package/build/hooks/use_mark_latest_message_read.js +17 -1
- package/build/hooks/use_mark_latest_message_read.js.map +1 -1
- package/build/hooks/use_scroll_tracking.d.ts +13 -0
- package/build/hooks/use_scroll_tracking.d.ts.map +1 -0
- package/build/hooks/use_scroll_tracking.js +45 -0
- package/build/hooks/use_scroll_tracking.js.map +1 -0
- package/build/hooks/use_track_highest_seen_message.d.ts +4 -0
- package/build/hooks/use_track_highest_seen_message.d.ts.map +1 -0
- package/build/hooks/use_track_highest_seen_message.js +35 -0
- package/build/hooks/use_track_highest_seen_message.js.map +1 -0
- package/build/navigation/index.d.ts.map +1 -1
- package/build/screens/conversation_screen.d.ts.map +1 -1
- package/build/screens/conversation_screen.js +87 -44
- package/build/screens/conversation_screen.js.map +1 -1
- package/build/screens/group_notification_settings_screen.d.ts.map +1 -1
- package/build/screens/group_notification_settings_screen.js +6 -3
- package/build/screens/group_notification_settings_screen.js.map +1 -1
- package/build/screens/notification_settings_screen.js +2 -2
- package/build/screens/notification_settings_screen.js.map +1 -1
- package/build/screens/preferred_app_selection_screen.js +3 -3
- package/build/screens/preferred_app_selection_screen.js.map +1 -1
- package/build/utils/cache/messages_cache.d.ts +1 -0
- package/build/utils/cache/messages_cache.d.ts.map +1 -1
- package/build/utils/cache/messages_cache.js +4 -0
- package/build/utils/cache/messages_cache.js.map +1 -1
- package/build/utils/group_messages.d.ts +9 -2
- package/build/utils/group_messages.d.ts.map +1 -1
- package/build/utils/group_messages.js +20 -1
- package/build/utils/group_messages.js.map +1 -1
- package/build/utils/highest_seen_tracker.d.ts +12 -0
- package/build/utils/highest_seen_tracker.d.ts.map +1 -0
- package/build/utils/highest_seen_tracker.js +37 -0
- package/build/utils/highest_seen_tracker.js.map +1 -0
- package/build/utils/message_viewability.d.ts +24 -0
- package/build/utils/message_viewability.d.ts.map +1 -0
- package/build/utils/message_viewability.js +29 -0
- package/build/utils/message_viewability.js.map +1 -0
- package/build/utils/unread_divider_helpers.d.ts +18 -0
- package/build/utils/unread_divider_helpers.d.ts.map +1 -0
- package/build/utils/unread_divider_helpers.js +13 -0
- package/build/utils/unread_divider_helpers.js.map +1 -0
- package/package.json +10 -4
- package/src/__tests__/contexts/session_context.tsx +1 -1
- package/src/__tests__/hooks/use_async_storage.test.tsx +1 -1
- package/src/__tests__/hooks/use_attachment_uploader.test.tsx +1 -1
- package/src/__tests__/hooks/use_chat_configuration.test.tsx +1 -1
- package/src/__tests__/hooks/use_conversation_messages.test.tsx +1 -1
- package/src/__tests__/hooks/use_mark_latest_message_read.test.tsx +154 -0
- package/src/__tests__/utils/cache/messages_cache.test.ts +54 -0
- package/src/components/conversation/jump_to_bottom_button.tsx +57 -8
- package/src/components/conversation/reply_shadow_message.tsx +4 -2
- package/src/components/conversation/unread_divider.tsx +90 -0
- package/src/contexts/conversation_context.tsx +15 -13
- package/src/hooks/use_conversation_messages.ts +19 -3
- package/src/hooks/use_conversation_messages_jolt_events.ts +4 -3
- package/src/hooks/use_conversations_actions.ts +15 -0
- package/src/hooks/use_flat_list_viewability.ts +50 -0
- package/src/hooks/use_jump_to_bottom_action.ts +75 -0
- package/src/hooks/use_jump_to_unread_anchor.ts +68 -0
- package/src/hooks/use_jump_to_unread_gates.ts +10 -0
- package/src/hooks/use_mark_latest_message_read.ts +16 -2
- package/src/hooks/use_scroll_tracking.ts +64 -0
- package/src/hooks/use_track_highest_seen_message.ts +43 -0
- package/src/screens/conversation_screen.tsx +173 -70
- package/src/screens/group_notification_settings_screen.tsx +6 -3
- package/src/screens/notification_settings_screen.tsx +2 -2
- package/src/screens/preferred_app_selection_screen.tsx +3 -3
- package/src/utils/__tests__/group_messages.test.ts +71 -0
- package/src/utils/__tests__/highest_seen_tracker.test.ts +82 -0
- package/src/utils/__tests__/message_viewability.test.ts +168 -0
- package/src/utils/__tests__/unread_divider_helpers.test.ts +85 -0
- package/src/utils/cache/messages_cache.ts +5 -0
- package/src/utils/group_messages.ts +42 -2
- package/src/utils/highest_seen_tracker.ts +42 -0
- package/src/utils/message_viewability.ts +49 -0
- package/src/utils/unread_divider_helpers.ts +25 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { date as formatDate } from '@planningcenter/datetime-fmt';
|
|
2
2
|
import { HeaderTitle, PlatformPressable } from '@react-navigation/elements';
|
|
3
3
|
import { CommonActions, useNavigation, useTheme as useNavigationTheme, useRoute, } from '@react-navigation/native';
|
|
4
|
-
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
5
|
-
import { FlatList, Platform, StyleSheet, View } from 'react-native';
|
|
4
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
5
|
+
import { ActivityIndicator, FlatList, Platform, StyleSheet, View } from 'react-native';
|
|
6
|
+
import Animated, { FadeIn, FadeOut } from 'react-native-reanimated';
|
|
6
7
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
7
8
|
import { Badge, Icon, Text } from '../components';
|
|
8
9
|
import { EmptyConversationBlankState } from '../components/conversation/empty_conversation_blank_state';
|
|
@@ -13,21 +14,31 @@ import { LeaderMessagesDisabledBanner, MemberMessagesDisabledBanner, } from '../
|
|
|
13
14
|
import { ReplyShadowMessage } from '../components/conversation/reply_shadow_message';
|
|
14
15
|
import { SystemMessage } from '../components/conversation/system_message';
|
|
15
16
|
import { TypingIndicator } from '../components/conversation/typing_indicator';
|
|
17
|
+
import { UnreadDivider } from '../components/conversation/unread_divider';
|
|
16
18
|
import { KeyboardView } from '../components/display/keyboard_view';
|
|
17
19
|
import BlankState from '../components/primitive/blank_state_primitive';
|
|
18
|
-
import { ConversationContextProvider } from '../contexts/conversation_context';
|
|
20
|
+
import { ConversationContextProvider, useConversationContext, } from '../contexts/conversation_context';
|
|
19
21
|
import { useTheme } from '../hooks';
|
|
20
22
|
import { useConversation } from '../hooks/use_conversation';
|
|
21
23
|
import { useConversationJoltEvents } from '../hooks/use_conversation_jolt_events';
|
|
22
24
|
import { useConversationMessages } from '../hooks/use_conversation_messages';
|
|
23
25
|
import { useConversationMessagesJoltEvents } from '../hooks/use_conversation_messages_jolt_events';
|
|
24
26
|
import { useFeatures } from '../hooks/use_features';
|
|
27
|
+
import { useFlatListViewability } from '../hooks/use_flat_list_viewability';
|
|
28
|
+
import { useJumpToBottomAction } from '../hooks/use_jump_to_bottom_action';
|
|
29
|
+
import { useJumpToUnreadAnchor } from '../hooks/use_jump_to_unread_anchor';
|
|
30
|
+
import { useJumpToUnreadGates } from '../hooks/use_jump_to_unread_gates';
|
|
25
31
|
import { useMarkLatestMessageRead } from '../hooks/use_mark_latest_message_read';
|
|
26
32
|
import { normalizeAnalyticsMetadata, usePublishProductAnalyticsEvent, } from '../hooks/use_product_analytics';
|
|
33
|
+
import { useScrollTracking } from '../hooks/use_scroll_tracking';
|
|
34
|
+
import { useTrackHighestSeenMessage } from '../hooks/use_track_highest_seen_message';
|
|
27
35
|
import { getRelativeDateStatus } from '../utils/date';
|
|
28
|
-
import { groupMessages } from '../utils/group_messages';
|
|
36
|
+
import { groupMessages, UNREAD_DIVIDER_KEY, } from '../utils/group_messages';
|
|
37
|
+
import { detectDividerExitTowardNewer, reportViewableMessages, } from '../utils/message_viewability';
|
|
29
38
|
import { CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL } from '../utils/styles';
|
|
30
39
|
import { isSystemMessage } from '../utils/system_messages';
|
|
40
|
+
const extractItemKey = (item) => String(item.id);
|
|
41
|
+
const maintainVisibleContentPosition = { minIndexForVisible: 0 };
|
|
31
42
|
export function ConversationScreen({ route }) {
|
|
32
43
|
const { conversation_id, message_id, reply_root_id } = route.params;
|
|
33
44
|
const { data: conversation } = useConversation({ conversation_id });
|
|
@@ -37,7 +48,7 @@ export function ConversationScreen({ route }) {
|
|
|
37
48
|
...normalizeAnalyticsMetadata(conversation),
|
|
38
49
|
});
|
|
39
50
|
const lastReadMessageSortKey = conversation.conversationMembership?.lastReadMessageSortKey ?? null;
|
|
40
|
-
const jumpToUnreadAnchor = featureEnabled('jump_to_unread') ? lastReadMessageSortKey : null;
|
|
51
|
+
const jumpToUnreadAnchor = featureEnabled('jump_to_unread') && !reply_root_id ? lastReadMessageSortKey : null;
|
|
41
52
|
const initialMessageId = message_id ?? jumpToUnreadAnchor;
|
|
42
53
|
const initialMessageIdIsAnchor = !!initialMessageId && !message_id;
|
|
43
54
|
return (<ConversationContextProvider conversationId={conversation_id} currentPageReplyRootId={reply_root_id ?? null} initialMessageId={initialMessageId} initialMessageIdIsAnchor={initialMessageIdIsAnchor}>
|
|
@@ -47,45 +58,84 @@ export function ConversationScreen({ route }) {
|
|
|
47
58
|
function ConversationScreenContent({ route }) {
|
|
48
59
|
const styles = useStyles();
|
|
49
60
|
const navigation = useNavigation();
|
|
50
|
-
const { conversation_id, editing_message_id, reply_root_id, reply_root_author_name } = route.params;
|
|
61
|
+
const { conversation_id: conversationId, editing_message_id: editingMessageId, reply_root_id: replyRootId, reply_root_author_name: replyRootAuthorName, } = route.params;
|
|
51
62
|
const { data: conversation } = useConversation(route.params);
|
|
52
|
-
const { messages,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
useConversationMessagesJoltEvents({ conversationId: conversation_id });
|
|
63
|
+
const { messages, fetchOlderMessages, fetchNewerMessages, hasMoreNewerMessages, isFetchingNewerMessages, cancelFetchNewerMessages, } = useConversationMessages({ conversation_id: conversationId, reply_root_id: replyRootId });
|
|
64
|
+
const { jumpToUnreadActive } = useJumpToUnreadGates();
|
|
65
|
+
const { initialMessageId } = useConversationContext();
|
|
66
|
+
useConversationJoltEvents({ conversationId });
|
|
67
|
+
useConversationMessagesJoltEvents({ conversationId });
|
|
58
68
|
useEnsureConversationsRouteExists();
|
|
59
69
|
useMarkLatestMessageRead({ conversation, messages });
|
|
60
|
-
const
|
|
70
|
+
const { onMessageSeen } = useTrackHighestSeenMessage();
|
|
71
|
+
const items = useMemo(() => groupMessages({
|
|
61
72
|
ms: messages,
|
|
62
|
-
inReplyScreen: !!
|
|
63
|
-
|
|
64
|
-
|
|
73
|
+
inReplyScreen: !!replyRootId,
|
|
74
|
+
jumpToUnreadActive,
|
|
75
|
+
initialMessageId,
|
|
76
|
+
}), [messages, replyRootId, jumpToUnreadActive, initialMessageId]);
|
|
77
|
+
const noMessages = items.length === 0;
|
|
65
78
|
const { repliesDisabled, memberAbility, badges, title } = conversation;
|
|
66
79
|
const canReply = memberAbility?.canReply;
|
|
67
80
|
const showLeaderDisabledReplyBanner = canReply && repliesDisabled;
|
|
68
81
|
const canDeleteNonAuthoredMessages = memberAbility?.canDeleteNonAuthoredMessages ?? false;
|
|
69
|
-
const currentlyEditingMessage = messages.find(m => String(m.id) === String(
|
|
70
|
-
const replyRootAuthorFirstName =
|
|
82
|
+
const currentlyEditingMessage = messages.find(m => String(m.id) === String(editingMessageId));
|
|
83
|
+
const replyRootAuthorFirstName = replyRootAuthorName?.split(' ')[0];
|
|
71
84
|
const replyHeaderTitle = replyRootAuthorFirstName
|
|
72
85
|
? `Reply to ${replyRootAuthorFirstName}`
|
|
73
86
|
: 'Reply';
|
|
74
87
|
// Prefer the membership for optimistic updates.
|
|
75
88
|
const muted = conversation.conversationMembership?.muted ?? conversation.muted;
|
|
76
89
|
const listRef = useRef(null);
|
|
77
|
-
const [
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
90
|
+
const [dividerScrolledPast, setDividerScrolledPast] = useState(false);
|
|
91
|
+
const observers = useMemo(() => [
|
|
92
|
+
reportViewableMessages(onMessageSeen),
|
|
93
|
+
detectDividerExitTowardNewer({
|
|
94
|
+
dividerKey: UNREAD_DIVIDER_KEY,
|
|
95
|
+
initialMessageId,
|
|
96
|
+
onExited: () => setDividerScrolledPast(true),
|
|
97
|
+
}),
|
|
98
|
+
], [onMessageSeen, initialMessageId]);
|
|
99
|
+
const { viewabilityConfigCallbackPairs, onScrollBeginDrag: viewabilityOnScrollBeginDrag } = useFlatListViewability({ observers });
|
|
100
|
+
const { onContentSizeChange, onScrollToIndexFailed, onScrollBeginDrag: anchorOnScrollBeginDrag, } = useJumpToUnreadAnchor({ listRef, items });
|
|
101
|
+
const onScrollBeginDrag = useCallback(() => {
|
|
102
|
+
viewabilityOnScrollBeginDrag();
|
|
103
|
+
anchorOnScrollBeginDrag();
|
|
104
|
+
}, [viewabilityOnScrollBeginDrag, anchorOnScrollBeginDrag]);
|
|
105
|
+
const { onScroll, showJumpToBottomButton } = useScrollTracking({
|
|
106
|
+
hasMoreNewerMessages,
|
|
107
|
+
isFetchingNewerMessages,
|
|
108
|
+
fetchNewerMessages,
|
|
109
|
+
cancelFetchNewerMessages,
|
|
110
|
+
});
|
|
111
|
+
const { handleJumpToBottom, isJumpingToBottom } = useJumpToBottomAction({ listRef });
|
|
112
|
+
const listHeader = useMemo(() => (<View>
|
|
113
|
+
{isFetchingNewerMessages && (<Animated.View entering={FadeIn.duration(750)} exiting={FadeOut.duration(750)} style={styles.loadingFooter} accessibilityRole="progressbar" accessibilityLabel="Loading more messages">
|
|
114
|
+
<ActivityIndicator />
|
|
115
|
+
</Animated.View>)}
|
|
116
|
+
<View style={styles.listHeader}/>
|
|
117
|
+
</View>), [isFetchingNewerMessages, styles.loadingFooter, styles.listHeader]);
|
|
118
|
+
const renderItem = useCallback(({ item }) => {
|
|
119
|
+
if (item.type === 'DateSeparator')
|
|
120
|
+
return <InlineDateSeparator {...item}/>;
|
|
121
|
+
if (item.type === 'UnreadDivider')
|
|
122
|
+
return <UnreadDivider scrolledPast={dividerScrolledPast}/>;
|
|
123
|
+
if (item.type === 'ReplyShadowMessage') {
|
|
124
|
+
return (<ReplyShadowMessage {...item} conversation_id={conversationId} inReplyScreen={!!replyRootId}/>);
|
|
125
|
+
}
|
|
126
|
+
if (isSystemMessage(item)) {
|
|
127
|
+
return <SystemMessage message={item} conversationId={conversationId}/>;
|
|
128
|
+
}
|
|
129
|
+
return (<Message {...item} canDeleteNonAuthoredMessages={canDeleteNonAuthoredMessages} conversation_id={conversationId} latestReadMessageSortKey={conversation?.latestReadMessageSortKey} inReplyScreen={!!replyRootId}/>);
|
|
130
|
+
}, [
|
|
131
|
+
dividerScrolledPast,
|
|
132
|
+
conversationId,
|
|
133
|
+
replyRootId,
|
|
134
|
+
canDeleteNonAuthoredMessages,
|
|
135
|
+
conversation?.latestReadMessageSortKey,
|
|
136
|
+
]);
|
|
87
137
|
useEffect(() => {
|
|
88
|
-
if (
|
|
138
|
+
if (replyRootId) {
|
|
89
139
|
navigation.setParams({
|
|
90
140
|
title: replyHeaderTitle,
|
|
91
141
|
});
|
|
@@ -98,7 +148,7 @@ function ConversationScreenContent({ route }) {
|
|
|
98
148
|
muted,
|
|
99
149
|
});
|
|
100
150
|
}
|
|
101
|
-
}, [navigation, title, badges, conversation?.deleted,
|
|
151
|
+
}, [navigation, title, badges, conversation?.deleted, replyRootId, replyHeaderTitle, muted]);
|
|
102
152
|
if (!conversation || conversation.deleted) {
|
|
103
153
|
return (<View style={styles.container}>
|
|
104
154
|
<BlankState.Root>
|
|
@@ -112,22 +162,11 @@ function ConversationScreenContent({ route }) {
|
|
|
112
162
|
}
|
|
113
163
|
return (<View style={styles.container}>
|
|
114
164
|
<KeyboardView>
|
|
115
|
-
{noMessages ? (<EmptyConversationBlankState />) : (<FlatList inverted ref={listRef} contentContainerStyle={styles.listContainer}
|
|
116
|
-
|
|
117
|
-
return <InlineDateSeparator {...item}/>;
|
|
118
|
-
}
|
|
119
|
-
if (item.type === 'ReplyShadowMessage') {
|
|
120
|
-
return (<ReplyShadowMessage {...item} conversation_id={conversation_id} inReplyScreen={!!reply_root_id}/>);
|
|
121
|
-
}
|
|
122
|
-
if (isSystemMessage(item)) {
|
|
123
|
-
return <SystemMessage message={item} conversationId={conversation_id}/>;
|
|
124
|
-
}
|
|
125
|
-
return (<Message {...item} canDeleteNonAuthoredMessages={canDeleteNonAuthoredMessages} conversation_id={conversation_id} latestReadMessageSortKey={conversation?.latestReadMessageSortKey} inReplyScreen={!!reply_root_id}/>);
|
|
126
|
-
}} onEndReached={() => fetchOlderMessages()} ListHeaderComponent={<View style={styles.listHeader}/>}/>)}
|
|
127
|
-
<JumpToBottomButton onPress={handleReturnToBottom} visible={showJumpToBottomButton}/>
|
|
165
|
+
{noMessages ? (<EmptyConversationBlankState />) : (<FlatList inverted ref={listRef} contentContainerStyle={styles.listContainer} maintainVisibleContentPosition={maintainVisibleContentPosition} data={items} keyExtractor={extractItemKey} onScroll={onScroll} onScrollBeginDrag={onScrollBeginDrag} scrollEventThrottle={64} viewabilityConfigCallbackPairs={viewabilityConfigCallbackPairs} onContentSizeChange={onContentSizeChange} onScrollToIndexFailed={onScrollToIndexFailed} renderItem={renderItem} onEndReached={() => fetchOlderMessages()} ListHeaderComponent={listHeader}/>)}
|
|
166
|
+
<JumpToBottomButton onPress={handleJumpToBottom} visible={showJumpToBottomButton} loading={isJumpingToBottom}/>
|
|
128
167
|
{!noMessages && <TypingIndicator />}
|
|
129
168
|
{showLeaderDisabledReplyBanner && <LeaderMessagesDisabledBanner />}
|
|
130
|
-
{canReply ? (<MessageForm.Root replyRootAuthorFirstName={replyRootAuthorFirstName} conversation={conversation} replyRootId={
|
|
169
|
+
{canReply ? (<MessageForm.Root replyRootAuthorFirstName={replyRootAuthorFirstName} conversation={conversation} replyRootId={replyRootId} currentlyEditingMessage={currentlyEditingMessage}
|
|
131
170
|
// We use a separate key so that it remounts component when switching between new
|
|
132
171
|
// and edit message. This simplifies internal state handling.
|
|
133
172
|
key={currentlyEditingMessage
|
|
@@ -237,6 +276,10 @@ const useStyles = () => {
|
|
|
237
276
|
// Just whitespace to provide space where the typing indicator can be
|
|
238
277
|
height: 16,
|
|
239
278
|
},
|
|
279
|
+
loadingFooter: {
|
|
280
|
+
paddingVertical: 12,
|
|
281
|
+
alignItems: 'center',
|
|
282
|
+
},
|
|
240
283
|
});
|
|
241
284
|
};
|
|
242
285
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_screen.js","sourceRoot":"","sources":["../../src/screens/conversation_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,EAAE,WAAW,EAAoB,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC7F,OAAO,EACL,aAAa,EAGb,aAAa,EACb,QAAQ,IAAI,kBAAkB,EAC9B,QAAQ,GACT,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,2BAA2B,EAAE,MAAM,2DAA2D,CAAA;AACvG,OAAO,EAAE,kBAAkB,EAAE,MAAM,kDAAkD,CAAA;AACrF,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAA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ACR,MAAM,EAAE;oBACN,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,EAAE,mBAAmB,EAAE,MAAM,EAAE,mBAAmB,EAAE,EAAE;oBACvF,GAAG,MAAM;iBACV;gBACD,KAAK,EAAE,KAAK,CAAC,KAAK,GAAG,CAAC;aACvB,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAA;AAC/C,CAAC,CAAA","sourcesContent":["import { date as formatDate } from '@planningcenter/datetime-fmt'\nimport { HeaderTitle, HeaderTitleProps, PlatformPressable } from '@react-navigation/elements'\nimport {\n CommonActions,\n RouteProp,\n StaticScreenProps,\n useNavigation,\n useTheme as useNavigationTheme,\n useRoute,\n} from '@react-navigation/native'\nimport React, { useCallback, useEffect, useRef, useState } from 'react'\nimport { FlatList, Platform, StyleSheet, View } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { Badge, Icon, Text } from '../components'\nimport { EmptyConversationBlankState } from '../components/conversation/empty_conversation_blank_state'\nimport { JumpToBottomButton } from '../components/conversation/jump_to_bottom_button'\nimport { Message } from '../components/conversation/message'\nimport { MessageForm } from '../components/conversation/message_form'\nimport {\n LeaderMessagesDisabledBanner,\n MemberMessagesDisabledBanner,\n} from '../components/conversation/messages_disabled_banners'\nimport { ReplyShadowMessage } from '../components/conversation/reply_shadow_message'\nimport { SystemMessage } from '../components/conversation/system_message'\nimport { TypingIndicator } from '../components/conversation/typing_indicator'\nimport { KeyboardView } from '../components/display/keyboard_view'\nimport BlankState from '../components/primitive/blank_state_primitive'\nimport { ConversationContextProvider } from '../contexts/conversation_context'\nimport { useTheme } from '../hooks'\nimport { useConversation } from '../hooks/use_conversation'\nimport { useConversationJoltEvents } from '../hooks/use_conversation_jolt_events'\nimport { useConversationMessages } from '../hooks/use_conversation_messages'\nimport { useConversationMessagesJoltEvents } from '../hooks/use_conversation_messages_jolt_events'\nimport { useFeatures } from '../hooks/use_features'\nimport { useMarkLatestMessageRead } from '../hooks/use_mark_latest_message_read'\nimport {\n normalizeAnalyticsMetadata,\n usePublishProductAnalyticsEvent,\n} from '../hooks/use_product_analytics'\nimport { ConversationBadgeResource } from '../types/resources/conversation_badge'\nimport { getRelativeDateStatus } from '../utils/date'\nimport { groupMessages, type DateSeparator } from '../utils/group_messages'\nimport { CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL } from '../utils/styles'\nimport { isSystemMessage } from '../utils/system_messages'\n\nexport type ConversationRouteProps = {\n conversation_id: number\n reply_root_id?: string | null\n reply_root_author_name?: string\n chat_group_graph_id?: string\n clear_input?: boolean\n editing_message_id?: number | null\n message_id?: string\n title?: string\n subtitle?: string\n badge?: ConversationBadgeResource\n deleted?: boolean\n muted?: boolean\n}\n\nexport type ConversationScreenProps = StaticScreenProps<ConversationRouteProps>\n\nexport function ConversationScreen({ route }: ConversationScreenProps) {\n const { conversation_id, message_id, reply_root_id } = route.params\n\n const { data: conversation } = useConversation({ conversation_id })\n const { featureEnabled } = useFeatures()\n\n usePublishProductAnalyticsEvent('chat.mobile.conversations.show.opened', {\n reply_root_id,\n ...normalizeAnalyticsMetadata(conversation),\n })\n\n const lastReadMessageSortKey = conversation.conversationMembership?.lastReadMessageSortKey ?? null\n const jumpToUnreadAnchor = featureEnabled('jump_to_unread') ? lastReadMessageSortKey : null\n const initialMessageId = message_id ?? jumpToUnreadAnchor\n const initialMessageIdIsAnchor = !!initialMessageId && !message_id\n\n return (\n <ConversationContextProvider\n conversationId={conversation_id}\n currentPageReplyRootId={reply_root_id ?? null}\n initialMessageId={initialMessageId}\n initialMessageIdIsAnchor={initialMessageIdIsAnchor}\n >\n <ConversationScreenContent route={route} />\n </ConversationContextProvider>\n )\n}\n\nfunction ConversationScreenContent({ route }: ConversationScreenProps) {\n const styles = useStyles()\n const navigation = useNavigation()\n const { conversation_id, editing_message_id, reply_root_id, reply_root_author_name } =\n route.params\n const { data: conversation } = useConversation(route.params)\n const { messages, refetch, isRefetching, fetchOlderMessages } = useConversationMessages({\n conversation_id,\n reply_root_id,\n })\n useConversationJoltEvents({ conversationId: conversation_id })\n useConversationMessagesJoltEvents({ conversationId: conversation_id })\n useEnsureConversationsRouteExists()\n useMarkLatestMessageRead({ conversation, messages })\n const messagesWithSeparators = groupMessages({\n ms: messages,\n inReplyScreen: !!reply_root_id,\n })\n const noMessages = messagesWithSeparators.length === 0\n\n const { repliesDisabled, memberAbility, badges, title } = conversation\n const canReply = memberAbility?.canReply\n const showLeaderDisabledReplyBanner = canReply && repliesDisabled\n const canDeleteNonAuthoredMessages = memberAbility?.canDeleteNonAuthoredMessages ?? false\n const currentlyEditingMessage = messages.find(m => String(m.id) === String(editing_message_id))\n const replyRootAuthorFirstName = reply_root_author_name?.split(' ')[0]\n const replyHeaderTitle = replyRootAuthorFirstName\n ? `Reply to ${replyRootAuthorFirstName}`\n : 'Reply'\n // Prefer the membership for optimistic updates.\n const muted = conversation.conversationMembership?.muted ?? conversation.muted\n\n const listRef = useRef<FlatList>(null)\n const [showJumpToBottomButton, setShowJumpToBottomButton] = useState(false)\n\n const trackScroll = (event: any) => {\n const offsetY = event.nativeEvent.contentOffset.y\n setShowJumpToBottomButton(offsetY > 200)\n }\n\n const handleReturnToBottom = useCallback(() => {\n listRef.current?.scrollToOffset({\n offset: 0,\n })\n }, [])\n\n useEffect(() => {\n if (reply_root_id) {\n navigation.setParams({\n title: replyHeaderTitle,\n })\n } else {\n navigation.setParams({\n title: title,\n badge: badges?.[0],\n deleted: conversation?.deleted,\n muted,\n })\n }\n }, [navigation, title, badges, conversation?.deleted, reply_root_id, replyHeaderTitle, muted])\n\n if (!conversation || conversation.deleted) {\n return (\n <View style={styles.container}>\n <BlankState.Root>\n <BlankState.Imagery name=\"general.outlinedTextMessage\" />\n <BlankState.Content>\n <BlankState.Heading>This conversation has been deleted</BlankState.Heading>\n </BlankState.Content>\n <BlankState.Button\n onPress={navigation.goBack}\n title=\"Back to conversations\"\n accessibilityHint=\"Navigates back to the conversations list\"\n accessibilityRole=\"link\"\n />\n </BlankState.Root>\n </View>\n )\n }\n\n return (\n <View style={styles.container}>\n <KeyboardView>\n {noMessages ? (\n <EmptyConversationBlankState />\n ) : (\n <FlatList\n inverted\n ref={listRef}\n contentContainerStyle={styles.listContainer}\n refreshing={isRefetching}\n onRefresh={refetch}\n data={messagesWithSeparators}\n keyExtractor={item => item.id}\n onScroll={trackScroll}\n scrollEventThrottle={10}\n renderItem={({ item }) => {\n if (item.type === 'DateSeparator') {\n return <InlineDateSeparator {...item} />\n }\n\n if (item.type === 'ReplyShadowMessage') {\n return (\n <ReplyShadowMessage\n {...item}\n conversation_id={conversation_id}\n inReplyScreen={!!reply_root_id}\n />\n )\n }\n\n if (isSystemMessage(item)) {\n return <SystemMessage message={item} conversationId={conversation_id} />\n }\n\n return (\n <Message\n {...item}\n canDeleteNonAuthoredMessages={canDeleteNonAuthoredMessages}\n conversation_id={conversation_id}\n latestReadMessageSortKey={conversation?.latestReadMessageSortKey}\n inReplyScreen={!!reply_root_id}\n />\n )\n }}\n onEndReached={() => fetchOlderMessages()}\n ListHeaderComponent={<View style={styles.listHeader} />}\n />\n )}\n <JumpToBottomButton onPress={handleReturnToBottom} visible={showJumpToBottomButton} />\n {!noMessages && <TypingIndicator />}\n {showLeaderDisabledReplyBanner && <LeaderMessagesDisabledBanner />}\n {canReply ? (\n <MessageForm.Root\n replyRootAuthorFirstName={replyRootAuthorFirstName}\n conversation={conversation}\n replyRootId={reply_root_id}\n currentlyEditingMessage={currentlyEditingMessage}\n // We use a separate key so that it remounts component when switching between new\n // and edit message. This simplifies internal state handling.\n key={\n currentlyEditingMessage\n ? `edit-message-form-${currentlyEditingMessage.id}`\n : 'new-message-form'\n }\n >\n <MessageForm.AttachmentPicker />\n <MessageForm.Commands />\n <MessageForm.TextInput />\n <MessageForm.SubmitButton />\n </MessageForm.Root>\n ) : (\n <MemberMessagesDisabledBanner />\n )}\n </KeyboardView>\n </View>\n )\n}\n\nfunction InlineDateSeparator({ date }: DateSeparator) {\n const styles = useDateSeparatorStyles()\n const { isThisYear } = getRelativeDateStatus(date)\n const showYear = !isThisYear\n const dateStamp = formatDate(date, { style: 'long', year: showYear })\n\n return (\n <View style={styles.container}>\n <View style={styles.separator} />\n <Text variant=\"footnote\" style={styles.dateText}>\n {dateStamp}\n </Text>\n <View style={styles.separator} />\n </View>\n )\n}\n\nconst useDateSeparatorStyles = () => {\n const theme = useTheme()\n return StyleSheet.create({\n container: {\n alignItems: 'center',\n flexDirection: 'row',\n paddingHorizontal: CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL,\n paddingVertical: 16,\n },\n separator: {\n flex: 1,\n height: 1,\n borderTopWidth: 1,\n borderTopColor: theme.colors.borderColorDefaultBase,\n },\n dateText: {\n paddingHorizontal: 8,\n },\n })\n}\n\ninterface ConversationScreenTitleProps extends HeaderTitleProps {\n conversation_id: number\n badge?: ConversationBadgeResource\n deleted?: boolean\n muted?: boolean\n}\n\nexport const ConversationScreenTitle = ({\n conversation_id,\n badge,\n children,\n style,\n deleted,\n muted,\n}: ConversationScreenTitleProps) => {\n const styles = usePressableHeaderStyle()\n const navigation = useNavigation()\n const resourceType = badge?.pcoResourceType || ''\n const productName = badge?.appName\n const name = badge?.text || undefined\n\n return (\n <PlatformPressable\n accessibilityHint=\"Opens details about members and settings\"\n style={styles.container}\n onPress={() => {\n if (deleted) return\n\n navigation.navigate('ConversationDetails', { conversation_id })\n }}\n >\n <View style={styles.titleWrapper}>\n <View style={styles.titleTextContainer}>\n <HeaderTitle maxFontSizeMultiplier={1} style={style}>\n {children}\n </HeaderTitle>\n </View>\n {muted && <Icon name=\"general.bellMuted\" size={12} />}\n {!deleted && <Icon name=\"general.downChevron\" size={12} />}\n </View>\n <Badge\n variant=\"metaSubtle\"\n productLogoName={productName}\n label={resourceType}\n metaLabel={name}\n style={styles.badge}\n maxFontSizeMultiplier={1}\n />\n </PlatformPressable>\n )\n}\n\nconst usePressableHeaderStyle = () => {\n return StyleSheet.create({\n container: {\n alignItems: Platform.select({ android: 'flex-start', default: 'center' }),\n marginRight: Platform.select({ ios: 20, default: 16 }),\n flex: 1,\n },\n titleWrapper: {\n alignItems: 'center',\n columnGap: 4,\n flexDirection: 'row',\n flexShrink: 1,\n },\n titleTextContainer: {\n flexShrink: 1,\n minWidth: 0,\n },\n badge: {\n alignSelf: Platform.select({ android: 'flex-start', default: 'center' }),\n marginTop: 2,\n },\n })\n}\n\nconst useStyles = () => {\n const navigationTheme = useNavigationTheme()\n const { bottom } = useSafeAreaInsets()\n\n return StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'center',\n backgroundColor: navigationTheme.colors.card,\n paddingBottom: bottom,\n },\n listContainer: {\n paddingVertical: 12,\n },\n listHeader: {\n // Just whitespace to provide space where the typing indicator can be\n height: 16,\n },\n })\n}\n\n/**\n * useEnsureConversationsRouteExists\n */\nconst useEnsureConversationsRouteExists = () => {\n const navigation = useNavigation()\n const { params } = useRoute<RouteProp<ConversationScreenProps['route']>>()\n\n useEffect(() => {\n const navigationState = navigation.getState()\n const routes = navigationState?.routes || []\n const conversationsRoute = routes.find(r => r.name === 'Conversations')\n\n if (conversationsRoute) return\n\n navigation.dispatch(state => {\n return CommonActions.reset({\n ...state,\n routes: [\n { name: 'Conversations', params: { chat_group_graph_id: params?.chat_group_graph_id } },\n ...routes,\n ],\n index: state.index + 1,\n })\n })\n }, [navigation, params?.chat_group_graph_id])\n}\n"]}
|
|
1
|
+
{"version":3,"file":"conversation_screen.js","sourceRoot":"","sources":["../../src/screens/conversation_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,EAAE,WAAW,EAAoB,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC7F,OAAO,EACL,aAAa,EAGb,aAAa,EACb,QAAQ,IAAI,kBAAkB,EAC9B,QAAQ,GACT,MAAM,0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B;QACD,aAAa,EAAE;YACb,eAAe,EAAE,EAAE;SACpB;QACD,UAAU,EAAE;YACV,qEAAqE;YACrE,MAAM,EAAE,EAAE;SACX;QACD,aAAa,EAAE;YACb,eAAe,EAAE,EAAE;YACnB,UAAU,EAAE,QAAQ;SACrB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,iCAAiC,GAAG,GAAG,EAAE;IAC7C,MAAM,UAAU,GAAG,aAAa,EAAE,CAAA;IAClC,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAA+C,CAAA;IAE1E,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,eAAe,GAAG,UAAU,CAAC,QAAQ,EAAE,CAAA;QAC7C,MAAM,MAAM,GAAG,eAAe,EAAE,MAAM,IAAI,EAAE,CAAA;QAC5C,MAAM,kBAAkB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,eAAe,CAAC,CAAA;QAEvE,IAAI,kBAAkB;YAAE,OAAM;QAE9B,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;YAC1B,OAAO,aAAa,CAAC,KAAK,CAAC;gBACzB,GAAG,KAAK;gBACR,MAAM,EAAE;oBACN,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,EAAE,mBAAmB,EAAE,MAAM,EAAE,mBAAmB,EAAE,EAAE;oBACvF,GAAG,MAAM;iBACV;gBACD,KAAK,EAAE,KAAK,CAAC,KAAK,GAAG,CAAC;aACvB,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAA;AAC/C,CAAC,CAAA","sourcesContent":["import { date as formatDate } from '@planningcenter/datetime-fmt'\nimport { HeaderTitle, HeaderTitleProps, PlatformPressable } from '@react-navigation/elements'\nimport {\n CommonActions,\n RouteProp,\n StaticScreenProps,\n useNavigation,\n useTheme as useNavigationTheme,\n useRoute,\n} from '@react-navigation/native'\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport { ActivityIndicator, FlatList, Platform, StyleSheet, View } from 'react-native'\nimport Animated, { FadeIn, FadeOut } from 'react-native-reanimated'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { Badge, Icon, Text } from '../components'\nimport { EmptyConversationBlankState } from '../components/conversation/empty_conversation_blank_state'\nimport { JumpToBottomButton } from '../components/conversation/jump_to_bottom_button'\nimport { Message } from '../components/conversation/message'\nimport { MessageForm } from '../components/conversation/message_form'\nimport {\n LeaderMessagesDisabledBanner,\n MemberMessagesDisabledBanner,\n} from '../components/conversation/messages_disabled_banners'\nimport { ReplyShadowMessage } from '../components/conversation/reply_shadow_message'\nimport { SystemMessage } from '../components/conversation/system_message'\nimport { TypingIndicator } from '../components/conversation/typing_indicator'\nimport { UnreadDivider } from '../components/conversation/unread_divider'\nimport { KeyboardView } from '../components/display/keyboard_view'\nimport BlankState from '../components/primitive/blank_state_primitive'\nimport {\n ConversationContextProvider,\n useConversationContext,\n} from '../contexts/conversation_context'\nimport { useTheme } from '../hooks'\nimport { useConversation } from '../hooks/use_conversation'\nimport { useConversationJoltEvents } from '../hooks/use_conversation_jolt_events'\nimport { useConversationMessages } from '../hooks/use_conversation_messages'\nimport { useConversationMessagesJoltEvents } from '../hooks/use_conversation_messages_jolt_events'\nimport { useFeatures } from '../hooks/use_features'\nimport { useFlatListViewability } from '../hooks/use_flat_list_viewability'\nimport { useJumpToBottomAction } from '../hooks/use_jump_to_bottom_action'\nimport { useJumpToUnreadAnchor } from '../hooks/use_jump_to_unread_anchor'\nimport { useJumpToUnreadGates } from '../hooks/use_jump_to_unread_gates'\nimport { useMarkLatestMessageRead } from '../hooks/use_mark_latest_message_read'\nimport {\n normalizeAnalyticsMetadata,\n usePublishProductAnalyticsEvent,\n} from '../hooks/use_product_analytics'\nimport { useScrollTracking } from '../hooks/use_scroll_tracking'\nimport { useTrackHighestSeenMessage } from '../hooks/use_track_highest_seen_message'\nimport { ConversationBadgeResource } from '../types/resources/conversation_badge'\nimport { getRelativeDateStatus } from '../utils/date'\nimport {\n groupMessages,\n UNREAD_DIVIDER_KEY,\n type DateSeparator,\n type EnrichedMessage,\n} from '../utils/group_messages'\nimport {\n detectDividerExitTowardNewer,\n reportViewableMessages,\n type ViewabilityObserver,\n} from '../utils/message_viewability'\nimport { CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL } from '../utils/styles'\nimport { isSystemMessage } from '../utils/system_messages'\n\nexport type ConversationRouteProps = {\n conversation_id: number\n reply_root_id?: string | null\n reply_root_author_name?: string\n chat_group_graph_id?: string\n clear_input?: boolean\n editing_message_id?: number | null\n message_id?: string\n title?: string\n subtitle?: string\n badge?: ConversationBadgeResource\n deleted?: boolean\n muted?: boolean\n}\n\nexport type ConversationScreenProps = StaticScreenProps<ConversationRouteProps>\n\nconst extractItemKey = (item: EnrichedMessage) => String(item.id)\nconst maintainVisibleContentPosition = { minIndexForVisible: 0 }\n\nexport function ConversationScreen({ route }: ConversationScreenProps) {\n const { conversation_id, message_id, reply_root_id } = route.params\n\n const { data: conversation } = useConversation({ conversation_id })\n const { featureEnabled } = useFeatures()\n\n usePublishProductAnalyticsEvent('chat.mobile.conversations.show.opened', {\n reply_root_id,\n ...normalizeAnalyticsMetadata(conversation),\n })\n\n const lastReadMessageSortKey = conversation.conversationMembership?.lastReadMessageSortKey ?? null\n const jumpToUnreadAnchor =\n featureEnabled('jump_to_unread') && !reply_root_id ? lastReadMessageSortKey : null\n const initialMessageId = message_id ?? jumpToUnreadAnchor\n const initialMessageIdIsAnchor = !!initialMessageId && !message_id\n\n return (\n <ConversationContextProvider\n conversationId={conversation_id}\n currentPageReplyRootId={reply_root_id ?? null}\n initialMessageId={initialMessageId}\n initialMessageIdIsAnchor={initialMessageIdIsAnchor}\n >\n <ConversationScreenContent route={route} />\n </ConversationContextProvider>\n )\n}\n\nfunction ConversationScreenContent({ route }: ConversationScreenProps) {\n const styles = useStyles()\n const navigation = useNavigation()\n const {\n conversation_id: conversationId,\n editing_message_id: editingMessageId,\n reply_root_id: replyRootId,\n reply_root_author_name: replyRootAuthorName,\n } = route.params\n const { data: conversation } = useConversation(route.params)\n const {\n messages,\n fetchOlderMessages,\n fetchNewerMessages,\n hasMoreNewerMessages,\n isFetchingNewerMessages,\n cancelFetchNewerMessages,\n } = useConversationMessages({ conversation_id: conversationId, reply_root_id: replyRootId })\n\n const { jumpToUnreadActive } = useJumpToUnreadGates()\n const { initialMessageId } = useConversationContext()\n\n useConversationJoltEvents({ conversationId })\n useConversationMessagesJoltEvents({ conversationId })\n useEnsureConversationsRouteExists()\n useMarkLatestMessageRead({ conversation, messages })\n const { onMessageSeen } = useTrackHighestSeenMessage()\n\n const items = useMemo(\n () =>\n groupMessages({\n ms: messages,\n inReplyScreen: !!replyRootId,\n jumpToUnreadActive,\n initialMessageId,\n }),\n [messages, replyRootId, jumpToUnreadActive, initialMessageId]\n )\n const noMessages = items.length === 0\n\n const { repliesDisabled, memberAbility, badges, title } = conversation\n const canReply = memberAbility?.canReply\n const showLeaderDisabledReplyBanner = canReply && repliesDisabled\n const canDeleteNonAuthoredMessages = memberAbility?.canDeleteNonAuthoredMessages ?? false\n const currentlyEditingMessage = messages.find(m => String(m.id) === String(editingMessageId))\n const replyRootAuthorFirstName = replyRootAuthorName?.split(' ')[0]\n const replyHeaderTitle = replyRootAuthorFirstName\n ? `Reply to ${replyRootAuthorFirstName}`\n : 'Reply'\n // Prefer the membership for optimistic updates.\n const muted = conversation.conversationMembership?.muted ?? conversation.muted\n\n const listRef = useRef<FlatList>(null)\n const [dividerScrolledPast, setDividerScrolledPast] = useState(false)\n\n const observers = useMemo<ViewabilityObserver<EnrichedMessage>[]>(\n () => [\n reportViewableMessages(onMessageSeen),\n detectDividerExitTowardNewer({\n dividerKey: UNREAD_DIVIDER_KEY,\n initialMessageId,\n onExited: () => setDividerScrolledPast(true),\n }),\n ],\n [onMessageSeen, initialMessageId]\n )\n\n const { viewabilityConfigCallbackPairs, onScrollBeginDrag: viewabilityOnScrollBeginDrag } =\n useFlatListViewability({ observers })\n const {\n onContentSizeChange,\n onScrollToIndexFailed,\n onScrollBeginDrag: anchorOnScrollBeginDrag,\n } = useJumpToUnreadAnchor({ listRef, items })\n const onScrollBeginDrag = useCallback(() => {\n viewabilityOnScrollBeginDrag()\n anchorOnScrollBeginDrag()\n }, [viewabilityOnScrollBeginDrag, anchorOnScrollBeginDrag])\n const { onScroll, showJumpToBottomButton } = useScrollTracking({\n hasMoreNewerMessages,\n isFetchingNewerMessages,\n fetchNewerMessages,\n cancelFetchNewerMessages,\n })\n const { handleJumpToBottom, isJumpingToBottom } = useJumpToBottomAction({ listRef })\n\n const listHeader = useMemo(\n () => (\n <View>\n {isFetchingNewerMessages && (\n <Animated.View\n entering={FadeIn.duration(750)}\n exiting={FadeOut.duration(750)}\n style={styles.loadingFooter}\n accessibilityRole=\"progressbar\"\n accessibilityLabel=\"Loading more messages\"\n >\n <ActivityIndicator />\n </Animated.View>\n )}\n <View style={styles.listHeader} />\n </View>\n ),\n [isFetchingNewerMessages, styles.loadingFooter, styles.listHeader]\n )\n\n const renderItem = useCallback(\n ({ item }: { item: EnrichedMessage }) => {\n if (item.type === 'DateSeparator') return <InlineDateSeparator {...item} />\n if (item.type === 'UnreadDivider') return <UnreadDivider scrolledPast={dividerScrolledPast} />\n if (item.type === 'ReplyShadowMessage') {\n return (\n <ReplyShadowMessage\n {...item}\n conversation_id={conversationId}\n inReplyScreen={!!replyRootId}\n />\n )\n }\n if (isSystemMessage(item)) {\n return <SystemMessage message={item} conversationId={conversationId} />\n }\n return (\n <Message\n {...item}\n canDeleteNonAuthoredMessages={canDeleteNonAuthoredMessages}\n conversation_id={conversationId}\n latestReadMessageSortKey={conversation?.latestReadMessageSortKey}\n inReplyScreen={!!replyRootId}\n />\n )\n },\n [\n dividerScrolledPast,\n conversationId,\n replyRootId,\n canDeleteNonAuthoredMessages,\n conversation?.latestReadMessageSortKey,\n ]\n )\n\n useEffect(() => {\n if (replyRootId) {\n navigation.setParams({\n title: replyHeaderTitle,\n })\n } else {\n navigation.setParams({\n title: title,\n badge: badges?.[0],\n deleted: conversation?.deleted,\n muted,\n })\n }\n }, [navigation, title, badges, conversation?.deleted, replyRootId, replyHeaderTitle, muted])\n\n if (!conversation || conversation.deleted) {\n return (\n <View style={styles.container}>\n <BlankState.Root>\n <BlankState.Imagery name=\"general.outlinedTextMessage\" />\n <BlankState.Content>\n <BlankState.Heading>This conversation has been deleted</BlankState.Heading>\n </BlankState.Content>\n <BlankState.Button\n onPress={navigation.goBack}\n title=\"Back to conversations\"\n accessibilityHint=\"Navigates back to the conversations list\"\n accessibilityRole=\"link\"\n />\n </BlankState.Root>\n </View>\n )\n }\n\n return (\n <View style={styles.container}>\n <KeyboardView>\n {noMessages ? (\n <EmptyConversationBlankState />\n ) : (\n <FlatList\n inverted\n ref={listRef}\n contentContainerStyle={styles.listContainer}\n maintainVisibleContentPosition={maintainVisibleContentPosition}\n data={items}\n keyExtractor={extractItemKey}\n onScroll={onScroll}\n onScrollBeginDrag={onScrollBeginDrag}\n scrollEventThrottle={64}\n viewabilityConfigCallbackPairs={viewabilityConfigCallbackPairs}\n onContentSizeChange={onContentSizeChange}\n onScrollToIndexFailed={onScrollToIndexFailed}\n renderItem={renderItem}\n onEndReached={() => fetchOlderMessages()}\n ListHeaderComponent={listHeader}\n />\n )}\n <JumpToBottomButton\n onPress={handleJumpToBottom}\n visible={showJumpToBottomButton}\n loading={isJumpingToBottom}\n />\n {!noMessages && <TypingIndicator />}\n {showLeaderDisabledReplyBanner && <LeaderMessagesDisabledBanner />}\n {canReply ? (\n <MessageForm.Root\n replyRootAuthorFirstName={replyRootAuthorFirstName}\n conversation={conversation}\n replyRootId={replyRootId}\n currentlyEditingMessage={currentlyEditingMessage}\n // We use a separate key so that it remounts component when switching between new\n // and edit message. This simplifies internal state handling.\n key={\n currentlyEditingMessage\n ? `edit-message-form-${currentlyEditingMessage.id}`\n : 'new-message-form'\n }\n >\n <MessageForm.AttachmentPicker />\n <MessageForm.Commands />\n <MessageForm.TextInput />\n <MessageForm.SubmitButton />\n </MessageForm.Root>\n ) : (\n <MemberMessagesDisabledBanner />\n )}\n </KeyboardView>\n </View>\n )\n}\n\nfunction InlineDateSeparator({ date }: DateSeparator) {\n const styles = useDateSeparatorStyles()\n const { isThisYear } = getRelativeDateStatus(date)\n const showYear = !isThisYear\n const dateStamp = formatDate(date, { style: 'long', year: showYear })\n\n return (\n <View style={styles.container}>\n <View style={styles.separator} />\n <Text variant=\"footnote\" style={styles.dateText}>\n {dateStamp}\n </Text>\n <View style={styles.separator} />\n </View>\n )\n}\n\nconst useDateSeparatorStyles = () => {\n const theme = useTheme()\n return StyleSheet.create({\n container: {\n alignItems: 'center',\n flexDirection: 'row',\n paddingHorizontal: CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL,\n paddingVertical: 16,\n },\n separator: {\n flex: 1,\n height: 1,\n borderTopWidth: 1,\n borderTopColor: theme.colors.borderColorDefaultBase,\n },\n dateText: {\n paddingHorizontal: 8,\n },\n })\n}\n\ninterface ConversationScreenTitleProps extends HeaderTitleProps {\n conversation_id: number\n badge?: ConversationBadgeResource\n deleted?: boolean\n muted?: boolean\n}\n\nexport const ConversationScreenTitle = ({\n conversation_id,\n badge,\n children,\n style,\n deleted,\n muted,\n}: ConversationScreenTitleProps) => {\n const styles = usePressableHeaderStyle()\n const navigation = useNavigation()\n const resourceType = badge?.pcoResourceType || ''\n const productName = badge?.appName\n const name = badge?.text || undefined\n\n return (\n <PlatformPressable\n accessibilityHint=\"Opens details about members and settings\"\n style={styles.container}\n onPress={() => {\n if (deleted) return\n\n navigation.navigate('ConversationDetails', { conversation_id })\n }}\n >\n <View style={styles.titleWrapper}>\n <View style={styles.titleTextContainer}>\n <HeaderTitle maxFontSizeMultiplier={1} style={style}>\n {children}\n </HeaderTitle>\n </View>\n {muted && <Icon name=\"general.bellMuted\" size={12} />}\n {!deleted && <Icon name=\"general.downChevron\" size={12} />}\n </View>\n <Badge\n variant=\"metaSubtle\"\n productLogoName={productName}\n label={resourceType}\n metaLabel={name}\n style={styles.badge}\n maxFontSizeMultiplier={1}\n />\n </PlatformPressable>\n )\n}\n\nconst usePressableHeaderStyle = () => {\n return StyleSheet.create({\n container: {\n alignItems: Platform.select({ android: 'flex-start', default: 'center' }),\n marginRight: Platform.select({ ios: 20, default: 16 }),\n flex: 1,\n },\n titleWrapper: {\n alignItems: 'center',\n columnGap: 4,\n flexDirection: 'row',\n flexShrink: 1,\n },\n titleTextContainer: {\n flexShrink: 1,\n minWidth: 0,\n },\n badge: {\n alignSelf: Platform.select({ android: 'flex-start', default: 'center' }),\n marginTop: 2,\n },\n })\n}\n\nconst useStyles = () => {\n const navigationTheme = useNavigationTheme()\n const { bottom } = useSafeAreaInsets()\n\n return StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'center',\n backgroundColor: navigationTheme.colors.card,\n paddingBottom: bottom,\n },\n listContainer: {\n paddingVertical: 12,\n },\n listHeader: {\n // Just whitespace to provide space where the typing indicator can be\n height: 16,\n },\n loadingFooter: {\n paddingVertical: 12,\n alignItems: 'center',\n },\n })\n}\n\n/**\n * useEnsureConversationsRouteExists\n */\nconst useEnsureConversationsRouteExists = () => {\n const navigation = useNavigation()\n const { params } = useRoute<RouteProp<ConversationScreenProps['route']>>()\n\n useEffect(() => {\n const navigationState = navigation.getState()\n const routes = navigationState?.routes || []\n const conversationsRoute = routes.find(r => r.name === 'Conversations')\n\n if (conversationsRoute) return\n\n navigation.dispatch(state => {\n return CommonActions.reset({\n ...state,\n routes: [\n { name: 'Conversations', params: { chat_group_graph_id: params?.chat_group_graph_id } },\n ...routes,\n ],\n index: state.index + 1,\n })\n })\n }, [navigation, params?.chat_group_graph_id])\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group_notification_settings_screen.d.ts","sourceRoot":"","sources":["../../src/screens/group_notification_settings_screen.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAE3E,OAAO,KAAoB,MAAM,OAAO,CAAA;AAYxC,MAAM,MAAM,oCAAoC,GAAG,iBAAiB,CAAC;IACnE,OAAO,EAAE,MAAM,GAAG,MAAM,CAAA;IACxB,KAAK,EAAE,MAAM,CAAA;CACd,CAAC,CAAA;AAEF,wBAAgB,+BAA+B,CAAC,EAAE,KAAK,EAAE,EAAE,oCAAoC,
|
|
1
|
+
{"version":3,"file":"group_notification_settings_screen.d.ts","sourceRoot":"","sources":["../../src/screens/group_notification_settings_screen.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAE3E,OAAO,KAAoB,MAAM,OAAO,CAAA;AAYxC,MAAM,MAAM,oCAAoC,GAAG,iBAAiB,CAAC;IACnE,OAAO,EAAE,MAAM,GAAG,MAAM,CAAA;IACxB,KAAK,EAAE,MAAM,CAAA;CACd,CAAC,CAAA;AAEF,wBAAgB,+BAA+B,CAAC,EAAE,KAAK,EAAE,EAAE,oCAAoC,qBA4D9F"}
|
|
@@ -23,12 +23,14 @@ export function GroupNotificationSettingsScreen({ route }) {
|
|
|
23
23
|
return (<View style={styles.container}>
|
|
24
24
|
<View style={styles.sectionOuter}>
|
|
25
25
|
<View style={styles.sectionInner}>
|
|
26
|
-
<Heading variant="
|
|
26
|
+
<Heading variant="h2" style={styles.sectionHeading}>
|
|
27
27
|
Group notification settings
|
|
28
28
|
</Heading>
|
|
29
29
|
<Text variant="tertiary" style={styles.sectionSubtitle}>
|
|
30
30
|
The settings are applied to all conversations in{' '}
|
|
31
|
-
<Text style={styles.groupNameBold}>
|
|
31
|
+
<Text variant="tertiary" style={styles.groupNameBold}>
|
|
32
|
+
{group.name || title}
|
|
33
|
+
</Text>
|
|
32
34
|
</Text>
|
|
33
35
|
</View>
|
|
34
36
|
</View>
|
|
@@ -62,10 +64,11 @@ const useStyles = () => {
|
|
|
62
64
|
borderBottomColor: colors.borderColorDefaultBase,
|
|
63
65
|
},
|
|
64
66
|
sectionHeading: {
|
|
65
|
-
paddingBottom:
|
|
67
|
+
paddingBottom: 12,
|
|
66
68
|
},
|
|
67
69
|
sectionSubtitle: {
|
|
68
70
|
color: colors.textColorDefaultSecondary,
|
|
71
|
+
paddingBottom: 2,
|
|
69
72
|
},
|
|
70
73
|
groupNameBold: {
|
|
71
74
|
fontWeight: platformFontWeightBold,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group_notification_settings_screen.js","sourceRoot":"","sources":["../../src/screens/group_notification_settings_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAE3E,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AAExD,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAA;AAW/D,MAAM,UAAU,+BAA+B,CAAC,EAAE,KAAK,EAAwC;IAC7F,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,MAAM,CAAA;IACvC,MAAM,UAAU,GACd,aAAa,EAAsE,CAAA;IACrF,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC,CAAA;IAE7C,MAAM,4BAA4B,GAAG,KAAK,CAAC,iBAAiB,EAAE,4BAA4B,CAAA;IAE1F,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,KAAK,KAAK,CAAC,IAAI;YAAE,OAAM;QAE/C,UAAU,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAA;IAC9C,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAA;IAEnC,MAAM,kBAAkB,GAAG,GAAG,EAAE;QAC9B,UAAU,CAAC,QAAQ,CAAC,8BAA8B,EAAE,EAAE,OAAO,EAAE,CAAC,CAAA;IAClE,CAAC,CAAA;IAED,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAC5B;MAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAC/B;QAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAC/B;UAAA,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CACjD;;UACF,EAAE,OAAO,CACT;UAAA,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CACrD;4DAAgD,CAAC,GAAG,CACpD;YAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"group_notification_settings_screen.js","sourceRoot":"","sources":["../../src/screens/group_notification_settings_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAE3E,OAAO,KAAK,EAA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A;AACJ,CAAC,CAAA","sourcesContent":["import { PlatformPressable } from '@react-navigation/elements'\nimport { StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport type { NativeStackNavigationProp } from '@react-navigation/native-stack'\nimport React, { useEffect } from 'react'\nimport { Platform, StyleSheet, View } from 'react-native'\nimport { Heading, Icon, Text } from '../components'\nimport { useTheme } from '../hooks'\nimport { platformFontWeightBold } from '../utils/styles'\nimport type { GroupNotificationLevelSelectScreenProps } from './group_notification_level_select_screen'\nimport { useGroup } from './notification_settings/hooks/groups'\n\ntype GroupNotificationSettingsStackParamList = {\n GroupNotificationLevelSelect: GroupNotificationLevelSelectScreenProps['route']['params']\n}\n\nexport type GroupNotificationSettingsScreenProps = StaticScreenProps<{\n groupId: number | string\n title: string\n}>\n\nexport function GroupNotificationSettingsScreen({ route }: GroupNotificationSettingsScreenProps) {\n const { groupId, title } = route.params\n const navigation =\n useNavigation<NativeStackNavigationProp<GroupNotificationSettingsStackParamList>>()\n const styles = useStyles()\n const { data: group } = useGroup({ groupId })\n\n const notificationLevelDescription = group.myGroupMembership?.notificationLevelDescription\n\n useEffect(() => {\n if (!group.name || title === group.name) return\n\n navigation.setOptions({ title: group.name })\n }, [group.name, title, navigation])\n\n const handleOpenSelector = () => {\n navigation.navigate('GroupNotificationLevelSelect', { groupId })\n }\n\n return (\n <View style={styles.container}>\n <View style={styles.sectionOuter}>\n <View style={styles.sectionInner}>\n <Heading variant=\"h2\" style={styles.sectionHeading}>\n Group notification settings\n </Heading>\n <Text variant=\"tertiary\" style={styles.sectionSubtitle}>\n The settings are applied to all conversations in{' '}\n <Text variant=\"tertiary\" style={styles.groupNameBold}>\n {group.name || title}\n </Text>\n </Text>\n </View>\n </View>\n <PlatformPressable\n style={styles.settingRowPressable}\n onPress={handleOpenSelector}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Notify me for\"\n accessibilityHint={`Currently set to ${notificationLevelDescription}. Tap to change.`}\n >\n <View style={styles.settingRowInner}>\n <View style={styles.settingRowText}>\n <Text>Notify me for</Text>\n {Boolean(notificationLevelDescription) && (\n <Text variant=\"tertiary\">{notificationLevelDescription}</Text>\n )}\n </View>\n {Platform.OS === 'ios' && (\n <Icon\n name=\"general.rightChevron\"\n size={16}\n style={styles.chevron}\n accessibilityElementsHidden\n />\n )}\n </View>\n </PlatformPressable>\n </View>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n\n return StyleSheet.create({\n container: {\n flex: 1,\n backgroundColor: colors.surfaceColor100,\n },\n sectionOuter: {\n paddingLeft: 16,\n backgroundColor: colors.surfaceColor100,\n },\n sectionInner: {\n paddingRight: 16,\n paddingTop: 24,\n paddingBottom: 12,\n borderBottomWidth: 1,\n borderBottomColor: colors.borderColorDefaultBase,\n },\n sectionHeading: {\n paddingBottom: 12,\n },\n sectionSubtitle: {\n color: colors.textColorDefaultSecondary,\n paddingBottom: 2,\n },\n groupNameBold: {\n fontWeight: platformFontWeightBold,\n },\n settingRowPressable: {\n paddingLeft: 16,\n },\n settingRowInner: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n paddingRight: 16,\n paddingVertical: 12,\n },\n settingRowText: {\n flex: 1,\n gap: 2,\n },\n chevron: {\n color: colors.iconColorDefaultDisabled,\n },\n })\n}\n"]}
|
|
@@ -56,7 +56,7 @@ export function NotificationSettingsScreen({}) {
|
|
|
56
56
|
...chatTypes.map(type => ({
|
|
57
57
|
type: SectionTypes.link,
|
|
58
58
|
data: {
|
|
59
|
-
title: `${type.title}
|
|
59
|
+
title: `${type.title} conversations`,
|
|
60
60
|
rightLabel: type.preferredApp,
|
|
61
61
|
onPress: () => navigation.navigate('PreferredAppSelection', {
|
|
62
62
|
chatTypeId: type.id,
|
|
@@ -157,7 +157,7 @@ function LinkRow({ title, subtitle, rightLabel, onPress }) {
|
|
|
157
157
|
<Text style={styles.title} numberOfLines={2}>
|
|
158
158
|
{title}
|
|
159
159
|
</Text>
|
|
160
|
-
{Boolean(subtitle) && <Text variant="
|
|
160
|
+
{Boolean(subtitle) && <Text variant="tertiary">{subtitle}</Text>}
|
|
161
161
|
</View>
|
|
162
162
|
<View style={styles.rightContent}>
|
|
163
163
|
{isSourceType ? (<Badge label={rightLabel} appearance="neutral" variant="meta"/>) : (<Text numberOfLines={1} style={styles.rightLabelText}>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification_settings_screen.js","sourceRoot":"","sources":["../../src/screens/notification_settings_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC3E,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAkB,MAAM,OAAO,CAAA;AACrE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAkC,MAAM,cAAc,CAAA;AACnG,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAA;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAA;AAEnE,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,IAAK,YAMJ;AAND,WAAK,YAAY;IACf,mDAAM,CAAA;IACN,mDAAM,CAAA;IACN,qDAAO,CAAA;IACP,+CAAI,CAAA;IACJ,+CAAI,CAAA;AACN,CAAC,EANI,YAAY,KAAZ,YAAY,QAMhB;AAwBD,MAAM,UAAU,0BAA0B,CAAC,EAAmC;IAC5E,MAA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J,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,wBAAwB;SAC7C;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { PlatformPressable } from '@react-navigation/elements'\nimport { StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React, { useCallback, useEffect, type ReactNode } from 'react'\nimport { FlatList, Platform, StyleSheet, View, type ViewProps, type ViewStyle } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { Badge, Heading, Icon, Text } from '../components'\nimport { HeaderTextButton } from '../components/display/platform_modal_header_buttons'\nimport { useTheme } from '../hooks'\nimport { isDefined } from '../types'\nimport { useGroups } from './notification_settings/hooks/groups'\nimport { useChatTypes } from './preferred_app/hooks/use_chat_types'\n\n// =========================================\n// ====== Factory Constants & Types ========\n// =========================================\n\nenum SectionTypes {\n header,\n hidden,\n setting,\n view,\n link,\n}\n\ntype SectionListData = Array<\n | DataItem<{ title: string }, SectionTypes.header>\n | DataItem<ViewProps, SectionTypes.view>\n | DataItem<SettingRowProps, SectionTypes.setting>\n | DataItem<LinkRowProps, SectionTypes.link>\n | DataItem<any, SectionTypes.hidden>\n>\n\ninterface DataItem<T, TName extends SectionTypes> {\n type: TName\n data: T\n sectionOuterStyle?: ViewStyle\n sectionInnerStyle?: ViewStyle\n showBottomBorder?: boolean\n}\n\n// =================================\n// ====== Components ===============\n// =================================\n\nexport type NotificationSettingsScreenProps = StaticScreenProps<{}>\n\nexport function NotificationSettingsScreen({}: NotificationSettingsScreenProps) {\n const navigation = useNavigation()\n const styles = useStyles()\n const { data: chatTypes } = useChatTypes()\n const { data: groups } = useGroups()\n\n // Header configuration\n const HeaderRight = useCallback(() => {\n return (\n <HeaderTextButton\n onPress={() => {\n // Save settings logic would go here\n navigation.goBack()\n }}\n title=\"Done\"\n />\n )\n }, [navigation])\n\n useEffect(() => {\n navigation.setOptions({\n headerRight: HeaderRight,\n })\n }, [HeaderRight, navigation])\n\n // Build section data\n const listData = [\n {\n type: SectionTypes.header,\n data: { title: 'Preferred app' },\n sectionInnerStyle: styles.sectionInnerHeader,\n },\n {\n type: SectionTypes.view,\n data: {\n children: (\n <Text variant=\"tertiary\" style={styles.sectionDescription}>\n Choose which app receives each type of chat notification\n </Text>\n ),\n },\n showBottomBorder: true,\n },\n ...chatTypes.map(type => ({\n type: SectionTypes.link,\n data: {\n title: `${type.title} Conversations`,\n rightLabel: type.preferredApp,\n onPress: () =>\n navigation.navigate('PreferredAppSelection', {\n chatTypeId: type.id,\n }),\n },\n sectionInnerStyle: { paddingVertical: 0 },\n showBottomBorder: true,\n })),\n {\n type: groups.length === 0 ? SectionTypes.hidden : SectionTypes.header,\n data: {\n title: 'Manage chat settings',\n },\n sectionInnerStyle: styles.sectionInnerHeader,\n },\n {\n type: groups.length === 0 ? SectionTypes.hidden : SectionTypes.view,\n data: {\n children: (\n <Text variant=\"tertiary\" style={styles.sectionDescription}>\n Notification settings for all of your group, team and event related conversations\n </Text>\n ),\n },\n showBottomBorder: true,\n },\n ...groups.map(group => ({\n type: SectionTypes.link,\n data: {\n title: group.name,\n subtitle: group.myGroupMembership?.notificationLevelDescription,\n rightLabel: group.sourceType,\n onPress: () =>\n navigation.navigate('GroupNotificationSettings', {\n groupId: group.id,\n title: group.name || 'Group',\n }),\n },\n sectionInnerStyle: { paddingVertical: 0 },\n showBottomBorder: true,\n })),\n ].filter(item => item.type !== SectionTypes.hidden)\n\n const headerIndices = listData\n .map(({ type }, index) => (type === SectionTypes.header ? index : undefined))\n .filter(isDefined)\n\n return (\n <View style={styles.listContainer}>\n <FlatList\n data={listData as SectionListData}\n contentContainerStyle={styles.contentContainer}\n renderItem={({ item, index }) => {\n const [isStart, isEnd] = [\n index === 0 || headerIndices.includes(index),\n index === listData.length - 1 || headerIndices.includes(index + 1),\n ]\n\n switch (item.type) {\n case SectionTypes.header:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <Heading variant=\"h2\">{item.data.title}</Heading>\n </ListSection>\n )\n case SectionTypes.setting:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <SettingRow {...item.data} />\n </ListSection>\n )\n case SectionTypes.view:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <View {...item.data} style={item.data.style} />\n </ListSection>\n )\n case SectionTypes.link:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <LinkRow {...item.data} />\n </ListSection>\n )\n case SectionTypes.hidden:\n default:\n return null\n }\n }}\n />\n </View>\n )\n}\n\ninterface ListSectionProps {\n isStart?: boolean\n isEnd?: boolean\n showBottomBorder?: boolean\n outerStyle?: ViewStyle\n innerStyle?: ViewStyle\n children: ReactNode\n}\n\nfunction ListSection({\n isStart,\n isEnd,\n showBottomBorder,\n outerStyle,\n innerStyle,\n children,\n}: ListSectionProps) {\n const styles = useStyles({ isStart, isEnd })\n const bottomBorder = showBottomBorder ? styles.sectionInnerBottomBorder : {}\n\n return (\n <View style={[styles.sectionOuterBase, outerStyle]}>\n <View style={[styles.sectionInnerBase, bottomBorder, innerStyle]}>{children}</View>\n </View>\n )\n}\n\ninterface SettingRowProps {\n title: string\n style?: ViewStyle\n rightItem?: ReactNode\n rightLabel?: string\n rightItemStyle?: ViewStyle\n}\n\nfunction SettingRow({ title, style, rightLabel, rightItem, rightItemStyle = {} }: SettingRowProps) {\n const styles = useStyles()\n\n return (\n <View style={[styles.settingRow, style]}>\n <View style={styles.settingRowContent}>\n <Text variant=\"plain\" style={styles.settingRowText}>\n {title}\n </Text>\n {Boolean(rightLabel) && <Text variant=\"footnote\">{rightLabel}</Text>}\n </View>\n {Boolean(rightItem) && <View style={rightItemStyle}>{rightItem}</View>}\n </View>\n )\n}\n\ninterface LinkRowProps {\n title: string\n subtitle?: string\n rightLabel: string\n onPress: () => void\n}\n\nfunction LinkRow({ title, subtitle, rightLabel, onPress }: LinkRowProps) {\n const styles = useLinkRowStyles()\n const isSourceType = rightLabel === 'Team' || rightLabel === 'Group' || rightLabel === 'PlanTeam'\n\n return (\n <PlatformPressable\n style={styles.row}\n onPress={onPress}\n accessibilityRole=\"link\"\n accessibilityLabel={title}\n accessibilityHint={`Navigate to ${title} settings`}\n >\n <View style={styles.innerContainer}>\n <View style={styles.leftContent}>\n <Text style={styles.title} numberOfLines={2}>\n {title}\n </Text>\n {Boolean(subtitle) && <Text variant=\"footnote\">{subtitle}</Text>}\n </View>\n <View style={styles.rightContent}>\n {isSourceType ? (\n <Badge label={rightLabel} appearance=\"neutral\" variant=\"meta\" />\n ) : (\n <Text numberOfLines={1} style={styles.rightLabelText}>\n {rightLabel}\n </Text>\n )}\n {Platform.OS === 'ios' && (\n <Icon name=\"general.rightChevron\" size={16} style={styles.icon} />\n )}\n </View>\n </View>\n </PlatformPressable>\n )\n}\n\n// =================================\n// ====== Styles ===================\n// =================================\n\nconst useStyles = ({}: { isStart?: boolean; isEnd?: boolean } = {}) => {\n const { colors } = useTheme()\n const { bottom } = useSafeAreaInsets()\n const headerBottomPadding = 0\n\n return StyleSheet.create({\n listContainer: {\n flex: 1,\n },\n contentContainer: {\n paddingBottom: bottom,\n },\n sectionOuterBase: {\n paddingLeft: 16,\n },\n sectionInnerBase: {\n paddingRight: 16,\n paddingVertical: 16,\n },\n sectionInnerHeader: {\n paddingTop: 24,\n paddingBottom: headerBottomPadding,\n },\n sectionInnerBottomBorder: {\n borderBottomColor: colors.borderColorDefaultBase,\n borderBottomWidth: 1,\n },\n sectionDescription: {\n color: colors.textColorDefaultSecondary,\n },\n settingRow: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n gap: 8,\n },\n settingRowContent: {\n flex: 1,\n },\n settingRowText: {\n lineHeight: 20,\n },\n })\n}\n\nconst useLinkRowStyles = () => {\n const theme = useTheme()\n\n return StyleSheet.create({\n row: {\n paddingLeft: 0,\n paddingVertical: 16,\n },\n innerContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: 12,\n },\n leftContent: {\n flex: 1,\n gap: 4,\n },\n rightContent: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 8,\n },\n title: {},\n rightLabelText: {\n color: theme.colors.textColorDefaultSecondary,\n },\n icon: {\n color: theme.colors.iconColorDefaultDisabled,\n },\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"notification_settings_screen.js","sourceRoot":"","sources":["../../src/screens/notification_settings_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC3E,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAkB,MAAM,OAAO,CAAA;AACrE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAkC,MAAM,cAAc,CAAA;AACnG,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAA;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAA;AAEnE,4CAA4C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AAI,EAAE,CAAC;YACP,GAAG,EAAE,CAAC;SACP;QACD,YAAY,EAAE;YACZ,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,CAAC;SACP;QACD,KAAK,EAAE,EAAE;QACT,cAAc,EAAE;YACd,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,yBAAyB;SAC9C;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,wBAAwB;SAC7C;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { PlatformPressable } from '@react-navigation/elements'\nimport { StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React, { useCallback, useEffect, type ReactNode } from 'react'\nimport { FlatList, Platform, StyleSheet, View, type ViewProps, type ViewStyle } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { Badge, Heading, Icon, Text } from '../components'\nimport { HeaderTextButton } from '../components/display/platform_modal_header_buttons'\nimport { useTheme } from '../hooks'\nimport { isDefined } from '../types'\nimport { useGroups } from './notification_settings/hooks/groups'\nimport { useChatTypes } from './preferred_app/hooks/use_chat_types'\n\n// =========================================\n// ====== Factory Constants & Types ========\n// =========================================\n\nenum SectionTypes {\n header,\n hidden,\n setting,\n view,\n link,\n}\n\ntype SectionListData = Array<\n | DataItem<{ title: string }, SectionTypes.header>\n | DataItem<ViewProps, SectionTypes.view>\n | DataItem<SettingRowProps, SectionTypes.setting>\n | DataItem<LinkRowProps, SectionTypes.link>\n | DataItem<any, SectionTypes.hidden>\n>\n\ninterface DataItem<T, TName extends SectionTypes> {\n type: TName\n data: T\n sectionOuterStyle?: ViewStyle\n sectionInnerStyle?: ViewStyle\n showBottomBorder?: boolean\n}\n\n// =================================\n// ====== Components ===============\n// =================================\n\nexport type NotificationSettingsScreenProps = StaticScreenProps<{}>\n\nexport function NotificationSettingsScreen({}: NotificationSettingsScreenProps) {\n const navigation = useNavigation()\n const styles = useStyles()\n const { data: chatTypes } = useChatTypes()\n const { data: groups } = useGroups()\n\n // Header configuration\n const HeaderRight = useCallback(() => {\n return (\n <HeaderTextButton\n onPress={() => {\n // Save settings logic would go here\n navigation.goBack()\n }}\n title=\"Done\"\n />\n )\n }, [navigation])\n\n useEffect(() => {\n navigation.setOptions({\n headerRight: HeaderRight,\n })\n }, [HeaderRight, navigation])\n\n // Build section data\n const listData = [\n {\n type: SectionTypes.header,\n data: { title: 'Preferred app' },\n sectionInnerStyle: styles.sectionInnerHeader,\n },\n {\n type: SectionTypes.view,\n data: {\n children: (\n <Text variant=\"tertiary\" style={styles.sectionDescription}>\n Choose which app receives each type of chat notification\n </Text>\n ),\n },\n showBottomBorder: true,\n },\n ...chatTypes.map(type => ({\n type: SectionTypes.link,\n data: {\n title: `${type.title} conversations`,\n rightLabel: type.preferredApp,\n onPress: () =>\n navigation.navigate('PreferredAppSelection', {\n chatTypeId: type.id,\n }),\n },\n sectionInnerStyle: { paddingVertical: 0 },\n showBottomBorder: true,\n })),\n {\n type: groups.length === 0 ? SectionTypes.hidden : SectionTypes.header,\n data: {\n title: 'Manage chat settings',\n },\n sectionInnerStyle: styles.sectionInnerHeader,\n },\n {\n type: groups.length === 0 ? SectionTypes.hidden : SectionTypes.view,\n data: {\n children: (\n <Text variant=\"tertiary\" style={styles.sectionDescription}>\n Notification settings for all of your group, team and event related conversations\n </Text>\n ),\n },\n showBottomBorder: true,\n },\n ...groups.map(group => ({\n type: SectionTypes.link,\n data: {\n title: group.name,\n subtitle: group.myGroupMembership?.notificationLevelDescription,\n rightLabel: group.sourceType,\n onPress: () =>\n navigation.navigate('GroupNotificationSettings', {\n groupId: group.id,\n title: group.name || 'Group',\n }),\n },\n sectionInnerStyle: { paddingVertical: 0 },\n showBottomBorder: true,\n })),\n ].filter(item => item.type !== SectionTypes.hidden)\n\n const headerIndices = listData\n .map(({ type }, index) => (type === SectionTypes.header ? index : undefined))\n .filter(isDefined)\n\n return (\n <View style={styles.listContainer}>\n <FlatList\n data={listData as SectionListData}\n contentContainerStyle={styles.contentContainer}\n renderItem={({ item, index }) => {\n const [isStart, isEnd] = [\n index === 0 || headerIndices.includes(index),\n index === listData.length - 1 || headerIndices.includes(index + 1),\n ]\n\n switch (item.type) {\n case SectionTypes.header:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <Heading variant=\"h2\">{item.data.title}</Heading>\n </ListSection>\n )\n case SectionTypes.setting:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <SettingRow {...item.data} />\n </ListSection>\n )\n case SectionTypes.view:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <View {...item.data} style={item.data.style} />\n </ListSection>\n )\n case SectionTypes.link:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <LinkRow {...item.data} />\n </ListSection>\n )\n case SectionTypes.hidden:\n default:\n return null\n }\n }}\n />\n </View>\n )\n}\n\ninterface ListSectionProps {\n isStart?: boolean\n isEnd?: boolean\n showBottomBorder?: boolean\n outerStyle?: ViewStyle\n innerStyle?: ViewStyle\n children: ReactNode\n}\n\nfunction ListSection({\n isStart,\n isEnd,\n showBottomBorder,\n outerStyle,\n innerStyle,\n children,\n}: ListSectionProps) {\n const styles = useStyles({ isStart, isEnd })\n const bottomBorder = showBottomBorder ? styles.sectionInnerBottomBorder : {}\n\n return (\n <View style={[styles.sectionOuterBase, outerStyle]}>\n <View style={[styles.sectionInnerBase, bottomBorder, innerStyle]}>{children}</View>\n </View>\n )\n}\n\ninterface SettingRowProps {\n title: string\n style?: ViewStyle\n rightItem?: ReactNode\n rightLabel?: string\n rightItemStyle?: ViewStyle\n}\n\nfunction SettingRow({ title, style, rightLabel, rightItem, rightItemStyle = {} }: SettingRowProps) {\n const styles = useStyles()\n\n return (\n <View style={[styles.settingRow, style]}>\n <View style={styles.settingRowContent}>\n <Text variant=\"plain\" style={styles.settingRowText}>\n {title}\n </Text>\n {Boolean(rightLabel) && <Text variant=\"footnote\">{rightLabel}</Text>}\n </View>\n {Boolean(rightItem) && <View style={rightItemStyle}>{rightItem}</View>}\n </View>\n )\n}\n\ninterface LinkRowProps {\n title: string\n subtitle?: string\n rightLabel: string\n onPress: () => void\n}\n\nfunction LinkRow({ title, subtitle, rightLabel, onPress }: LinkRowProps) {\n const styles = useLinkRowStyles()\n const isSourceType = rightLabel === 'Team' || rightLabel === 'Group' || rightLabel === 'PlanTeam'\n\n return (\n <PlatformPressable\n style={styles.row}\n onPress={onPress}\n accessibilityRole=\"link\"\n accessibilityLabel={title}\n accessibilityHint={`Navigate to ${title} settings`}\n >\n <View style={styles.innerContainer}>\n <View style={styles.leftContent}>\n <Text style={styles.title} numberOfLines={2}>\n {title}\n </Text>\n {Boolean(subtitle) && <Text variant=\"tertiary\">{subtitle}</Text>}\n </View>\n <View style={styles.rightContent}>\n {isSourceType ? (\n <Badge label={rightLabel} appearance=\"neutral\" variant=\"meta\" />\n ) : (\n <Text numberOfLines={1} style={styles.rightLabelText}>\n {rightLabel}\n </Text>\n )}\n {Platform.OS === 'ios' && (\n <Icon name=\"general.rightChevron\" size={16} style={styles.icon} />\n )}\n </View>\n </View>\n </PlatformPressable>\n )\n}\n\n// =================================\n// ====== Styles ===================\n// =================================\n\nconst useStyles = ({}: { isStart?: boolean; isEnd?: boolean } = {}) => {\n const { colors } = useTheme()\n const { bottom } = useSafeAreaInsets()\n const headerBottomPadding = 0\n\n return StyleSheet.create({\n listContainer: {\n flex: 1,\n },\n contentContainer: {\n paddingBottom: bottom,\n },\n sectionOuterBase: {\n paddingLeft: 16,\n },\n sectionInnerBase: {\n paddingRight: 16,\n paddingVertical: 16,\n },\n sectionInnerHeader: {\n paddingTop: 24,\n paddingBottom: headerBottomPadding,\n },\n sectionInnerBottomBorder: {\n borderBottomColor: colors.borderColorDefaultBase,\n borderBottomWidth: 1,\n },\n sectionDescription: {\n color: colors.textColorDefaultSecondary,\n },\n settingRow: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n gap: 8,\n },\n settingRowContent: {\n flex: 1,\n },\n settingRowText: {\n lineHeight: 20,\n },\n })\n}\n\nconst useLinkRowStyles = () => {\n const theme = useTheme()\n\n return StyleSheet.create({\n row: {\n paddingLeft: 0,\n paddingVertical: 16,\n },\n innerContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: 12,\n },\n leftContent: {\n flex: 1,\n gap: 4,\n },\n rightContent: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 8,\n },\n title: {},\n rightLabelText: {\n color: theme.colors.textColorDefaultSecondary,\n },\n icon: {\n color: theme.colors.iconColorDefaultDisabled,\n },\n })\n}\n"]}
|
|
@@ -29,10 +29,10 @@ export function PreferredAppSelectionScreen({ route }) {
|
|
|
29
29
|
const handleSelection = (app) => {
|
|
30
30
|
updateChatType(app);
|
|
31
31
|
};
|
|
32
|
-
const sectionTitle = `${chatType?.title}
|
|
32
|
+
const sectionTitle = `${chatType?.title} conversations`;
|
|
33
33
|
return (<View style={styles.container}>
|
|
34
34
|
<View style={styles.section}>
|
|
35
|
-
<Heading variant="
|
|
35
|
+
<Heading variant="h2" style={styles.sectionHeading}>
|
|
36
36
|
{sectionTitle}
|
|
37
37
|
</Heading>
|
|
38
38
|
{preferredAppOptions?.sort(sortPreferredApp('asc')).map((option, key) => (<PressableRow key={`${key}-${option}`} isActive={chatType?.preferredApp === option} onPress={() => handleSelection(option)}>
|
|
@@ -80,7 +80,7 @@ const styles = StyleSheet.create({
|
|
|
80
80
|
flex: 1,
|
|
81
81
|
},
|
|
82
82
|
section: {
|
|
83
|
-
paddingTop:
|
|
83
|
+
paddingTop: 24,
|
|
84
84
|
},
|
|
85
85
|
sectionHeading: {
|
|
86
86
|
paddingHorizontal: 16,
|