@planningcenter/chat-react-native 4.7.1-qa-staging.3 → 4.7.1-rc.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/conversation/attachments/expanded_link.js +8 -8
- package/build/components/conversation/attachments/expanded_link.js.map +1 -1
- package/build/components/conversation/attachments/generic_file_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/generic_file_attachment.js +2 -2
- package/build/components/conversation/attachments/generic_file_attachment.js.map +1 -1
- package/build/components/conversation/attachments/giphy_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/giphy_attachment.js +2 -2
- package/build/components/conversation/attachments/giphy_attachment.js.map +1 -1
- package/build/components/conversation/attachments/image_attachment.js +2 -2
- package/build/components/conversation/attachments/image_attachment.js.map +1 -1
- package/build/components/conversation/message_form.js +2 -2
- package/build/components/conversation/message_form.js.map +1 -1
- package/build/components/conversation/message_markdown.js +2 -2
- package/build/components/conversation/message_markdown.js.map +1 -1
- package/build/components/conversations/conversation_actions.d.ts.map +1 -1
- package/build/components/conversations/conversation_actions.js +193 -333
- package/build/components/conversations/conversation_actions.js.map +1 -1
- package/build/components/conversations/conversation_preview.d.ts.map +1 -1
- package/build/components/conversations/conversation_preview.js +91 -106
- package/build/components/conversations/conversation_preview.js.map +1 -1
- package/build/components/conversations/conversations.d.ts.map +1 -1
- package/build/components/conversations/conversations.js +56 -63
- package/build/components/conversations/conversations.js.map +1 -1
- package/build/components/conversations/conversations_blank_state.d.ts +1 -2
- package/build/components/conversations/conversations_blank_state.d.ts.map +1 -1
- package/build/components/conversations/conversations_blank_state.js +39 -71
- package/build/components/conversations/conversations_blank_state.js.map +1 -1
- package/build/components/group_conversation_list.d.ts.map +1 -1
- package/build/components/group_conversation_list.js +0 -1
- package/build/components/group_conversation_list.js.map +1 -1
- package/build/contexts/conversations_context.d.ts +1 -3
- package/build/contexts/conversations_context.d.ts.map +1 -1
- package/build/contexts/conversations_context.js +31 -39
- package/build/contexts/conversations_context.js.map +1 -1
- package/build/hooks/groups/use_group_members_for_new_conversation.d.ts +0 -6
- package/build/hooks/groups/use_group_members_for_new_conversation.d.ts.map +1 -1
- package/build/hooks/use_api.d.ts +0 -6
- package/build/hooks/use_api.d.ts.map +1 -1
- package/build/hooks/use_api.js +5 -8
- package/build/hooks/use_api.js.map +1 -1
- package/build/hooks/use_clear_conversation_filters.d.ts.map +1 -1
- package/build/hooks/use_clear_conversation_filters.js +0 -1
- package/build/hooks/use_clear_conversation_filters.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 +0 -1
- package/build/hooks/use_features.d.ts.map +1 -1
- package/build/hooks/use_features.js +1 -2
- package/build/hooks/use_features.js.map +1 -1
- package/build/hooks/use_groups.d.ts +0 -6
- package/build/hooks/use_groups.d.ts.map +1 -1
- package/build/hooks/use_groups_groups.d.ts +0 -6
- package/build/hooks/use_groups_groups.d.ts.map +1 -1
- package/build/hooks/use_live_relative_time.js +6 -5
- package/build/hooks/use_live_relative_time.js.map +1 -1
- package/build/hooks/use_teams.d.ts +0 -6
- package/build/hooks/use_teams.d.ts.map +1 -1
- package/build/navigation/index.d.ts +0 -5
- package/build/navigation/index.d.ts.map +1 -1
- package/build/navigation/index.js +0 -5
- package/build/navigation/index.js.map +1 -1
- package/build/screens/age_check/age_check_underage_screen.js +3 -3
- package/build/screens/age_check/age_check_underage_screen.js.map +1 -1
- package/build/screens/attachment_actions/attachment_actions_screen.js +2 -2
- package/build/screens/attachment_actions/attachment_actions_screen.js.map +1 -1
- package/build/screens/bug_report_screen.js +4 -4
- package/build/screens/bug_report_screen.js.map +1 -1
- package/build/screens/conversation_details_screen.d.ts.map +1 -1
- package/build/screens/conversation_details_screen.js +394 -460
- package/build/screens/conversation_details_screen.js.map +1 -1
- package/build/screens/conversation_filters/components/conversation_filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/components/conversation_filters.js +12 -53
- package/build/screens/conversation_filters/components/conversation_filters.js.map +1 -1
- package/build/screens/conversation_filters/components/rows.d.ts +3 -6
- package/build/screens/conversation_filters/components/rows.d.ts.map +1 -1
- package/build/screens/conversation_filters/components/rows.js +62 -99
- package/build/screens/conversation_filters/components/rows.js.map +1 -1
- package/build/screens/conversation_filters/context/conversation_filter_context.d.ts.map +1 -1
- package/build/screens/conversation_filters/context/conversation_filter_context.js +0 -4
- package/build/screens/conversation_filters/context/conversation_filter_context.js.map +1 -1
- package/build/screens/conversation_filters/filter_types.d.ts +0 -1
- package/build/screens/conversation_filters/filter_types.d.ts.map +1 -1
- package/build/screens/conversation_filters/filter_types.js +0 -1
- package/build/screens/conversation_filters/filter_types.js.map +1 -1
- package/build/screens/conversation_filters/hooks/filters.d.ts +0 -12
- package/build/screens/conversation_filters/hooks/filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/screen_props.d.ts +0 -1
- package/build/screens/conversation_filters/screen_props.d.ts.map +1 -1
- package/build/screens/conversation_filters/screen_props.js.map +1 -1
- package/build/screens/conversations/components/filter_dropdown_list_header_component.d.ts.map +1 -1
- package/build/screens/conversations/components/filter_dropdown_list_header_component.js +126 -138
- package/build/screens/conversations/components/filter_dropdown_list_header_component.js.map +1 -1
- package/build/screens/conversations/components/list_header_component.d.ts.map +1 -1
- package/build/screens/conversations/components/list_header_component.js +90 -95
- package/build/screens/conversations/components/list_header_component.js.map +1 -1
- package/build/screens/conversations/components/search_list_header_component.d.ts.map +1 -1
- package/build/screens/conversations/components/search_list_header_component.js +95 -100
- package/build/screens/conversations/components/search_list_header_component.js.map +1 -1
- package/build/screens/conversations/conversations_screen.d.ts +0 -1
- package/build/screens/conversations/conversations_screen.d.ts.map +1 -1
- package/build/screens/conversations/conversations_screen.js +10 -18
- package/build/screens/conversations/conversations_screen.js.map +1 -1
- package/build/screens/get_help_screen.d.ts.map +1 -1
- package/build/screens/get_help_screen.js +21 -5
- package/build/screens/get_help_screen.js.map +1 -1
- package/build/screens/index.d.ts +0 -1
- package/build/screens/index.d.ts.map +1 -1
- package/build/screens/index.js +0 -1
- package/build/screens/index.js.map +1 -1
- package/build/types/resources/conversation_membership.d.ts +0 -1
- package/build/types/resources/conversation_membership.d.ts.map +1 -1
- package/build/types/resources/conversation_membership.js.map +1 -1
- package/build/utils/date.d.ts +1 -1
- package/build/utils/date.d.ts.map +1 -1
- package/build/utils/date.js +4 -4
- package/build/utils/date.js.map +1 -1
- package/build/utils/index.d.ts +0 -1
- package/build/utils/index.d.ts.map +1 -1
- package/build/utils/index.js +0 -1
- package/build/utils/index.js.map +1 -1
- package/build/utils/request/conversation.d.ts +1 -3
- package/build/utils/request/conversation.d.ts.map +1 -1
- package/build/utils/request/conversation.js +0 -4
- package/build/utils/request/conversation.js.map +1 -1
- package/build/vendor/font_awesome_pro_solid_icons.d.ts +0 -1
- package/build/vendor/font_awesome_pro_solid_icons.d.ts.map +1 -1
- package/build/vendor/font_awesome_pro_solid_icons.js +0 -5
- package/build/vendor/font_awesome_pro_solid_icons.js.map +1 -1
- package/package.json +3 -3
- package/src/__tests__/components/conversation/attachments/giphy_attachment.test.tsx +1 -1
- package/src/__tests__/screens/conversation_filters/components/conversation_filters.test.tsx +0 -6
- package/src/__tests__/screens/get_help_screen.test.ts +1 -1
- package/src/components/conversation/attachments/expanded_link.tsx +4 -4
- package/src/components/conversation/attachments/generic_file_attachment.tsx +5 -2
- package/src/components/conversation/attachments/giphy_attachment.tsx +4 -2
- package/src/components/conversation/attachments/image_attachment.tsx +2 -2
- package/src/components/conversation/message_form.tsx +2 -2
- package/src/components/conversation/message_markdown.tsx +2 -2
- package/src/components/conversations/__tests__/conversation_actions.test.tsx +2 -77
- package/src/components/conversations/__tests__/conversation_preview.test.tsx +0 -29
- package/src/components/conversations/__tests__/conversations.test.tsx +0 -26
- package/src/components/conversations/__tests__/conversations_blank_state.test.tsx +0 -17
- package/src/components/conversations/conversation_actions.tsx +4 -73
- package/src/components/conversations/conversation_preview.tsx +1 -12
- package/src/components/conversations/conversations.tsx +0 -9
- package/src/components/conversations/conversations_blank_state.tsx +0 -18
- package/src/components/group_conversation_list.tsx +1 -4
- package/src/contexts/conversations_context.tsx +1 -8
- package/src/hooks/__tests__/use_live_relative_time.test.tsx +22 -0
- package/src/hooks/use_api.ts +1 -2
- package/src/hooks/use_clear_conversation_filters.ts +0 -1
- package/src/hooks/use_conversation.ts +0 -1
- package/src/hooks/use_features.ts +0 -1
- package/src/hooks/use_live_relative_time.ts +1 -1
- package/src/navigation/index.tsx +0 -8
- package/src/screens/__tests__/conversation_details_screen.test.tsx +1 -49
- package/src/screens/age_check/age_check_underage_screen.tsx +3 -3
- package/src/screens/attachment_actions/attachment_actions_screen.tsx +2 -2
- package/src/screens/bug_report_screen.tsx +4 -4
- package/src/screens/conversation_details_screen.tsx +0 -19
- package/src/screens/conversation_filters/__tests__/conversation_filters.test.tsx +0 -42
- package/src/screens/conversation_filters/components/conversation_filters.tsx +3 -22
- package/src/screens/conversation_filters/components/rows.tsx +10 -44
- package/src/screens/conversation_filters/context/conversation_filter_context.tsx +0 -4
- package/src/screens/conversation_filters/filter_types.ts +0 -1
- package/src/screens/conversation_filters/screen_props.ts +0 -1
- package/src/screens/conversations/__tests__/conversations_screen.test.tsx +0 -1
- package/src/screens/conversations/components/__tests__/filter_dropdown_list_header_component.test.tsx +0 -42
- package/src/screens/conversations/components/__tests__/list_header_component.test.tsx +0 -1
- package/src/screens/conversations/components/filter_dropdown_list_header_component.tsx +5 -21
- package/src/screens/conversations/components/list_header_component.tsx +4 -14
- package/src/screens/conversations/components/search_list_header_component.tsx +4 -14
- package/src/screens/conversations/conversations_screen.tsx +0 -3
- package/src/screens/get_help_screen.tsx +19 -5
- package/src/screens/index.ts +0 -1
- package/src/types/resources/conversation_membership.ts +0 -1
- package/src/utils/__tests__/date.test.ts +10 -1
- package/src/utils/date.ts +4 -4
- package/src/utils/index.ts +0 -1
- package/src/utils/request/conversation.ts +0 -6
- package/src/vendor/font_awesome_pro_solid_icons.ts +0 -12
- package/build/components/conversations/hidden_indicator.d.ts +0 -4
- package/build/components/conversations/hidden_indicator.d.ts.map +0 -1
- package/build/components/conversations/hidden_indicator.js +0 -52
- package/build/components/conversations/hidden_indicator.js.map +0 -1
- package/build/components/conversations/hidden_results_footer.d.ts +0 -2
- package/build/components/conversations/hidden_results_footer.d.ts.map +0 -1
- package/build/components/conversations/hidden_results_footer.js +0 -34
- package/build/components/conversations/hidden_results_footer.js.map +0 -1
- package/build/components/display/toast.d.ts +0 -3
- package/build/components/display/toast.d.ts.map +0 -1
- package/build/components/display/toast.js +0 -224
- package/build/components/display/toast.js.map +0 -1
- package/build/hooks/use_hidden_conversations_count.d.ts +0 -2
- package/build/hooks/use_hidden_conversations_count.d.ts.map +0 -1
- package/build/hooks/use_hidden_conversations_count.js +0 -32
- package/build/hooks/use_hidden_conversations_count.js.map +0 -1
- package/build/hooks/use_hide_conversation.d.ts +0 -108
- package/build/hooks/use_hide_conversation.d.ts.map +0 -1
- package/build/hooks/use_hide_conversation.js +0 -243
- package/build/hooks/use_hide_conversation.js.map +0 -1
- package/build/hooks/use_hide_conversations_enabled.d.ts +0 -2
- package/build/hooks/use_hide_conversations_enabled.d.ts.map +0 -1
- package/build/hooks/use_hide_conversations_enabled.js +0 -18
- package/build/hooks/use_hide_conversations_enabled.js.map +0 -1
- package/build/screens/conversation_actions_screen.d.ts +0 -7
- package/build/screens/conversation_actions_screen.d.ts.map +0 -1
- package/build/screens/conversation_actions_screen.js +0 -89
- package/build/screens/conversation_actions_screen.js.map +0 -1
- package/build/utils/open_url.d.ts +0 -11
- package/build/utils/open_url.d.ts.map +0 -1
- package/build/utils/open_url.js +0 -46
- package/build/utils/open_url.js.map +0 -1
- package/build/utils/toast_store.d.ts +0 -21
- package/build/utils/toast_store.d.ts.map +0 -1
- package/build/utils/toast_store.js +0 -27
- package/build/utils/toast_store.js.map +0 -1
- package/src/components/conversations/hidden_indicator.tsx +0 -30
- package/src/components/conversations/hidden_results_footer.tsx +0 -25
- package/src/components/display/__tests__/toast.test.tsx +0 -55
- package/src/components/display/toast.tsx +0 -115
- package/src/hooks/__tests__/use_hide_conversation.test.tsx +0 -189
- package/src/hooks/use_hidden_conversations_count.ts +0 -14
- package/src/hooks/use_hide_conversation.ts +0 -128
- package/src/hooks/use_hide_conversations_enabled.ts +0 -7
- package/src/screens/__tests__/conversation_actions_screen.test.tsx +0 -79
- package/src/screens/conversation_actions_screen.tsx +0 -53
- package/src/utils/__tests__/open_url.test.ts +0 -67
- package/src/utils/open_url.ts +0 -47
- package/src/utils/toast_store.ts +0 -45
|
@@ -4,7 +4,7 @@ import { StyleSheet, View, ScrollView } from 'react-native'
|
|
|
4
4
|
import { Heading } from '../../components'
|
|
5
5
|
import { Icon, Text, TextInlineButton } from '../../components/display'
|
|
6
6
|
import { useTheme } from '../../hooks'
|
|
7
|
-
import {
|
|
7
|
+
import { Linking } from '../../utils'
|
|
8
8
|
import type { AgeCheckParams } from './screen_props'
|
|
9
9
|
|
|
10
10
|
export interface AgeCheckUnderageScreenProps {
|
|
@@ -19,11 +19,11 @@ export function AgeCheckUnderageScreen({ contactEmail }: AgeCheckUnderageScreenP
|
|
|
19
19
|
|
|
20
20
|
const openChurchAdminHelp = () => {
|
|
21
21
|
if (!email) return
|
|
22
|
-
|
|
22
|
+
Linking.openURL(`mailto:${email}`)
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
const openTerms = () => {
|
|
26
|
-
|
|
26
|
+
Linking.openURL('https://www.planningcenter.com/terms')
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
return (
|
|
@@ -3,7 +3,7 @@ import React, { useCallback } from 'react'
|
|
|
3
3
|
import { Alert, StyleSheet } from 'react-native'
|
|
4
4
|
import FormSheet, { getFormSheetScreenOptions } from '../../components/primitive/form_sheet'
|
|
5
5
|
import { useConversation } from '../../hooks/use_conversation'
|
|
6
|
-
import {
|
|
6
|
+
import { Linking } from '../../utils'
|
|
7
7
|
import { useDeleteAttachment } from './hooks/useDeleteAttachment'
|
|
8
8
|
|
|
9
9
|
export const AttachmentActionsScreenOptions = getFormSheetScreenOptions({
|
|
@@ -60,7 +60,7 @@ export function AttachmentActionsScreen({ route }: AttachmentActionsScreenProps)
|
|
|
60
60
|
}, [attachmentName, handleDeleteAttachment, navigation])
|
|
61
61
|
|
|
62
62
|
const handleOpenInBrowser = () => {
|
|
63
|
-
|
|
63
|
+
Linking.openURL(attachmentUrl, { forceOpenInBrowser: true })
|
|
64
64
|
navigation.goBack()
|
|
65
65
|
}
|
|
66
66
|
|
|
@@ -30,7 +30,7 @@ import { useTheme } from '../hooks'
|
|
|
30
30
|
import { useAppName } from '../hooks/use_app_name'
|
|
31
31
|
import { useReportBugAction } from '../hooks/use_report_bug_action'
|
|
32
32
|
import { useUploadClient } from '../hooks/use_upload_client'
|
|
33
|
-
import { ImagePicker, ImagePickerResult,
|
|
33
|
+
import { ImagePicker, ImagePickerResult, Linking, platformFontWeightBold } from '../utils'
|
|
34
34
|
|
|
35
35
|
const MAX_DESCRIPTION_LENGTH = 2000
|
|
36
36
|
|
|
@@ -196,7 +196,7 @@ export function BugReportScreen() {
|
|
|
196
196
|
<TextInlineButton
|
|
197
197
|
accessibilityRole="link"
|
|
198
198
|
onPress={() =>
|
|
199
|
-
|
|
199
|
+
Linking.openURL('https://support.planningcenteronline.com/hc/en-us/requests/new')
|
|
200
200
|
}
|
|
201
201
|
>
|
|
202
202
|
contact our help center
|
|
@@ -342,7 +342,7 @@ export function BugReportScreen() {
|
|
|
342
342
|
<TextInlineButton
|
|
343
343
|
accessibilityRole="link"
|
|
344
344
|
variant="footnote"
|
|
345
|
-
onPress={() =>
|
|
345
|
+
onPress={() => Linking.openURL(VIDEO_RECORDING_HELP_URL)}
|
|
346
346
|
>
|
|
347
347
|
How to record your screen
|
|
348
348
|
</TextInlineButton>
|
|
@@ -355,7 +355,7 @@ export function BugReportScreen() {
|
|
|
355
355
|
<TextInlineButton
|
|
356
356
|
accessibilityRole="link"
|
|
357
357
|
variant="footnote"
|
|
358
|
-
onPress={() =>
|
|
358
|
+
onPress={() => Linking.openURL('https://www.planningcenter.com/privacy')}
|
|
359
359
|
>
|
|
360
360
|
Privacy Policy
|
|
361
361
|
</TextInlineButton>
|
|
@@ -50,8 +50,6 @@ import {
|
|
|
50
50
|
useConversationUpdate,
|
|
51
51
|
} from '../hooks/use_conversation'
|
|
52
52
|
import { availableFeatures, useFeatures } from '../hooks/use_features'
|
|
53
|
-
import { useHideConversation } from '../hooks/use_hide_conversation'
|
|
54
|
-
import { useHideConversationsEnabled } from '../hooks/use_hide_conversations_enabled'
|
|
55
53
|
import { useManualArchivingEnabled } from '../hooks/use_manual_archiving_enabled'
|
|
56
54
|
import { usePreviewAvatarDiameter } from '../hooks/use_preview_avatar_diameter'
|
|
57
55
|
import { useUnarchiveConversationAction } from '../hooks/use_unarchive_conversation_action'
|
|
@@ -117,8 +115,6 @@ export function ConversationDetailsScreen({ route }: ConversationDetailsScreenPr
|
|
|
117
115
|
const granularNotificationsEnabled = featureEnabled(availableFeatures.granular_notifications_ui)
|
|
118
116
|
const customAvatarsEnabled = featureEnabled(availableFeatures.custom_conversation_avatars)
|
|
119
117
|
const manualArchivingEnabled = useManualArchivingEnabled()
|
|
120
|
-
const hideConversationsEnabled = useHideConversationsEnabled()
|
|
121
|
-
const { hidden, setHidden, isPending: isHidePending } = useHideConversation({ conversation })
|
|
122
118
|
const showGenderFilter =
|
|
123
119
|
featureEnabled(availableFeatures.gender_specific_conversations) && !!conversation.genderOption
|
|
124
120
|
const genderLabel = conversation.genderOption ? genderDisplayLabel(conversation.genderOption) : ''
|
|
@@ -134,7 +130,6 @@ export function ConversationDetailsScreen({ route }: ConversationDetailsScreenPr
|
|
|
134
130
|
const canSaveTitle = canUpdate && !emptyTitle
|
|
135
131
|
const canDelete = conversation.memberAbility?.canDelete || false
|
|
136
132
|
const canArchive = manualArchivingEnabled && (conversation.memberAbility?.canArchive || false)
|
|
137
|
-
const canHide = hideConversationsEnabled && !archived
|
|
138
133
|
const isLeader = conversation.memberAbility?.leader || false
|
|
139
134
|
const isDisabled = conversation.disabled ?? false
|
|
140
135
|
const showAdultRequirementNotice = isDisabled && conversation.disabledReason === 'safety_check'
|
|
@@ -236,11 +231,6 @@ export function ConversationDetailsScreen({ route }: ConversationDetailsScreenPr
|
|
|
236
231
|
)
|
|
237
232
|
}, [setArchived])
|
|
238
233
|
|
|
239
|
-
const handleHide = useCallback(() => {
|
|
240
|
-
setHidden(!hidden)
|
|
241
|
-
if (!hidden) navigation.dispatch(StackActions.popToTop())
|
|
242
|
-
}, [hidden, navigation, setHidden])
|
|
243
|
-
|
|
244
234
|
const HeaderTitle = useCallback(
|
|
245
235
|
(props: HeaderTitleProps) => {
|
|
246
236
|
return (
|
|
@@ -364,15 +354,6 @@ export function ConversationDetailsScreen({ route }: ConversationDetailsScreenPr
|
|
|
364
354
|
},
|
|
365
355
|
showBottomBorder: true,
|
|
366
356
|
},
|
|
367
|
-
{
|
|
368
|
-
type: canHide ? SectionTypes.setting : SectionTypes.hidden,
|
|
369
|
-
data: {
|
|
370
|
-
title: hidden ? 'Unhide conversation' : 'Hide conversation',
|
|
371
|
-
disabled: isHidePending,
|
|
372
|
-
onPress: handleHide,
|
|
373
|
-
},
|
|
374
|
-
showBottomBorder: canArchive || canDelete,
|
|
375
|
-
},
|
|
376
357
|
{
|
|
377
358
|
type: canArchive ? SectionTypes.setting : SectionTypes.hidden,
|
|
378
359
|
data: {
|
|
@@ -18,14 +18,6 @@ let mockCanBrowseArchived = false
|
|
|
18
18
|
jest.mock('../../../hooks/use_can_browse_archived_conversations', () => ({
|
|
19
19
|
useCanBrowseArchivedConversations: () => mockCanBrowseArchived,
|
|
20
20
|
}))
|
|
21
|
-
let mockHideEnabled = false
|
|
22
|
-
jest.mock('../../../hooks/use_hide_conversations_enabled', () => ({
|
|
23
|
-
useHideConversationsEnabled: () => mockHideEnabled,
|
|
24
|
-
}))
|
|
25
|
-
let mockHiddenCount = 0
|
|
26
|
-
jest.mock('../../../hooks/use_hidden_conversations_count', () => ({
|
|
27
|
-
useHiddenConversationsCount: () => mockHiddenCount,
|
|
28
|
-
}))
|
|
29
21
|
jest.mock('../../../hooks/use_direct_messages_eligible', () => ({
|
|
30
22
|
useDirectMessagesEligible: () => false,
|
|
31
23
|
}))
|
|
@@ -74,7 +66,6 @@ describe('ConversationFilters archived option', () => {
|
|
|
74
66
|
|
|
75
67
|
expect(view.queryByText('Other')).toBeNull()
|
|
76
68
|
expect(view.queryByText('Archived conversations')).toBeNull()
|
|
77
|
-
expect(view.queryByText('Hidden conversations')).toBeNull()
|
|
78
69
|
})
|
|
79
70
|
|
|
80
71
|
it('offers Archived under Other when the person can browse archived conversations', () => {
|
|
@@ -108,36 +99,3 @@ describe('ConversationFilters archived option', () => {
|
|
|
108
99
|
expect(within(selected).getByText('Archived conversations')).toBeTruthy()
|
|
109
100
|
})
|
|
110
101
|
})
|
|
111
|
-
|
|
112
|
-
describe('ConversationFilters hidden option', () => {
|
|
113
|
-
beforeEach(() => {
|
|
114
|
-
mockSetAppFilter.mockClear()
|
|
115
|
-
mockCanBrowseArchived = false
|
|
116
|
-
mockHideEnabled = true
|
|
117
|
-
mockHiddenCount = 3
|
|
118
|
-
})
|
|
119
|
-
|
|
120
|
-
it('offers Hidden conversations under Other with the hidden count', () => {
|
|
121
|
-
const view = renderFilters()
|
|
122
|
-
|
|
123
|
-
expect(view.getByText('Other')).toBeTruthy()
|
|
124
|
-
expect(view.getByText('Hidden conversations')).toBeTruthy()
|
|
125
|
-
expect(view.getByText('Hidden for just you')).toBeTruthy()
|
|
126
|
-
expect(view.getByTestId('filter-row-count')).toHaveTextContent('3')
|
|
127
|
-
})
|
|
128
|
-
|
|
129
|
-
it('selecting Hidden conversations sets the hidden filter param', () => {
|
|
130
|
-
const view = renderFilters()
|
|
131
|
-
|
|
132
|
-
fireEvent.press(view.getByText('Hidden conversations'))
|
|
133
|
-
|
|
134
|
-
expect(mockSetAppFilter).toHaveBeenCalledWith({ show_hidden: true })
|
|
135
|
-
})
|
|
136
|
-
|
|
137
|
-
it('preselects Hidden conversations when it is the active filter', () => {
|
|
138
|
-
const view = renderFilters({ show_hidden: true })
|
|
139
|
-
|
|
140
|
-
const selected = view.getByRole('button', { selected: true })
|
|
141
|
-
expect(within(selected).getByText('Hidden conversations')).toBeTruthy()
|
|
142
|
-
})
|
|
143
|
-
})
|
|
@@ -10,9 +10,7 @@ import {
|
|
|
10
10
|
useTheme,
|
|
11
11
|
} from '../../../hooks'
|
|
12
12
|
import { useFilterDropdownEnabled } from '../../../hooks/use_filter_dropdown_enabled'
|
|
13
|
-
import {
|
|
14
|
-
import { useHideConversationsEnabled } from '../../../hooks/use_hide_conversations_enabled'
|
|
15
|
-
import { faBoxArchive, faEyeSlash } from '../../../vendor/font_awesome_pro_solid_icons'
|
|
13
|
+
import { faBoxArchive } from '../../../vendor/font_awesome_pro_solid_icons'
|
|
16
14
|
import { FilterContext, useFilterContext } from '../context/conversation_filter_context'
|
|
17
15
|
import { FilterTypes } from '../filter_types'
|
|
18
16
|
import { useGroupsToFilter, useTeamsToFilter } from '../hooks/filters'
|
|
@@ -71,7 +69,6 @@ export const ConversationFilters = () => {
|
|
|
71
69
|
group_source_app_name = '',
|
|
72
70
|
show_direct_messages,
|
|
73
71
|
show_archived,
|
|
74
|
-
show_hidden,
|
|
75
72
|
} = params
|
|
76
73
|
|
|
77
74
|
const filterDropdownEnabled = useFilterDropdownEnabled()
|
|
@@ -79,9 +76,6 @@ export const ConversationFilters = () => {
|
|
|
79
76
|
const hasDirectMessages = useHasDirectMessages()
|
|
80
77
|
const canFilterByDMs = directMessagesEligible && hasDirectMessages
|
|
81
78
|
const canFilterByArchived = useCanBrowseArchivedConversations()
|
|
82
|
-
const canFilterByHidden = useHideConversationsEnabled()
|
|
83
|
-
const hiddenCount = useHiddenConversationsCount()
|
|
84
|
-
const showOtherFilters = canFilterByArchived || canFilterByHidden
|
|
85
79
|
|
|
86
80
|
const activeFilter: FilterTypes = useMemo(() => {
|
|
87
81
|
if (chat_group_graph_id) {
|
|
@@ -94,12 +88,10 @@ export const ConversationFilters = () => {
|
|
|
94
88
|
return FilterTypes.DirectMessages
|
|
95
89
|
} else if (show_archived) {
|
|
96
90
|
return FilterTypes.Archived
|
|
97
|
-
} else if (show_hidden) {
|
|
98
|
-
return FilterTypes.Hidden
|
|
99
91
|
}
|
|
100
92
|
|
|
101
93
|
return FilterTypes.All
|
|
102
|
-
}, [chat_group_graph_id, group_source_app_name, show_direct_messages, show_archived
|
|
94
|
+
}, [chat_group_graph_id, group_source_app_name, show_direct_messages, show_archived])
|
|
103
95
|
|
|
104
96
|
const { groups = [] } = useGroupsToFilter()
|
|
105
97
|
const { teams = [] } = useTeamsToFilter()
|
|
@@ -181,7 +173,7 @@ export const ConversationFilters = () => {
|
|
|
181
173
|
data: { routeName: 'TeamFilters' },
|
|
182
174
|
},
|
|
183
175
|
{
|
|
184
|
-
type:
|
|
176
|
+
type: canFilterByArchived ? SectionTypes.header : SectionTypes.hidden,
|
|
185
177
|
data: { title: 'Other', style: styles.extraHeaderScalableSpace },
|
|
186
178
|
},
|
|
187
179
|
{
|
|
@@ -194,17 +186,6 @@ export const ConversationFilters = () => {
|
|
|
194
186
|
isActive: activeFilter === FilterTypes.Archived,
|
|
195
187
|
},
|
|
196
188
|
},
|
|
197
|
-
{
|
|
198
|
-
type: canFilterByHidden ? SectionTypes.other : SectionTypes.hidden,
|
|
199
|
-
data: {
|
|
200
|
-
filter: FilterTypes.Hidden,
|
|
201
|
-
description: 'Hidden for just you',
|
|
202
|
-
icon: faEyeSlash,
|
|
203
|
-
show_hidden: true,
|
|
204
|
-
count: hiddenCount,
|
|
205
|
-
isActive: activeFilter === FilterTypes.Hidden,
|
|
206
|
-
},
|
|
207
|
-
},
|
|
208
189
|
]
|
|
209
190
|
|
|
210
191
|
return (
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IconDefinition } from '@fortawesome/fontawesome-svg-core'
|
|
2
2
|
import { PlatformPressable } from '@react-navigation/elements'
|
|
3
3
|
import { NavigationProp, useNavigation } from '@react-navigation/native'
|
|
4
|
-
import React, { PropsWithChildren,
|
|
4
|
+
import React, { PropsWithChildren, useContext } from 'react'
|
|
5
5
|
import { StyleSheet, View, ViewStyle } from 'react-native'
|
|
6
6
|
import { Heading, Icon, IconTile, Image, Text, TextButton } from '../../../components'
|
|
7
7
|
import {
|
|
@@ -118,38 +118,18 @@ export const TeamRow = ({ team }: TeamRowProps) => {
|
|
|
118
118
|
|
|
119
119
|
export type OtherRowProps = {
|
|
120
120
|
show_archived?: boolean
|
|
121
|
-
show_hidden?: boolean
|
|
122
|
-
count?: number
|
|
123
121
|
isActive: boolean
|
|
124
122
|
filter: FilterTypes
|
|
125
123
|
description: string
|
|
126
124
|
icon: IconDefinition
|
|
127
125
|
}
|
|
128
126
|
|
|
129
|
-
export const OtherRow = ({
|
|
130
|
-
show_archived,
|
|
131
|
-
show_hidden,
|
|
132
|
-
count,
|
|
133
|
-
isActive,
|
|
134
|
-
filter,
|
|
135
|
-
description,
|
|
136
|
-
icon,
|
|
137
|
-
}: OtherRowProps) => {
|
|
127
|
+
export const OtherRow = ({ show_archived, isActive, filter, description, icon }: OtherRowProps) => {
|
|
138
128
|
const styles = useRowStyles()
|
|
139
129
|
const { setAppFilter } = useContext(FilterContext)
|
|
140
130
|
|
|
141
131
|
return (
|
|
142
|
-
<PressableRow
|
|
143
|
-
onPress={() => setAppFilter({ show_archived, show_hidden })}
|
|
144
|
-
isActive={isActive}
|
|
145
|
-
trailing={
|
|
146
|
-
count !== undefined && (
|
|
147
|
-
<Text variant="tertiary" testID="filter-row-count">
|
|
148
|
-
{count}
|
|
149
|
-
</Text>
|
|
150
|
-
)
|
|
151
|
-
}
|
|
152
|
-
>
|
|
132
|
+
<PressableRow onPress={() => setAppFilter({ show_archived })} isActive={isActive}>
|
|
153
133
|
<IconTile icon={icon} shape="square" size="lg" />
|
|
154
134
|
<View style={styles.rowTextContainer}>
|
|
155
135
|
<Heading variant="h3" style={styles.rowTitle}>
|
|
@@ -183,13 +163,7 @@ export const PressableRow = ({
|
|
|
183
163
|
isActive,
|
|
184
164
|
onPress,
|
|
185
165
|
style,
|
|
186
|
-
|
|
187
|
-
}: PropsWithChildren<{
|
|
188
|
-
isActive: boolean
|
|
189
|
-
onPress: () => void
|
|
190
|
-
style?: ViewStyle
|
|
191
|
-
trailing?: ReactNode
|
|
192
|
-
}>) => {
|
|
166
|
+
}: PropsWithChildren<{ isActive: boolean; onPress: () => void; style?: ViewStyle }>) => {
|
|
193
167
|
const styles = useRowStyles({ isActive })
|
|
194
168
|
return (
|
|
195
169
|
<PlatformPressable
|
|
@@ -200,15 +174,12 @@ export const PressableRow = ({
|
|
|
200
174
|
>
|
|
201
175
|
<View style={styles.row}>
|
|
202
176
|
<View style={[styles.rowInner, style]}>{children}</View>
|
|
203
|
-
<
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
maxFontSizeMultiplier={2.5}
|
|
210
|
-
/>
|
|
211
|
-
</View>
|
|
177
|
+
<Icon
|
|
178
|
+
name="general.check"
|
|
179
|
+
style={styles.rowIconRight}
|
|
180
|
+
accessibilityElementsHidden
|
|
181
|
+
maxFontSizeMultiplier={2.5}
|
|
182
|
+
/>
|
|
212
183
|
</View>
|
|
213
184
|
</PlatformPressable>
|
|
214
185
|
)
|
|
@@ -248,11 +219,6 @@ const useRowStyles = ({ isActive = false }: { isActive?: boolean } = {}) => {
|
|
|
248
219
|
rowTextContainer: {
|
|
249
220
|
flexShrink: 1,
|
|
250
221
|
},
|
|
251
|
-
rowTrailing: {
|
|
252
|
-
flexDirection: 'row',
|
|
253
|
-
alignItems: 'center',
|
|
254
|
-
gap: 12,
|
|
255
|
-
},
|
|
256
222
|
rowWithoutBorder: {
|
|
257
223
|
flexDirection: 'row',
|
|
258
224
|
alignItems: 'center',
|
|
@@ -23,7 +23,6 @@ export const FilterContext = createContext<{
|
|
|
23
23
|
group_source_app_name: undefined,
|
|
24
24
|
show_direct_messages: undefined,
|
|
25
25
|
show_archived: undefined,
|
|
26
|
-
show_hidden: undefined,
|
|
27
26
|
show_unread: undefined,
|
|
28
27
|
},
|
|
29
28
|
scrollOffset: 0,
|
|
@@ -61,7 +60,6 @@ export const FilterProvider = ({ children }: PropsWithChildren) => {
|
|
|
61
60
|
group_source_app_name: undefined,
|
|
62
61
|
show_direct_messages: undefined,
|
|
63
62
|
show_archived: undefined,
|
|
64
|
-
show_hidden: undefined,
|
|
65
63
|
show_unread: undefined,
|
|
66
64
|
})
|
|
67
65
|
)
|
|
@@ -72,7 +70,6 @@ export const FilterProvider = ({ children }: PropsWithChildren) => {
|
|
|
72
70
|
group_source_app_name: undefined,
|
|
73
71
|
show_direct_messages: undefined,
|
|
74
72
|
show_archived: undefined,
|
|
75
|
-
show_hidden: undefined,
|
|
76
73
|
show_unread: undefined,
|
|
77
74
|
})
|
|
78
75
|
},
|
|
@@ -82,7 +79,6 @@ export const FilterProvider = ({ children }: PropsWithChildren) => {
|
|
|
82
79
|
group_source_app_name: params.group_source_app_name,
|
|
83
80
|
show_direct_messages: params.show_direct_messages,
|
|
84
81
|
show_archived: params.show_archived,
|
|
85
|
-
show_hidden: params.show_hidden,
|
|
86
82
|
show_unread: undefined,
|
|
87
83
|
})
|
|
88
84
|
},
|
|
@@ -27,7 +27,6 @@ jest.mock('../../../components', () => ({
|
|
|
27
27
|
<ListHeaderComponent />
|
|
28
28
|
),
|
|
29
29
|
}))
|
|
30
|
-
jest.mock('../../../components/display/toast', () => ({ Toast: () => null }))
|
|
31
30
|
jest.mock('../components/list_header_component', () => {
|
|
32
31
|
const { Text } = require('react-native')
|
|
33
32
|
return { ListHeaderComponent: () => <Text>Default header</Text> }
|
|
@@ -19,7 +19,6 @@ const mockRouteParams: Record<string, unknown> = {}
|
|
|
19
19
|
const mockCanDisplayGroups = jest.fn()
|
|
20
20
|
const mockSearchEnabled = jest.fn()
|
|
21
21
|
const mockCanBrowseArchived = jest.fn()
|
|
22
|
-
const mockHideEnabled = jest.fn()
|
|
23
22
|
const mockGroupsByGraphId: Record<string, { name: string }> = {}
|
|
24
23
|
|
|
25
24
|
jest.mock('@react-navigation/native', () => ({
|
|
@@ -45,9 +44,6 @@ jest.mock('../../../../hooks/use_has_direct_messages', () => ({
|
|
|
45
44
|
jest.mock('../../../../hooks/use_can_browse_archived_conversations', () => ({
|
|
46
45
|
useCanBrowseArchivedConversations: () => mockCanBrowseArchived(),
|
|
47
46
|
}))
|
|
48
|
-
jest.mock('../../../../hooks/use_hide_conversations_enabled', () => ({
|
|
49
|
-
useHideConversationsEnabled: () => mockHideEnabled(),
|
|
50
|
-
}))
|
|
51
47
|
jest.mock('../../../../hooks/use_chat_permissions', () => ({
|
|
52
48
|
useCanCreateConversations: () => true,
|
|
53
49
|
}))
|
|
@@ -144,7 +140,6 @@ describe('FilterDropdownListHeaderComponent', () => {
|
|
|
144
140
|
mockSetParams.mockClear()
|
|
145
141
|
mockSearchEnabled.mockReturnValue(true)
|
|
146
142
|
mockCanBrowseArchived.mockReturnValue(false)
|
|
147
|
-
mockHideEnabled.mockReturnValue(false)
|
|
148
143
|
setCapabilities({ groups: true, teams: true })
|
|
149
144
|
setRouteParams({})
|
|
150
145
|
})
|
|
@@ -277,43 +272,6 @@ describe('FilterDropdownListHeaderComponent', () => {
|
|
|
277
272
|
expect(view.queryByText('Mark all read')).toBeNull()
|
|
278
273
|
})
|
|
279
274
|
|
|
280
|
-
it('offers More filters when hidden conversations are the only extra filter', () => {
|
|
281
|
-
setCapabilities({ groups: false, teams: false })
|
|
282
|
-
mockHideEnabled.mockReturnValue(true)
|
|
283
|
-
|
|
284
|
-
render(<FilterDropdownListHeaderComponent />)
|
|
285
|
-
|
|
286
|
-
expect(menuItemNames()).toEqual(['All', 'DMs', 'Unread', 'More filters'])
|
|
287
|
-
})
|
|
288
|
-
|
|
289
|
-
it('labels the hidden list and carries it into More filters', () => {
|
|
290
|
-
setRouteParams({ show_hidden: true })
|
|
291
|
-
|
|
292
|
-
render(<FilterDropdownListHeaderComponent />)
|
|
293
|
-
|
|
294
|
-
expect(screen.getByRole('button', { name: 'Hidden' })).toBeTruthy()
|
|
295
|
-
expect(screen.queryByText('Mark all read')).toBeNull()
|
|
296
|
-
|
|
297
|
-
fireEvent.press(screen.getByRole('menuitem', { name: 'More filters' }))
|
|
298
|
-
|
|
299
|
-
expect(mockNavigate).toHaveBeenCalledWith(
|
|
300
|
-
'ConversationFilters',
|
|
301
|
-
expect.objectContaining({ show_hidden: true })
|
|
302
|
-
)
|
|
303
|
-
})
|
|
304
|
-
|
|
305
|
-
it('leaves the hidden list when another filter is picked', () => {
|
|
306
|
-
setRouteParams({ show_hidden: true })
|
|
307
|
-
|
|
308
|
-
render(<FilterDropdownListHeaderComponent />)
|
|
309
|
-
|
|
310
|
-
fireEvent.press(screen.getByRole('menuitem', { name: 'Unread' }))
|
|
311
|
-
|
|
312
|
-
expect(mockSetParams).toHaveBeenCalledWith(
|
|
313
|
-
expect.objectContaining({ show_unread: true, show_hidden: undefined })
|
|
314
|
-
)
|
|
315
|
-
})
|
|
316
|
-
|
|
317
275
|
it('leaves the archived list when another filter is picked', () => {
|
|
318
276
|
setRouteParams({ show_archived: true })
|
|
319
277
|
|
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
import { useApiGet } from '../../../hooks/use_api'
|
|
20
20
|
import { useMarkAllRead } from '../../../hooks/use_conversations_actions'
|
|
21
21
|
import { useCanDisplayGroups } from '../../../hooks/use_groups'
|
|
22
|
-
import { useHideConversationsEnabled } from '../../../hooks/use_hide_conversations_enabled'
|
|
23
22
|
import { useNewConversationFromFilter } from '../../../hooks/use_new_conversation_from_filter'
|
|
24
23
|
import { useSearchEnabled } from '../../../hooks/use_search_enabled'
|
|
25
24
|
import { GraphId, GroupResource } from '../../../types/resources/group_resource'
|
|
@@ -35,7 +34,6 @@ const TRIGGER_CAP_SLACK = 2
|
|
|
35
34
|
const LAYOUT_JITTER = 1
|
|
36
35
|
const ALL_CONVERSATIONS_LABEL = 'All conversations'
|
|
37
36
|
const ARCHIVED_LABEL = 'Archived'
|
|
38
|
-
const HIDDEN_LABEL = 'Hidden'
|
|
39
37
|
|
|
40
38
|
enum FilterTypes {
|
|
41
39
|
All = 'All',
|
|
@@ -65,7 +63,6 @@ export const FilterDropdownListHeaderComponent = () => {
|
|
|
65
63
|
const hasDirectMessages = useHasDirectMessages()
|
|
66
64
|
const canFilterByDMs = directMessagesEligible && hasDirectMessages
|
|
67
65
|
const canBrowseArchived = useCanBrowseArchivedConversations()
|
|
68
|
-
const hideConversationsEnabled = useHideConversationsEnabled()
|
|
69
66
|
const searchEnabled = useSearchEnabled()
|
|
70
67
|
const route = useRoute<RouteProp<ConversationsScreenProps['route']>>()
|
|
71
68
|
const {
|
|
@@ -74,7 +71,6 @@ export const FilterDropdownListHeaderComponent = () => {
|
|
|
74
71
|
group_source_app_name = '',
|
|
75
72
|
show_direct_messages,
|
|
76
73
|
show_archived,
|
|
77
|
-
show_hidden,
|
|
78
74
|
show_unread,
|
|
79
75
|
} = route.params || {}
|
|
80
76
|
const currentPersonCache = useCurrentPersonCache()
|
|
@@ -90,7 +86,7 @@ export const FilterDropdownListHeaderComponent = () => {
|
|
|
90
86
|
)
|
|
91
87
|
|
|
92
88
|
const active: FilterTypes = useMemo(() => {
|
|
93
|
-
if (chat_group_graph_id || show_archived
|
|
89
|
+
if (chat_group_graph_id || show_archived) {
|
|
94
90
|
return FilterTypes.More
|
|
95
91
|
} else if (/groups/i.test(group_source_app_name)) {
|
|
96
92
|
return FilterTypes.Groups
|
|
@@ -103,14 +99,7 @@ export const FilterDropdownListHeaderComponent = () => {
|
|
|
103
99
|
}
|
|
104
100
|
|
|
105
101
|
return FilterTypes.All
|
|
106
|
-
}, [
|
|
107
|
-
chat_group_graph_id,
|
|
108
|
-
group_source_app_name,
|
|
109
|
-
show_direct_messages,
|
|
110
|
-
show_archived,
|
|
111
|
-
show_hidden,
|
|
112
|
-
show_unread,
|
|
113
|
-
])
|
|
102
|
+
}, [chat_group_graph_id, group_source_app_name, show_direct_messages, show_archived, show_unread])
|
|
114
103
|
|
|
115
104
|
const options: FilterDropdownOption[] = useMemo(
|
|
116
105
|
() => [
|
|
@@ -126,11 +115,10 @@ export const FilterDropdownListHeaderComponent = () => {
|
|
|
126
115
|
const triggerLabel = useMemo(() => {
|
|
127
116
|
if (chat_group_graph_id) return group?.name || title || ALL_CONVERSATIONS_LABEL
|
|
128
117
|
if (show_archived) return ARCHIVED_LABEL
|
|
129
|
-
if (show_hidden) return HIDDEN_LABEL
|
|
130
118
|
if (active === FilterTypes.All) return ALL_CONVERSATIONS_LABEL
|
|
131
119
|
|
|
132
120
|
return active
|
|
133
|
-
}, [chat_group_graph_id, group?.name, title, show_archived,
|
|
121
|
+
}, [chat_group_graph_id, group?.name, title, show_archived, active])
|
|
134
122
|
|
|
135
123
|
const handleNewConversationNavigation = useCallback(() => {
|
|
136
124
|
if (newConversationFromFilter || entryMode === 'select_type') {
|
|
@@ -170,7 +158,6 @@ export const FilterDropdownListHeaderComponent = () => {
|
|
|
170
158
|
group_source_app_name: undefined,
|
|
171
159
|
show_direct_messages: undefined,
|
|
172
160
|
show_archived: undefined,
|
|
173
|
-
show_hidden: undefined,
|
|
174
161
|
show_unread: undefined,
|
|
175
162
|
...params,
|
|
176
163
|
})
|
|
@@ -200,7 +187,6 @@ export const FilterDropdownListHeaderComponent = () => {
|
|
|
200
187
|
group_source_app_name,
|
|
201
188
|
show_direct_messages,
|
|
202
189
|
show_archived,
|
|
203
|
-
show_hidden,
|
|
204
190
|
show_unread,
|
|
205
191
|
})
|
|
206
192
|
}, [
|
|
@@ -209,7 +195,6 @@ export const FilterDropdownListHeaderComponent = () => {
|
|
|
209
195
|
group_source_app_name,
|
|
210
196
|
show_direct_messages,
|
|
211
197
|
show_archived,
|
|
212
|
-
show_hidden,
|
|
213
198
|
show_unread,
|
|
214
199
|
])
|
|
215
200
|
|
|
@@ -228,8 +213,7 @@ export const FilterDropdownListHeaderComponent = () => {
|
|
|
228
213
|
])
|
|
229
214
|
}, [active, handleMarkAllRead])
|
|
230
215
|
|
|
231
|
-
const showMoreFilters =
|
|
232
|
-
canFilterByGroups || canFilterByTeams || canBrowseArchived || hideConversationsEnabled
|
|
216
|
+
const showMoreFilters = canFilterByGroups || canFilterByTeams || canBrowseArchived
|
|
233
217
|
|
|
234
218
|
const styles = useStyles()
|
|
235
219
|
|
|
@@ -317,7 +301,7 @@ export const FilterDropdownListHeaderComponent = () => {
|
|
|
317
301
|
)}
|
|
318
302
|
</View>
|
|
319
303
|
</View>
|
|
320
|
-
{!show_archived &&
|
|
304
|
+
{!show_archived && (
|
|
321
305
|
<View style={styles.markAllReadRow}>
|
|
322
306
|
<TextButton
|
|
323
307
|
onPress={alertMarkAllRead}
|
|
@@ -45,7 +45,6 @@ export const ListHeaderComponent = () => {
|
|
|
45
45
|
group_source_app_name = '',
|
|
46
46
|
show_direct_messages,
|
|
47
47
|
show_archived,
|
|
48
|
-
show_hidden,
|
|
49
48
|
} = route.params || {}
|
|
50
49
|
const currentPersonCache = useCurrentPersonCache()
|
|
51
50
|
const { markAllRead, isPending } = useMarkAllRead()
|
|
@@ -56,7 +55,7 @@ export const ListHeaderComponent = () => {
|
|
|
56
55
|
)
|
|
57
56
|
|
|
58
57
|
const active: FilterTypes = useMemo(() => {
|
|
59
|
-
if (chat_group_graph_id || show_archived
|
|
58
|
+
if (chat_group_graph_id || show_archived) {
|
|
60
59
|
return FilterTypes.More
|
|
61
60
|
} else if (/groups/i.test(group_source_app_name)) {
|
|
62
61
|
return FilterTypes.Groups
|
|
@@ -67,7 +66,7 @@ export const ListHeaderComponent = () => {
|
|
|
67
66
|
}
|
|
68
67
|
|
|
69
68
|
return FilterTypes.All
|
|
70
|
-
}, [chat_group_graph_id, group_source_app_name, show_direct_messages, show_archived
|
|
69
|
+
}, [chat_group_graph_id, group_source_app_name, show_direct_messages, show_archived])
|
|
71
70
|
|
|
72
71
|
const handleNewConversationNavigation = useCallback(() => {
|
|
73
72
|
if (newConversationFromFilter || entryMode === 'select_type') {
|
|
@@ -107,7 +106,6 @@ export const ListHeaderComponent = () => {
|
|
|
107
106
|
group_source_app_name: undefined,
|
|
108
107
|
show_direct_messages: undefined,
|
|
109
108
|
show_archived: undefined,
|
|
110
|
-
show_hidden: undefined,
|
|
111
109
|
...params,
|
|
112
110
|
})
|
|
113
111
|
},
|
|
@@ -124,16 +122,8 @@ export const ListHeaderComponent = () => {
|
|
|
124
122
|
group_source_app_name,
|
|
125
123
|
show_direct_messages,
|
|
126
124
|
show_archived,
|
|
127
|
-
show_hidden,
|
|
128
125
|
})
|
|
129
|
-
}, [
|
|
130
|
-
navigation,
|
|
131
|
-
chat_group_graph_id,
|
|
132
|
-
group_source_app_name,
|
|
133
|
-
show_direct_messages,
|
|
134
|
-
show_archived,
|
|
135
|
-
show_hidden,
|
|
136
|
-
])
|
|
126
|
+
}, [navigation, chat_group_graph_id, group_source_app_name, show_direct_messages, show_archived])
|
|
137
127
|
|
|
138
128
|
const handleMarkAllRead = useCallback(() => {
|
|
139
129
|
currentPersonCache.update({ unreadCount: 0 })
|
|
@@ -174,7 +164,7 @@ export const ListHeaderComponent = () => {
|
|
|
174
164
|
<Heading numberOfLines={1} variant="h2">
|
|
175
165
|
Conversations
|
|
176
166
|
</Heading>
|
|
177
|
-
{!show_archived &&
|
|
167
|
+
{!show_archived && (
|
|
178
168
|
<TextButton
|
|
179
169
|
onPress={alertMarkAllRead}
|
|
180
170
|
disabled={isPending}
|