@planningcenter/chat-react-native 4.7.0 → 4.7.1-qa-staging.0
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/build/components/conversations/conversation_actions.d.ts.map +1 -1
- package/build/components/conversations/conversation_actions.js +322 -186
- package/build/components/conversations/conversation_actions.js.map +1 -1
- package/build/components/display/toast.d.ts +3 -0
- package/build/components/display/toast.d.ts.map +1 -0
- package/build/components/display/toast.js +224 -0
- package/build/components/display/toast.js.map +1 -0
- package/build/components/group_conversation_list.d.ts.map +1 -1
- package/build/components/group_conversation_list.js +1 -0
- package/build/components/group_conversation_list.js.map +1 -1
- package/build/contexts/conversations_context.d.ts +3 -1
- package/build/contexts/conversations_context.d.ts.map +1 -1
- package/build/contexts/conversations_context.js +32 -27
- package/build/contexts/conversations_context.js.map +1 -1
- package/build/hooks/use_conversation.d.ts.map +1 -1
- package/build/hooks/use_conversation.js +1 -1
- package/build/hooks/use_conversation.js.map +1 -1
- package/build/hooks/use_features.d.ts +1 -0
- package/build/hooks/use_features.d.ts.map +1 -1
- package/build/hooks/use_features.js +2 -1
- package/build/hooks/use_features.js.map +1 -1
- package/build/hooks/use_hide_conversation.d.ts +107 -0
- package/build/hooks/use_hide_conversation.d.ts.map +1 -0
- package/build/hooks/use_hide_conversation.js +238 -0
- package/build/hooks/use_hide_conversation.js.map +1 -0
- package/build/hooks/use_hide_conversations_enabled.d.ts +2 -0
- package/build/hooks/use_hide_conversations_enabled.d.ts.map +1 -0
- package/build/hooks/use_hide_conversations_enabled.js +18 -0
- package/build/hooks/use_hide_conversations_enabled.js.map +1 -0
- package/build/navigation/index.d.ts +5 -0
- package/build/navigation/index.d.ts.map +1 -1
- package/build/navigation/index.js +5 -0
- package/build/navigation/index.js.map +1 -1
- package/build/screens/conversation_actions_screen.d.ts +7 -0
- package/build/screens/conversation_actions_screen.d.ts.map +1 -0
- package/build/screens/conversation_actions_screen.js +89 -0
- package/build/screens/conversation_actions_screen.js.map +1 -0
- package/build/screens/conversation_details_screen.d.ts.map +1 -1
- package/build/screens/conversation_details_screen.js +460 -394
- package/build/screens/conversation_details_screen.js.map +1 -1
- package/build/screens/conversations/conversations_screen.d.ts.map +1 -1
- package/build/screens/conversations/conversations_screen.js +18 -10
- package/build/screens/conversations/conversations_screen.js.map +1 -1
- package/build/screens/index.d.ts +1 -0
- package/build/screens/index.d.ts.map +1 -1
- package/build/screens/index.js +1 -0
- package/build/screens/index.js.map +1 -1
- package/build/types/resources/conversation_membership.d.ts +1 -0
- package/build/types/resources/conversation_membership.d.ts.map +1 -1
- package/build/types/resources/conversation_membership.js.map +1 -1
- package/build/utils/toast_store.d.ts +21 -0
- package/build/utils/toast_store.d.ts.map +1 -0
- package/build/utils/toast_store.js +27 -0
- package/build/utils/toast_store.js.map +1 -0
- package/package.json +3 -3
- package/src/components/conversations/__tests__/conversation_actions.test.tsx +76 -2
- package/src/components/conversations/conversation_actions.tsx +68 -4
- package/src/components/display/__tests__/toast.test.tsx +55 -0
- package/src/components/display/toast.tsx +115 -0
- package/src/components/group_conversation_list.tsx +4 -1
- package/src/contexts/conversations_context.tsx +6 -1
- package/src/hooks/__tests__/use_hide_conversation.test.tsx +147 -0
- package/src/hooks/use_conversation.ts +1 -0
- package/src/hooks/use_features.ts +1 -0
- package/src/hooks/use_hide_conversation.ts +118 -0
- package/src/hooks/use_hide_conversations_enabled.ts +7 -0
- package/src/navigation/index.tsx +8 -0
- package/src/screens/__tests__/conversation_actions_screen.test.tsx +79 -0
- package/src/screens/__tests__/conversation_details_screen.test.tsx +49 -1
- package/src/screens/conversation_actions_screen.tsx +53 -0
- package/src/screens/conversation_details_screen.tsx +19 -0
- package/src/screens/conversations/__tests__/conversations_screen.test.tsx +1 -0
- package/src/screens/conversations/conversations_screen.tsx +2 -0
- package/src/screens/index.ts +1 -0
- package/src/types/resources/conversation_membership.ts +1 -0
- package/src/utils/toast_store.ts +45 -0
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { useNavigation } from '@react-navigation/native';
|
|
2
3
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
4
|
import { Platform, Pressable, StyleSheet, View } from 'react-native';
|
|
4
5
|
import ReanimatedSwipeable from 'react-native-gesture-handler/ReanimatedSwipeable';
|
|
5
6
|
import { useConversationsContext } from '../../contexts/conversations_context';
|
|
6
7
|
import { useTheme, useCreateAndroidRippleColor } from '../../hooks';
|
|
7
8
|
import { useConversationsMarkRead, useConversationsMute } from '../../hooks/use_conversations_actions';
|
|
9
|
+
import { useHideConversation } from '../../hooks/use_hide_conversation';
|
|
10
|
+
import { useHideConversationsEnabled } from '../../hooks/use_hide_conversations_enabled';
|
|
8
11
|
import { isArchivedConversation, platformPressedOpacityStyle } from '../../utils';
|
|
12
|
+
import { Haptic } from '../../utils/native_adapters';
|
|
9
13
|
import { tokens } from '../../vendor/tapestry/tokens';
|
|
10
14
|
import { SwipeableToggleButton } from './swipeable_toggle_button';
|
|
11
15
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
16
|
export function ConversationActions(t0) {
|
|
13
|
-
const $ = _c(
|
|
17
|
+
const $ = _c(89);
|
|
14
18
|
const {
|
|
15
19
|
children,
|
|
16
20
|
conversation,
|
|
@@ -19,10 +23,12 @@ export function ConversationActions(t0) {
|
|
|
19
23
|
accessibilityLabel
|
|
20
24
|
} = t0;
|
|
21
25
|
const swipeableRef = useRef(null);
|
|
26
|
+
const navigation = useNavigation();
|
|
22
27
|
const styles = useStyles();
|
|
23
28
|
const {
|
|
24
29
|
activeConversationId,
|
|
25
|
-
setActiveConversationId
|
|
30
|
+
setActiveConversationId,
|
|
31
|
+
hideable
|
|
26
32
|
} = useConversationsContext();
|
|
27
33
|
const [disabled, setDisabled] = useState(false);
|
|
28
34
|
const overshootLeft = Platform.OS === "ios";
|
|
@@ -67,253 +73,344 @@ export function ConversationActions(t0) {
|
|
|
67
73
|
markRead,
|
|
68
74
|
isPending: isMarkReadPending
|
|
69
75
|
} = useConversationsMarkRead(t3);
|
|
70
|
-
const isConversationEmpty = conversation.lastMessageCreatedAt === null;
|
|
71
76
|
let t4;
|
|
72
77
|
if ($[6] !== conversation) {
|
|
73
|
-
t4 =
|
|
78
|
+
t4 = {
|
|
79
|
+
conversation
|
|
80
|
+
};
|
|
74
81
|
$[6] = conversation;
|
|
75
82
|
$[7] = t4;
|
|
76
83
|
} else {
|
|
77
84
|
t4 = $[7];
|
|
78
85
|
}
|
|
79
|
-
const
|
|
86
|
+
const {
|
|
87
|
+
hidden,
|
|
88
|
+
setHidden,
|
|
89
|
+
isPending: isHiddenPending
|
|
90
|
+
} = useHideConversation(t4);
|
|
91
|
+
const hideConversationsEnabled = useHideConversationsEnabled();
|
|
92
|
+
const isConversationEmpty = conversation.lastMessageCreatedAt === null;
|
|
80
93
|
let t5;
|
|
81
|
-
if ($[8]
|
|
82
|
-
t5 = ()
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
};
|
|
86
|
-
$[8] = t5;
|
|
94
|
+
if ($[8] !== conversation) {
|
|
95
|
+
t5 = isArchivedConversation(conversation);
|
|
96
|
+
$[8] = conversation;
|
|
97
|
+
$[9] = t5;
|
|
87
98
|
} else {
|
|
88
|
-
t5 = $[
|
|
99
|
+
t5 = $[9];
|
|
89
100
|
}
|
|
90
|
-
const
|
|
101
|
+
const canMute = !t5;
|
|
91
102
|
let t6;
|
|
92
|
-
if ($[
|
|
93
|
-
t6 = ()
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
$[
|
|
98
|
-
$[10] = setActiveConversationId;
|
|
99
|
-
$[11] = t6;
|
|
103
|
+
if ($[10] !== conversation || $[11] !== hideConversationsEnabled || $[12] !== hideable) {
|
|
104
|
+
t6 = hideable && hideConversationsEnabled && !isArchivedConversation(conversation);
|
|
105
|
+
$[10] = conversation;
|
|
106
|
+
$[11] = hideConversationsEnabled;
|
|
107
|
+
$[12] = hideable;
|
|
108
|
+
$[13] = t6;
|
|
100
109
|
} else {
|
|
101
|
-
t6 = $[
|
|
110
|
+
t6 = $[13];
|
|
102
111
|
}
|
|
103
|
-
const
|
|
112
|
+
const canHide = t6;
|
|
104
113
|
let t7;
|
|
105
|
-
if ($[
|
|
114
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
106
115
|
t7 = () => {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
onPress();
|
|
116
|
+
setDisabled(false);
|
|
117
|
+
swipeableRef.current?.close();
|
|
111
118
|
};
|
|
112
|
-
$[12] = disabled;
|
|
113
|
-
$[13] = onPress;
|
|
114
119
|
$[14] = t7;
|
|
115
120
|
} else {
|
|
116
121
|
t7 = $[14];
|
|
117
122
|
}
|
|
118
|
-
const
|
|
123
|
+
const handleSwipeableClose = t7;
|
|
119
124
|
let t8;
|
|
120
|
-
if ($[15] !==
|
|
125
|
+
if ($[15] !== conversation.id || $[16] !== setActiveConversationId) {
|
|
121
126
|
t8 = () => {
|
|
122
|
-
|
|
123
|
-
|
|
127
|
+
setDisabled(true);
|
|
128
|
+
setActiveConversationId(conversation.id);
|
|
124
129
|
};
|
|
125
|
-
$[15] =
|
|
126
|
-
$[16] =
|
|
130
|
+
$[15] = conversation.id;
|
|
131
|
+
$[16] = setActiveConversationId;
|
|
127
132
|
$[17] = t8;
|
|
128
133
|
} else {
|
|
129
134
|
t8 = $[17];
|
|
130
135
|
}
|
|
131
|
-
const
|
|
136
|
+
const handleSwipeableOpen = t8;
|
|
132
137
|
let t9;
|
|
133
|
-
if ($[18] !==
|
|
138
|
+
if ($[18] !== disabled || $[19] !== onPress) {
|
|
134
139
|
t9 = () => {
|
|
135
|
-
|
|
136
|
-
|
|
140
|
+
if (disabled || !onPress) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
onPress();
|
|
137
144
|
};
|
|
138
|
-
$[18] =
|
|
139
|
-
$[19] =
|
|
145
|
+
$[18] = disabled;
|
|
146
|
+
$[19] = onPress;
|
|
140
147
|
$[20] = t9;
|
|
141
148
|
} else {
|
|
142
149
|
t9 = $[20];
|
|
143
150
|
}
|
|
144
|
-
const
|
|
151
|
+
const handlePress = t9;
|
|
145
152
|
let t10;
|
|
146
|
-
if ($[21] !==
|
|
147
|
-
t10 =
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
$[21] =
|
|
152
|
-
$[22] =
|
|
153
|
+
if ($[21] !== muted || $[22] !== setMuted) {
|
|
154
|
+
t10 = () => {
|
|
155
|
+
setMuted(!muted);
|
|
156
|
+
handleSwipeableClose();
|
|
157
|
+
};
|
|
158
|
+
$[21] = muted;
|
|
159
|
+
$[22] = setMuted;
|
|
153
160
|
$[23] = t10;
|
|
154
161
|
} else {
|
|
155
162
|
t10 = $[23];
|
|
156
163
|
}
|
|
157
|
-
const
|
|
164
|
+
const handleMute = t10;
|
|
158
165
|
let t11;
|
|
159
|
-
if ($[24] !==
|
|
160
|
-
t11 =
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
$[24] =
|
|
165
|
-
$[25] =
|
|
166
|
+
if ($[24] !== hidden || $[25] !== setHidden) {
|
|
167
|
+
t11 = () => {
|
|
168
|
+
setHidden(!hidden);
|
|
169
|
+
handleSwipeableClose();
|
|
170
|
+
};
|
|
171
|
+
$[24] = hidden;
|
|
172
|
+
$[25] = setHidden;
|
|
166
173
|
$[26] = t11;
|
|
167
174
|
} else {
|
|
168
175
|
t11 = $[26];
|
|
169
176
|
}
|
|
170
|
-
const
|
|
177
|
+
const handleHide = t11;
|
|
171
178
|
let t12;
|
|
172
|
-
if ($[27] !==
|
|
173
|
-
t12 =
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
179
|
+
if ($[27] !== conversation.id || $[28] !== disabled || $[29] !== navigation) {
|
|
180
|
+
t12 = () => {
|
|
181
|
+
if (disabled) {
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
Haptic.impactLight();
|
|
185
|
+
navigation.navigate("ConversationActions", {
|
|
186
|
+
conversation_id: conversation.id
|
|
187
|
+
});
|
|
188
|
+
};
|
|
189
|
+
$[27] = conversation.id;
|
|
190
|
+
$[28] = disabled;
|
|
191
|
+
$[29] = navigation;
|
|
192
|
+
$[30] = t12;
|
|
177
193
|
} else {
|
|
178
|
-
t12 = $[
|
|
194
|
+
t12 = $[30];
|
|
179
195
|
}
|
|
180
|
-
const
|
|
196
|
+
const handleLongPress = t12;
|
|
181
197
|
let t13;
|
|
182
|
-
if ($[
|
|
183
|
-
t13 =
|
|
184
|
-
|
|
198
|
+
if ($[31] !== markRead || $[32] !== read) {
|
|
199
|
+
t13 = () => {
|
|
200
|
+
markRead(!read);
|
|
201
|
+
handleSwipeableClose();
|
|
202
|
+
};
|
|
203
|
+
$[31] = markRead;
|
|
204
|
+
$[32] = read;
|
|
205
|
+
$[33] = t13;
|
|
206
|
+
} else {
|
|
207
|
+
t13 = $[33];
|
|
208
|
+
}
|
|
209
|
+
const handleLatestMessageUnread = t13;
|
|
210
|
+
let t14;
|
|
211
|
+
if ($[34] !== isConversationEmpty || $[35] !== read) {
|
|
212
|
+
t14 = !isConversationEmpty ? [{
|
|
213
|
+
name: read ? "markUnread" : "markRead",
|
|
214
|
+
label: read ? "Mark unread" : "Mark read"
|
|
215
|
+
}] : [];
|
|
216
|
+
$[34] = isConversationEmpty;
|
|
217
|
+
$[35] = read;
|
|
218
|
+
$[36] = t14;
|
|
219
|
+
} else {
|
|
220
|
+
t14 = $[36];
|
|
221
|
+
}
|
|
222
|
+
const readAccessibilityAction = t14;
|
|
223
|
+
let t15;
|
|
224
|
+
if ($[37] !== canMute || $[38] !== muted) {
|
|
225
|
+
t15 = canMute ? [{
|
|
226
|
+
name: muted ? "unmute" : "mute",
|
|
227
|
+
label: muted ? "Enable" : "Silence"
|
|
228
|
+
}] : [];
|
|
229
|
+
$[37] = canMute;
|
|
230
|
+
$[38] = muted;
|
|
231
|
+
$[39] = t15;
|
|
232
|
+
} else {
|
|
233
|
+
t15 = $[39];
|
|
234
|
+
}
|
|
235
|
+
const muteAccessibilityAction = t15;
|
|
236
|
+
let t16;
|
|
237
|
+
if ($[40] !== canHide || $[41] !== hidden) {
|
|
238
|
+
t16 = canHide ? [{
|
|
239
|
+
name: hidden ? "unhide" : "hide",
|
|
240
|
+
label: hidden ? "Unhide" : "Hide"
|
|
241
|
+
}] : [];
|
|
242
|
+
$[40] = canHide;
|
|
243
|
+
$[41] = hidden;
|
|
244
|
+
$[42] = t16;
|
|
245
|
+
} else {
|
|
246
|
+
t16 = $[42];
|
|
247
|
+
}
|
|
248
|
+
const hideAccessibilityAction = t16;
|
|
249
|
+
let t17;
|
|
250
|
+
if ($[43] !== hideAccessibilityAction || $[44] !== muteAccessibilityAction || $[45] !== readAccessibilityAction) {
|
|
251
|
+
t17 = [...muteAccessibilityAction, ...hideAccessibilityAction, ...readAccessibilityAction];
|
|
252
|
+
$[43] = hideAccessibilityAction;
|
|
253
|
+
$[44] = muteAccessibilityAction;
|
|
254
|
+
$[45] = readAccessibilityAction;
|
|
255
|
+
$[46] = t17;
|
|
256
|
+
} else {
|
|
257
|
+
t17 = $[46];
|
|
258
|
+
}
|
|
259
|
+
const accessibilityActions = t17;
|
|
260
|
+
let t18;
|
|
261
|
+
if ($[47] !== handleHide || $[48] !== handleLatestMessageUnread || $[49] !== handleMute) {
|
|
262
|
+
t18 = event => {
|
|
263
|
+
bb70: switch (event.nativeEvent.actionName) {
|
|
185
264
|
case "markRead":
|
|
186
265
|
{
|
|
187
266
|
handleLatestMessageUnread();
|
|
188
|
-
break
|
|
267
|
+
break bb70;
|
|
189
268
|
}
|
|
190
269
|
case "markUnread":
|
|
191
270
|
{
|
|
192
271
|
handleLatestMessageUnread();
|
|
193
|
-
break
|
|
272
|
+
break bb70;
|
|
194
273
|
}
|
|
195
274
|
case "mute":
|
|
196
275
|
{
|
|
197
276
|
handleMute();
|
|
198
|
-
break
|
|
277
|
+
break bb70;
|
|
199
278
|
}
|
|
200
279
|
case "unmute":
|
|
201
280
|
{
|
|
202
281
|
handleMute();
|
|
282
|
+
break bb70;
|
|
283
|
+
}
|
|
284
|
+
case "hide":
|
|
285
|
+
case "unhide":
|
|
286
|
+
{
|
|
287
|
+
handleHide();
|
|
203
288
|
}
|
|
204
289
|
}
|
|
205
290
|
};
|
|
206
|
-
$[
|
|
207
|
-
$[
|
|
208
|
-
$[
|
|
291
|
+
$[47] = handleHide;
|
|
292
|
+
$[48] = handleLatestMessageUnread;
|
|
293
|
+
$[49] = handleMute;
|
|
294
|
+
$[50] = t18;
|
|
209
295
|
} else {
|
|
210
|
-
|
|
296
|
+
t18 = $[50];
|
|
211
297
|
}
|
|
212
|
-
const handleAccessibilityAction =
|
|
213
|
-
let
|
|
214
|
-
let
|
|
215
|
-
if ($[
|
|
216
|
-
|
|
298
|
+
const handleAccessibilityAction = t18;
|
|
299
|
+
let t19;
|
|
300
|
+
let t20;
|
|
301
|
+
if ($[51] !== activeConversationId || $[52] !== conversation.id) {
|
|
302
|
+
t19 = () => {
|
|
217
303
|
if (activeConversationId === conversation.id) {
|
|
218
304
|
return;
|
|
219
305
|
}
|
|
220
306
|
handleSwipeableClose();
|
|
221
307
|
};
|
|
222
|
-
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
225
|
-
$[
|
|
226
|
-
$[
|
|
308
|
+
t20 = [activeConversationId, conversation.id, handleSwipeableClose];
|
|
309
|
+
$[51] = activeConversationId;
|
|
310
|
+
$[52] = conversation.id;
|
|
311
|
+
$[53] = t19;
|
|
312
|
+
$[54] = t20;
|
|
227
313
|
} else {
|
|
228
|
-
|
|
229
|
-
|
|
314
|
+
t19 = $[53];
|
|
315
|
+
t20 = $[54];
|
|
230
316
|
}
|
|
231
|
-
useEffect(
|
|
232
|
-
let
|
|
233
|
-
if ($[
|
|
234
|
-
|
|
235
|
-
$[
|
|
317
|
+
useEffect(t19, t20);
|
|
318
|
+
let t21;
|
|
319
|
+
if ($[55] === Symbol.for("react.memo_cache_sentinel")) {
|
|
320
|
+
t21 = () => setDisabled(false);
|
|
321
|
+
$[55] = t21;
|
|
236
322
|
} else {
|
|
237
|
-
|
|
323
|
+
t21 = $[55];
|
|
238
324
|
}
|
|
239
|
-
let
|
|
240
|
-
if ($[
|
|
241
|
-
|
|
325
|
+
let t22;
|
|
326
|
+
if ($[56] !== canHide || $[57] !== canMute || $[58] !== handleHide || $[59] !== handleLatestMessageUnread || $[60] !== handleMute || $[61] !== hidden || $[62] !== isConversationEmpty || $[63] !== isHiddenPending || $[64] !== isMarkReadPending || $[65] !== isMutedPending || $[66] !== muted || $[67] !== read) {
|
|
327
|
+
t22 = () => /*#__PURE__*/_jsx(LeftActions, {
|
|
242
328
|
isConversationEmpty: isConversationEmpty,
|
|
243
329
|
canMute: canMute,
|
|
330
|
+
canHide: canHide,
|
|
244
331
|
handleMute: handleMute,
|
|
332
|
+
handleHide: handleHide,
|
|
245
333
|
handleLatestMessageUnread: handleLatestMessageUnread,
|
|
246
334
|
muted: muted,
|
|
335
|
+
hidden: hidden,
|
|
247
336
|
read: read,
|
|
248
337
|
isMutedPending: isMutedPending,
|
|
338
|
+
isHiddenPending: isHiddenPending,
|
|
249
339
|
isMarkReadPending: isMarkReadPending
|
|
250
340
|
});
|
|
251
|
-
$[
|
|
252
|
-
$[
|
|
253
|
-
$[
|
|
254
|
-
$[
|
|
255
|
-
$[
|
|
256
|
-
$[
|
|
257
|
-
$[
|
|
258
|
-
$[
|
|
259
|
-
$[
|
|
341
|
+
$[56] = canHide;
|
|
342
|
+
$[57] = canMute;
|
|
343
|
+
$[58] = handleHide;
|
|
344
|
+
$[59] = handleLatestMessageUnread;
|
|
345
|
+
$[60] = handleMute;
|
|
346
|
+
$[61] = hidden;
|
|
347
|
+
$[62] = isConversationEmpty;
|
|
348
|
+
$[63] = isHiddenPending;
|
|
349
|
+
$[64] = isMarkReadPending;
|
|
350
|
+
$[65] = isMutedPending;
|
|
351
|
+
$[66] = muted;
|
|
352
|
+
$[67] = read;
|
|
353
|
+
$[68] = t22;
|
|
260
354
|
} else {
|
|
261
|
-
|
|
355
|
+
t22 = $[68];
|
|
262
356
|
}
|
|
263
|
-
const
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
357
|
+
const t23 = `conversation-${conversation.id}`;
|
|
358
|
+
const t24 = canHide ? handleLongPress : undefined;
|
|
359
|
+
let t25;
|
|
360
|
+
if ($[69] !== style) {
|
|
361
|
+
t25 = t26 => {
|
|
267
362
|
const {
|
|
268
363
|
pressed
|
|
269
|
-
} =
|
|
364
|
+
} = t26;
|
|
270
365
|
return [style, pressed && platformPressedOpacityStyle];
|
|
271
366
|
};
|
|
272
|
-
$[
|
|
273
|
-
$[
|
|
367
|
+
$[69] = style;
|
|
368
|
+
$[70] = t25;
|
|
274
369
|
} else {
|
|
275
|
-
|
|
370
|
+
t25 = $[70];
|
|
276
371
|
}
|
|
277
|
-
let
|
|
278
|
-
if ($[
|
|
279
|
-
|
|
372
|
+
let t26;
|
|
373
|
+
if ($[71] !== androidRippleColor) {
|
|
374
|
+
t26 = {
|
|
280
375
|
color: androidRippleColor,
|
|
281
376
|
borderless: false,
|
|
282
377
|
foreground: true
|
|
283
378
|
};
|
|
284
|
-
$[
|
|
285
|
-
$[
|
|
379
|
+
$[71] = androidRippleColor;
|
|
380
|
+
$[72] = t26;
|
|
286
381
|
} else {
|
|
287
|
-
|
|
382
|
+
t26 = $[72];
|
|
288
383
|
}
|
|
289
|
-
let
|
|
290
|
-
if ($[
|
|
291
|
-
|
|
292
|
-
testID:
|
|
384
|
+
let t27;
|
|
385
|
+
if ($[73] !== accessibilityActions || $[74] !== accessibilityLabel || $[75] !== children || $[76] !== handleAccessibilityAction || $[77] !== handlePress || $[78] !== t23 || $[79] !== t24 || $[80] !== t25 || $[81] !== t26) {
|
|
386
|
+
t27 = /*#__PURE__*/_jsx(Pressable, {
|
|
387
|
+
testID: t23,
|
|
293
388
|
onPress: handlePress,
|
|
294
|
-
|
|
295
|
-
|
|
389
|
+
onLongPress: t24,
|
|
390
|
+
style: t25,
|
|
391
|
+
android_ripple: t26,
|
|
296
392
|
accessibilityLabel: accessibilityLabel,
|
|
297
393
|
accessibilityRole: "button",
|
|
298
394
|
accessibilityActions: accessibilityActions,
|
|
299
395
|
onAccessibilityAction: handleAccessibilityAction,
|
|
300
396
|
children: children
|
|
301
397
|
});
|
|
302
|
-
$[
|
|
303
|
-
$[
|
|
304
|
-
$[
|
|
305
|
-
$[
|
|
306
|
-
$[
|
|
307
|
-
$[
|
|
308
|
-
$[
|
|
309
|
-
$[
|
|
310
|
-
$[
|
|
311
|
-
|
|
312
|
-
|
|
398
|
+
$[73] = accessibilityActions;
|
|
399
|
+
$[74] = accessibilityLabel;
|
|
400
|
+
$[75] = children;
|
|
401
|
+
$[76] = handleAccessibilityAction;
|
|
402
|
+
$[77] = handlePress;
|
|
403
|
+
$[78] = t23;
|
|
404
|
+
$[79] = t24;
|
|
405
|
+
$[80] = t25;
|
|
406
|
+
$[81] = t26;
|
|
407
|
+
$[82] = t27;
|
|
408
|
+
} else {
|
|
409
|
+
t27 = $[82];
|
|
313
410
|
}
|
|
314
|
-
let
|
|
315
|
-
if ($[
|
|
316
|
-
|
|
411
|
+
let t28;
|
|
412
|
+
if ($[83] !== handleSwipeableOpen || $[84] !== styles.swipeableChildContainer || $[85] !== styles.swipeableContainer || $[86] !== t22 || $[87] !== t27) {
|
|
413
|
+
t28 = /*#__PURE__*/_jsx(ReanimatedSwipeable, {
|
|
317
414
|
ref: swipeableRef,
|
|
318
415
|
childrenContainerStyle: styles.swipeableChildContainer,
|
|
319
416
|
containerStyle: styles.swipeableContainer,
|
|
@@ -321,38 +418,42 @@ export function ConversationActions(t0) {
|
|
|
321
418
|
overshootLeft: overshootLeft,
|
|
322
419
|
overshootRight: false,
|
|
323
420
|
onSwipeableOpenStartDrag: handleSwipeableOpen,
|
|
324
|
-
onSwipeableClose:
|
|
421
|
+
onSwipeableClose: t21,
|
|
325
422
|
renderRightActions: _temp,
|
|
326
|
-
renderLeftActions:
|
|
327
|
-
children:
|
|
423
|
+
renderLeftActions: t22,
|
|
424
|
+
children: t27
|
|
328
425
|
});
|
|
329
|
-
$[
|
|
330
|
-
$[
|
|
331
|
-
$[
|
|
332
|
-
$[
|
|
333
|
-
$[
|
|
334
|
-
$[
|
|
426
|
+
$[83] = handleSwipeableOpen;
|
|
427
|
+
$[84] = styles.swipeableChildContainer;
|
|
428
|
+
$[85] = styles.swipeableContainer;
|
|
429
|
+
$[86] = t22;
|
|
430
|
+
$[87] = t27;
|
|
431
|
+
$[88] = t28;
|
|
335
432
|
} else {
|
|
336
|
-
|
|
433
|
+
t28 = $[88];
|
|
337
434
|
}
|
|
338
|
-
return
|
|
435
|
+
return t28;
|
|
339
436
|
}
|
|
340
437
|
function _temp() {
|
|
341
438
|
return /*#__PURE__*/_jsx(_Fragment, {});
|
|
342
439
|
}
|
|
343
440
|
function LeftActions(t0) {
|
|
344
|
-
const $ = _c(
|
|
441
|
+
const $ = _c(25);
|
|
345
442
|
const {
|
|
346
443
|
isConversationEmpty,
|
|
347
444
|
canMute,
|
|
445
|
+
canHide,
|
|
348
446
|
handleMute,
|
|
447
|
+
handleHide,
|
|
349
448
|
handleLatestMessageUnread,
|
|
350
449
|
muted,
|
|
450
|
+
hidden,
|
|
351
451
|
read,
|
|
352
452
|
isMutedPending,
|
|
453
|
+
isHiddenPending,
|
|
353
454
|
isMarkReadPending
|
|
354
455
|
} = t0;
|
|
355
|
-
const t1 =
|
|
456
|
+
const t1 = 1 + Number(canMute) + Number(canHide);
|
|
356
457
|
let t2;
|
|
357
458
|
if ($[0] !== t1) {
|
|
358
459
|
t2 = {
|
|
@@ -384,6 +485,23 @@ function LeftActions(t0) {
|
|
|
384
485
|
let t4;
|
|
385
486
|
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
386
487
|
t4 = {
|
|
488
|
+
true: {
|
|
489
|
+
iconName: "general.showEye",
|
|
490
|
+
label: "Unhide"
|
|
491
|
+
},
|
|
492
|
+
false: {
|
|
493
|
+
iconName: "general.hideEye",
|
|
494
|
+
label: "Hide"
|
|
495
|
+
}
|
|
496
|
+
};
|
|
497
|
+
$[3] = t4;
|
|
498
|
+
} else {
|
|
499
|
+
t4 = $[3];
|
|
500
|
+
}
|
|
501
|
+
const hideToggleContent = t4;
|
|
502
|
+
let t5;
|
|
503
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
504
|
+
t5 = {
|
|
387
505
|
true: {
|
|
388
506
|
iconName: "general.outlinedTextMessage",
|
|
389
507
|
label: "Mark read"
|
|
@@ -393,61 +511,79 @@ function LeftActions(t0) {
|
|
|
393
511
|
label: "Mark unread"
|
|
394
512
|
}
|
|
395
513
|
};
|
|
396
|
-
$[
|
|
514
|
+
$[4] = t5;
|
|
397
515
|
} else {
|
|
398
|
-
|
|
516
|
+
t5 = $[4];
|
|
399
517
|
}
|
|
400
|
-
const latestMessageUnreadToggleContent =
|
|
401
|
-
const
|
|
402
|
-
let
|
|
403
|
-
if ($[
|
|
404
|
-
|
|
518
|
+
const latestMessageUnreadToggleContent = t5;
|
|
519
|
+
const t6 = !read;
|
|
520
|
+
let t7;
|
|
521
|
+
if ($[5] !== handleLatestMessageUnread || $[6] !== isConversationEmpty || $[7] !== isMarkReadPending || $[8] !== t6) {
|
|
522
|
+
t7 = /*#__PURE__*/_jsx(SwipeableToggleButton, {
|
|
405
523
|
loading: isMarkReadPending,
|
|
406
524
|
disabled: isConversationEmpty,
|
|
407
|
-
toggled:
|
|
525
|
+
toggled: t6,
|
|
408
526
|
onPress: handleLatestMessageUnread,
|
|
409
527
|
toggleContent: latestMessageUnreadToggleContent,
|
|
410
528
|
backgroundColor: tokens.fillColorInteractionSwipeDefault
|
|
411
529
|
});
|
|
412
|
-
$[
|
|
413
|
-
$[
|
|
414
|
-
$[
|
|
415
|
-
$[7] = t5;
|
|
530
|
+
$[5] = handleLatestMessageUnread;
|
|
531
|
+
$[6] = isConversationEmpty;
|
|
532
|
+
$[7] = isMarkReadPending;
|
|
416
533
|
$[8] = t6;
|
|
534
|
+
$[9] = t7;
|
|
417
535
|
} else {
|
|
418
|
-
|
|
536
|
+
t7 = $[9];
|
|
419
537
|
}
|
|
420
|
-
let
|
|
421
|
-
if ($[
|
|
422
|
-
|
|
538
|
+
let t8;
|
|
539
|
+
if ($[10] !== canMute || $[11] !== handleMute || $[12] !== isMutedPending || $[13] !== muted) {
|
|
540
|
+
t8 = canMute && /*#__PURE__*/_jsx(SwipeableToggleButton, {
|
|
423
541
|
loading: isMutedPending,
|
|
424
542
|
toggled: muted,
|
|
425
543
|
onPress: handleMute,
|
|
426
544
|
toggleContent: muteToggleContent,
|
|
427
545
|
backgroundColor: tokens.fillColorInteractionSwipeSecondary
|
|
428
546
|
});
|
|
429
|
-
$[
|
|
430
|
-
$[
|
|
431
|
-
$[
|
|
432
|
-
$[
|
|
433
|
-
$[
|
|
547
|
+
$[10] = canMute;
|
|
548
|
+
$[11] = handleMute;
|
|
549
|
+
$[12] = isMutedPending;
|
|
550
|
+
$[13] = muted;
|
|
551
|
+
$[14] = t8;
|
|
434
552
|
} else {
|
|
435
|
-
|
|
553
|
+
t8 = $[14];
|
|
436
554
|
}
|
|
437
|
-
let
|
|
438
|
-
if ($[
|
|
439
|
-
|
|
555
|
+
let t9;
|
|
556
|
+
if ($[15] !== canHide || $[16] !== handleHide || $[17] !== hidden || $[18] !== isHiddenPending) {
|
|
557
|
+
t9 = canHide && /*#__PURE__*/_jsx(SwipeableToggleButton, {
|
|
558
|
+
loading: isHiddenPending,
|
|
559
|
+
toggled: hidden,
|
|
560
|
+
onPress: handleHide,
|
|
561
|
+
toggleContent: hideToggleContent,
|
|
562
|
+
backgroundColor: tokens.colorNeutral45
|
|
563
|
+
});
|
|
564
|
+
$[15] = canHide;
|
|
565
|
+
$[16] = handleHide;
|
|
566
|
+
$[17] = hidden;
|
|
567
|
+
$[18] = isHiddenPending;
|
|
568
|
+
$[19] = t9;
|
|
569
|
+
} else {
|
|
570
|
+
t9 = $[19];
|
|
571
|
+
}
|
|
572
|
+
let t10;
|
|
573
|
+
if ($[20] !== styles.actionButtonContainer || $[21] !== t7 || $[22] !== t8 || $[23] !== t9) {
|
|
574
|
+
t10 = /*#__PURE__*/_jsxs(View, {
|
|
440
575
|
style: styles.actionButtonContainer,
|
|
441
|
-
children: [
|
|
576
|
+
children: [t7, t8, t9]
|
|
442
577
|
});
|
|
443
|
-
$[
|
|
444
|
-
$[
|
|
445
|
-
$[
|
|
446
|
-
$[
|
|
578
|
+
$[20] = styles.actionButtonContainer;
|
|
579
|
+
$[21] = t7;
|
|
580
|
+
$[22] = t8;
|
|
581
|
+
$[23] = t9;
|
|
582
|
+
$[24] = t10;
|
|
447
583
|
} else {
|
|
448
|
-
|
|
584
|
+
t10 = $[24];
|
|
449
585
|
}
|
|
450
|
-
return
|
|
586
|
+
return t10;
|
|
451
587
|
}
|
|
452
588
|
const ACTION_BUTTON_WIDTH = 120;
|
|
453
589
|
const useStyles = t0 => {
|