@planningcenter/chat-react-native 3.39.0-rc.8 → 3.39.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/conversation_start_banner.d.ts +10 -0
- package/build/components/conversation/conversation_start_banner.d.ts.map +1 -0
- package/build/components/conversation/conversation_start_banner.js +68 -0
- package/build/components/conversation/conversation_start_banner.js.map +1 -0
- package/build/components/conversation/messages_disabled_banners.d.ts +6 -1
- package/build/components/conversation/messages_disabled_banners.d.ts.map +1 -1
- package/build/components/conversation/messages_disabled_banners.js +8 -2
- package/build/components/conversation/messages_disabled_banners.js.map +1 -1
- package/build/components/primitive/form_sheet.d.ts +1 -0
- package/build/components/primitive/form_sheet.d.ts.map +1 -1
- package/build/components/primitive/form_sheet.js +17 -7
- package/build/components/primitive/form_sheet.js.map +1 -1
- package/build/hooks/use_conversation.d.ts.map +1 -1
- package/build/hooks/use_conversation.js +2 -0
- package/build/hooks/use_conversation.js.map +1 -1
- package/build/hooks/use_conversation_jolt_events.d.ts.map +1 -1
- package/build/hooks/use_conversation_jolt_events.js +2 -2
- package/build/hooks/use_conversation_jolt_events.js.map +1 -1
- package/build/hooks/use_current_person.d.ts.map +1 -1
- package/build/hooks/use_current_person.js +2 -0
- package/build/hooks/use_current_person.js.map +1 -1
- package/build/hooks/use_person_settings.d.ts +6 -0
- package/build/hooks/use_person_settings.d.ts.map +1 -0
- package/build/hooks/use_person_settings.js +26 -0
- package/build/hooks/use_person_settings.js.map +1 -0
- package/build/navigation/index.d.ts +13 -0
- package/build/navigation/index.d.ts.map +1 -1
- package/build/navigation/index.js +9 -0
- package/build/navigation/index.js.map +1 -1
- package/build/screens/conversation_details_screen.d.ts.map +1 -1
- package/build/screens/conversation_details_screen.js +2 -1
- package/build/screens/conversation_details_screen.js.map +1 -1
- package/build/screens/conversation_screen.d.ts.map +1 -1
- package/build/screens/conversation_screen.js +9 -3
- package/build/screens/conversation_screen.js.map +1 -1
- package/build/screens/conversation_select_type_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_type_screen.js +4 -2
- package/build/screens/conversation_select_type_screen.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 +4 -0
- package/build/screens/conversations/components/list_header_component.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/screens/settings_screen.d.ts +5 -0
- package/build/screens/settings_screen.d.ts.map +1 -0
- package/build/screens/settings_screen.js +56 -0
- package/build/screens/settings_screen.js.map +1 -0
- package/build/types/jolt_events/conversation_events.d.ts +2 -0
- package/build/types/jolt_events/conversation_events.d.ts.map +1 -1
- package/build/types/jolt_events/conversation_events.js.map +1 -1
- package/build/types/resources/conversation.d.ts +3 -0
- package/build/types/resources/conversation.d.ts.map +1 -1
- package/build/types/resources/conversation.js.map +1 -1
- package/build/types/resources/person.d.ts +2 -0
- package/build/types/resources/person.d.ts.map +1 -1
- package/build/types/resources/person.js.map +1 -1
- package/build/utils/request/conversation.d.ts.map +1 -1
- package/build/utils/request/conversation.js +1 -0
- package/build/utils/request/conversation.js.map +1 -1
- package/package.json +2 -2
- package/src/components/conversation/conversation_start_banner.tsx +102 -0
- package/src/components/conversation/messages_disabled_banners.tsx +16 -2
- package/src/components/primitive/form_sheet.tsx +23 -6
- package/src/hooks/use_conversation.ts +2 -0
- package/src/hooks/use_conversation_jolt_events.ts +3 -2
- package/src/hooks/use_current_person.ts +2 -0
- package/src/hooks/use_person_settings.ts +29 -0
- package/src/navigation/index.tsx +11 -0
- package/src/screens/conversation_details_screen.tsx +2 -1
- package/src/screens/conversation_screen.tsx +13 -3
- package/src/screens/conversation_select_type_screen.tsx +6 -2
- package/src/screens/conversations/components/list_header_component.tsx +12 -0
- package/src/screens/index.ts +1 -0
- package/src/screens/settings_screen.tsx +67 -0
- package/src/types/jolt_events/conversation_events.ts +2 -0
- package/src/types/resources/conversation.ts +4 -0
- package/src/types/resources/person.ts +2 -0
- package/src/utils/request/conversation.ts +1 -0
|
@@ -242,6 +242,7 @@ interface FormSheetActionProps {
|
|
|
242
242
|
accessibilityRole?: AccessibilityRole
|
|
243
243
|
appearance?: FormSheetActionAppearanceUnion
|
|
244
244
|
disabled?: boolean
|
|
245
|
+
disabledReason?: string
|
|
245
246
|
}
|
|
246
247
|
|
|
247
248
|
function FormSheetAction({
|
|
@@ -253,14 +254,17 @@ function FormSheetAction({
|
|
|
253
254
|
accessibilityRole = 'button',
|
|
254
255
|
appearance = 'neutral',
|
|
255
256
|
disabled = false,
|
|
257
|
+
disabledReason,
|
|
256
258
|
}: FormSheetActionProps) {
|
|
257
|
-
const styles = useStyles({ appearance })
|
|
259
|
+
const styles = useStyles({ appearance, disabled })
|
|
258
260
|
|
|
259
261
|
return (
|
|
260
262
|
<PlatformPressable
|
|
261
263
|
onPress={onPress}
|
|
262
264
|
accessibilityLabel={accessibilityLabel}
|
|
263
|
-
accessibilityHint={
|
|
265
|
+
accessibilityHint={
|
|
266
|
+
accessibilityHint ?? (disabled && disabledReason ? disabledReason : undefined)
|
|
267
|
+
}
|
|
264
268
|
accessibilityRole={accessibilityRole}
|
|
265
269
|
style={styles.actionPressable}
|
|
266
270
|
disabled={disabled}
|
|
@@ -268,7 +272,12 @@ function FormSheetAction({
|
|
|
268
272
|
{iconName && (
|
|
269
273
|
<Icon name={iconName} size={16} accessibilityElementsHidden style={styles.actionIcon} />
|
|
270
274
|
)}
|
|
271
|
-
<
|
|
275
|
+
<View style={styles.actionTextBlock}>
|
|
276
|
+
<Text style={styles.actionTitle}>{title}</Text>
|
|
277
|
+
{disabled && disabledReason && (
|
|
278
|
+
<Text style={styles.actionDisabledReason}>{disabledReason}</Text>
|
|
279
|
+
)}
|
|
280
|
+
</View>
|
|
272
281
|
</PlatformPressable>
|
|
273
282
|
)
|
|
274
283
|
}
|
|
@@ -281,9 +290,10 @@ FormSheetAction.displayName = 'FormSheet.Action'
|
|
|
281
290
|
|
|
282
291
|
interface Styles {
|
|
283
292
|
appearance?: FormSheetActionAppearanceUnion
|
|
293
|
+
disabled?: boolean
|
|
284
294
|
}
|
|
285
295
|
|
|
286
|
-
const useStyles = ({ appearance = 'neutral' }: Styles = {}) => {
|
|
296
|
+
const useStyles = ({ appearance = 'neutral', disabled = false }: Styles = {}) => {
|
|
287
297
|
const { colors } = useTheme()
|
|
288
298
|
const { height } = useWindowDimensions()
|
|
289
299
|
const { bottom, top } = useSafeAreaInsets()
|
|
@@ -368,10 +378,17 @@ const useStyles = ({ appearance = 'neutral' }: Styles = {}) => {
|
|
|
368
378
|
gap: 8,
|
|
369
379
|
},
|
|
370
380
|
actionIcon: {
|
|
371
|
-
color: appearanceColorsMap[appearance].iconColor,
|
|
381
|
+
color: disabled ? colors.textColorDefaultDisabled : appearanceColorsMap[appearance].iconColor,
|
|
382
|
+
},
|
|
383
|
+
actionTextBlock: {
|
|
384
|
+
flex: 1,
|
|
372
385
|
},
|
|
373
386
|
actionTitle: {
|
|
374
|
-
color: appearanceColorsMap[appearance].textColor,
|
|
387
|
+
color: disabled ? colors.textColorDefaultDisabled : appearanceColorsMap[appearance].textColor,
|
|
388
|
+
},
|
|
389
|
+
actionDisabledReason: {
|
|
390
|
+
color: colors.textColorDefaultDisabled,
|
|
391
|
+
fontSize: 12,
|
|
375
392
|
},
|
|
376
393
|
})
|
|
377
394
|
}
|
|
@@ -28,7 +28,9 @@ export const getConversationRequestArgs = ({ conversation_id }: { conversation_i
|
|
|
28
28
|
'custom_avatar_key',
|
|
29
29
|
'custom_avatar_color',
|
|
30
30
|
'custom_avatar_image_url',
|
|
31
|
+
'direct_message',
|
|
31
32
|
'disabled',
|
|
33
|
+
'disabled_reason',
|
|
32
34
|
'member_ability',
|
|
33
35
|
'muted',
|
|
34
36
|
'replies_disabled',
|
|
@@ -26,7 +26,8 @@ export function useConversationJoltEvents({ conversationId }: Props) {
|
|
|
26
26
|
|
|
27
27
|
const handleUpdatedConversation = useCallback(
|
|
28
28
|
(e: JoltConversationEvent) => {
|
|
29
|
-
const { last_message_idempotent_key, last_message_author_id, disabled } =
|
|
29
|
+
const { last_message_idempotent_key, last_message_author_id, disabled, disabled_reason } =
|
|
30
|
+
e.data.data
|
|
30
31
|
|
|
31
32
|
if (last_message_idempotent_key && last_message_author_id === currentPersonId) {
|
|
32
33
|
completeMessageCreationConversationTracking({
|
|
@@ -37,7 +38,7 @@ export function useConversationJoltEvents({ conversationId }: Props) {
|
|
|
37
38
|
|
|
38
39
|
queryClient.setQueryData<ApiResource<ConversationResource>>(queryKey, prev => {
|
|
39
40
|
if (!prev?.data) return prev
|
|
40
|
-
return { ...prev, data: { ...prev.data, disabled } }
|
|
41
|
+
return { ...prev, data: { ...prev.data, disabled, disabledReason: disabled_reason } }
|
|
41
42
|
})
|
|
42
43
|
|
|
43
44
|
queryClient.invalidateQueries({ queryKey })
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useMutation } from '@tanstack/react-query'
|
|
2
|
+
import { throwResponseError } from '../utils/response_error'
|
|
3
|
+
import { useApiClient } from './use_api_client'
|
|
4
|
+
import { useCurrentPerson, useCurrentPersonCache } from './use_current_person'
|
|
5
|
+
|
|
6
|
+
export function usePersonSettings() {
|
|
7
|
+
const apiClient = useApiClient()
|
|
8
|
+
const person = useCurrentPerson()
|
|
9
|
+
const { update, invalidate } = useCurrentPersonCache()
|
|
10
|
+
|
|
11
|
+
const directMessagesDisabled = person?.directMessagesDisabled ?? false
|
|
12
|
+
|
|
13
|
+
const { mutate: setDirectMessagesDisabled, isPending: isMutating } = useMutation({
|
|
14
|
+
mutationFn: (disabled: boolean) => {
|
|
15
|
+
const action = disabled ? 'disable_direct_messages' : 'enable_direct_messages'
|
|
16
|
+
return apiClient.chat
|
|
17
|
+
.post({ url: `/me/${action}`, data: { data: { type: 'Person', attributes: {} } } })
|
|
18
|
+
.catch(throwResponseError)
|
|
19
|
+
},
|
|
20
|
+
onMutate: disabled => {
|
|
21
|
+
update({ directMessagesDisabled: disabled })
|
|
22
|
+
},
|
|
23
|
+
onError: () => {
|
|
24
|
+
invalidate()
|
|
25
|
+
},
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
return { directMessagesDisabled, setDirectMessagesDisabled, isMutating }
|
|
29
|
+
}
|
package/src/navigation/index.tsx
CHANGED
|
@@ -77,6 +77,7 @@ import { NotificationSettingsScreen } from '../screens/notification_settings_scr
|
|
|
77
77
|
import { PreferredAppSelectionScreen } from '../screens/preferred_app_selection_screen'
|
|
78
78
|
import { ReactionsScreen, ReactionsScreenOptions } from '../screens/reactions_screen'
|
|
79
79
|
import { SendGiphyScreen, SendGiphyScreenOptions } from '../screens/send_giphy_screen'
|
|
80
|
+
import { SettingsScreen } from '../screens/settings_screen'
|
|
80
81
|
import {
|
|
81
82
|
SystemMessagePeopleScreen,
|
|
82
83
|
SystemMessagePeopleScreenOptions,
|
|
@@ -280,6 +281,16 @@ export const ChatStack = createNativeStackNavigator({
|
|
|
280
281
|
screen: AvatarPickerScreen,
|
|
281
282
|
options: AvatarPickerScreenOptions,
|
|
282
283
|
},
|
|
284
|
+
ChatSettings: {
|
|
285
|
+
screen: SettingsScreen,
|
|
286
|
+
options: ({ navigation }) => ({
|
|
287
|
+
title: 'Chat settings',
|
|
288
|
+
headerBackVisible: false,
|
|
289
|
+
headerRight: (props: NativeStackHeaderRightProps) => (
|
|
290
|
+
<HeaderTextButton {...props} onPress={navigation.goBack} title="Done" />
|
|
291
|
+
),
|
|
292
|
+
}),
|
|
293
|
+
},
|
|
283
294
|
NotificationSettings: {
|
|
284
295
|
screen: NotificationSettingsScreen,
|
|
285
296
|
options: ({ navigation }) => ({
|
|
@@ -122,6 +122,7 @@ export function ConversationDetailsScreen({ route }: ConversationDetailsScreenPr
|
|
|
122
122
|
const canDelete = conversation.memberAbility?.canDelete || false
|
|
123
123
|
const isLeader = conversation.memberAbility?.leader || false
|
|
124
124
|
const isDisabled = conversation.disabled ?? false
|
|
125
|
+
const showAdultRequirementNotice = isDisabled && conversation.disabledReason === 'safety_check'
|
|
125
126
|
|
|
126
127
|
const {
|
|
127
128
|
data: members,
|
|
@@ -350,7 +351,7 @@ export function ConversationDetailsScreen({ route }: ConversationDetailsScreenPr
|
|
|
350
351
|
sectionInnerStyle: styles.sectionInnerGenderNotice,
|
|
351
352
|
},
|
|
352
353
|
{
|
|
353
|
-
type:
|
|
354
|
+
type: showAdultRequirementNotice ? SectionTypes.view : SectionTypes.hidden,
|
|
354
355
|
data: {
|
|
355
356
|
children: <AdultRequirementNotice />,
|
|
356
357
|
},
|
|
@@ -12,7 +12,7 @@ import React, { useCallback, useEffect, useRef, useState } from 'react'
|
|
|
12
12
|
import { FlatList, Platform, StyleSheet, View } from 'react-native'
|
|
13
13
|
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
14
14
|
import { Badge, Icon, Text } from '../components'
|
|
15
|
-
import {
|
|
15
|
+
import { ConversationStartBanner } from '../components/conversation/conversation_start_banner'
|
|
16
16
|
import { JumpToBottomButton } from '../components/conversation/jump_to_bottom_button'
|
|
17
17
|
import { Message } from '../components/conversation/message'
|
|
18
18
|
import { MessageForm } from '../components/conversation/message_form'
|
|
@@ -166,7 +166,9 @@ function ConversationScreenContent({ route }: ConversationScreenProps) {
|
|
|
166
166
|
<View style={styles.container}>
|
|
167
167
|
<KeyboardView>
|
|
168
168
|
{noMessages ? (
|
|
169
|
-
<
|
|
169
|
+
<View style={styles.emptyState}>
|
|
170
|
+
<ConversationStartBanner conversation={conversation} hasMessages={false} />
|
|
171
|
+
</View>
|
|
170
172
|
) : (
|
|
171
173
|
<FlatList
|
|
172
174
|
inverted
|
|
@@ -176,6 +178,9 @@ function ConversationScreenContent({ route }: ConversationScreenProps) {
|
|
|
176
178
|
keyExtractor={item => item.id}
|
|
177
179
|
onScroll={trackScroll}
|
|
178
180
|
scrollEventThrottle={10}
|
|
181
|
+
ListFooterComponent={
|
|
182
|
+
<ConversationStartBanner conversation={conversation} hasMessages={true} />
|
|
183
|
+
}
|
|
179
184
|
renderItem={({ item }) => {
|
|
180
185
|
if (item.type === 'DateSeparator') {
|
|
181
186
|
return <InlineDateSeparator {...item} />
|
|
@@ -239,7 +244,8 @@ function ConversationBottomBar({
|
|
|
239
244
|
replyRootId,
|
|
240
245
|
currentlyEditingMessage,
|
|
241
246
|
}: ConversationBottomBarProps) {
|
|
242
|
-
if (conversation.disabled)
|
|
247
|
+
if (conversation.disabled)
|
|
248
|
+
return <ConversationDisabledBanner disabledReason={conversation.disabledReason} />
|
|
243
249
|
if (!canReply) return <MemberMessagesDisabledBanner />
|
|
244
250
|
return (
|
|
245
251
|
<MessageForm.Root
|
|
@@ -386,6 +392,10 @@ const useStyles = () => {
|
|
|
386
392
|
backgroundColor: navigationTheme.colors.card,
|
|
387
393
|
paddingBottom: bottom,
|
|
388
394
|
},
|
|
395
|
+
emptyState: {
|
|
396
|
+
flex: 1,
|
|
397
|
+
justifyContent: 'center',
|
|
398
|
+
},
|
|
389
399
|
listContainer: {
|
|
390
400
|
paddingVertical: 12,
|
|
391
401
|
},
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { StaticScreenProps, useNavigation } from '@react-navigation/native'
|
|
2
2
|
import React from 'react'
|
|
3
3
|
import FormSheet, { getFormSheetScreenOptions } from '../components/primitive/form_sheet'
|
|
4
|
+
import { useCurrentPerson } from '../hooks/use_current_person'
|
|
4
5
|
import { availableFeatures, useFeatures } from '../hooks/use_features'
|
|
5
6
|
import { useNewConversationEntry } from '../hooks/use_new_conversation_entry'
|
|
6
7
|
import type { NewConversationFromFilter } from '../hooks/use_new_conversation_from_filter'
|
|
@@ -27,13 +28,14 @@ export function ConversationSelectTypeScreen({ route }: ConversationSelectTypeSc
|
|
|
27
28
|
const navigation = useNavigation()
|
|
28
29
|
const entryMode = useNewConversationEntry()
|
|
29
30
|
const { featureEnabled } = useFeatures()
|
|
31
|
+
const { directMessagesDisabled, under_18 } = useCurrentPerson()
|
|
30
32
|
const { newConversationFromFilter, chat_group_graph_id, group_source_app_name } =
|
|
31
33
|
route.params || {}
|
|
32
34
|
|
|
33
35
|
const filterParams = { chat_group_graph_id, group_source_app_name }
|
|
34
36
|
const canCreateGroups = entryMode === 'select_type' || entryMode === 'groups'
|
|
35
37
|
const canCreateTeams = entryMode === 'select_type' || entryMode === 'teams'
|
|
36
|
-
const
|
|
38
|
+
const dmFeatureEnabled = featureEnabled(availableFeatures.direct_messages_eap)
|
|
37
39
|
|
|
38
40
|
const handleFilterPress = () => {
|
|
39
41
|
if (!newConversationFromFilter) return
|
|
@@ -101,10 +103,12 @@ export function ConversationSelectTypeScreen({ route }: ConversationSelectTypeSc
|
|
|
101
103
|
accessibilityHint="Opens team selection screen"
|
|
102
104
|
/>
|
|
103
105
|
)}
|
|
104
|
-
{
|
|
106
|
+
{dmFeatureEnabled && !under_18 && (
|
|
105
107
|
<FormSheet.Action
|
|
106
108
|
title="Direct message"
|
|
107
109
|
onPress={handleDirectMessagePress}
|
|
110
|
+
disabled={directMessagesDisabled}
|
|
111
|
+
disabledReason={directMessagesDisabled ? 'Disabled in chat settings' : undefined}
|
|
108
112
|
accessibilityHint="Opens direct message recipient selection screen"
|
|
109
113
|
/>
|
|
110
114
|
)}
|
|
@@ -91,6 +91,10 @@ export const ListHeaderComponent = () => {
|
|
|
91
91
|
}
|
|
92
92
|
}, [navigation, route.params, entryMode, newConversationFromFilter])
|
|
93
93
|
|
|
94
|
+
const handleChatSettings = useCallback(() => {
|
|
95
|
+
navigation.navigate('ChatSettings', {})
|
|
96
|
+
}, [navigation])
|
|
97
|
+
|
|
94
98
|
const handleMoreOptions = useCallback(() => {
|
|
95
99
|
navigation.navigate('ConversationsMoreActions')
|
|
96
100
|
}, [navigation])
|
|
@@ -153,6 +157,14 @@ export const ListHeaderComponent = () => {
|
|
|
153
157
|
</TextButton>
|
|
154
158
|
</View>
|
|
155
159
|
<View style={styles.actionsContainer}>
|
|
160
|
+
{directMessagesEnabled && (
|
|
161
|
+
<ListHeaderActionButton
|
|
162
|
+
name="general.cog"
|
|
163
|
+
onPress={handleChatSettings}
|
|
164
|
+
accessibilityLabel="Chat settings"
|
|
165
|
+
maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}
|
|
166
|
+
/>
|
|
167
|
+
)}
|
|
156
168
|
{canCreateConversations && (
|
|
157
169
|
<ListHeaderActionButton
|
|
158
170
|
name="churchCenter.signups"
|
package/src/screens/index.ts
CHANGED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { StaticScreenProps } from '@react-navigation/native'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { StyleSheet, View } from 'react-native'
|
|
4
|
+
import { Heading, Text } from '../components'
|
|
5
|
+
import { Switch } from '../components/display/switch'
|
|
6
|
+
import { useTheme } from '../hooks'
|
|
7
|
+
import { usePersonSettings } from '../hooks/use_person_settings'
|
|
8
|
+
|
|
9
|
+
export type SettingsScreenProps = StaticScreenProps<{}>
|
|
10
|
+
|
|
11
|
+
export function SettingsScreen({}: SettingsScreenProps) {
|
|
12
|
+
const styles = useStyles()
|
|
13
|
+
const { directMessagesDisabled, setDirectMessagesDisabled, isMutating } = usePersonSettings()
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<View style={styles.container}>
|
|
17
|
+
<View style={styles.sectionOuter}>
|
|
18
|
+
<View style={styles.sectionHeader}>
|
|
19
|
+
<Heading variant="h2">Messages</Heading>
|
|
20
|
+
</View>
|
|
21
|
+
<View style={styles.settingRow}>
|
|
22
|
+
<View style={styles.settingRowText}>
|
|
23
|
+
<Text>Allow direct messages</Text>
|
|
24
|
+
<Text variant="tertiary">
|
|
25
|
+
When disabled, you won't be able to participate in direct messages.
|
|
26
|
+
</Text>
|
|
27
|
+
</View>
|
|
28
|
+
<Switch
|
|
29
|
+
value={!directMessagesDisabled}
|
|
30
|
+
onValueChange={enabled => setDirectMessagesDisabled(!enabled)}
|
|
31
|
+
disabled={isMutating}
|
|
32
|
+
/>
|
|
33
|
+
</View>
|
|
34
|
+
</View>
|
|
35
|
+
</View>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const useStyles = () => {
|
|
40
|
+
const { colors } = useTheme()
|
|
41
|
+
return StyleSheet.create({
|
|
42
|
+
container: {
|
|
43
|
+
flex: 1,
|
|
44
|
+
},
|
|
45
|
+
sectionOuter: {
|
|
46
|
+
paddingLeft: 16,
|
|
47
|
+
},
|
|
48
|
+
sectionHeader: {
|
|
49
|
+
paddingRight: 16,
|
|
50
|
+
paddingTop: 24,
|
|
51
|
+
paddingBottom: 12,
|
|
52
|
+
borderBottomWidth: 1,
|
|
53
|
+
borderBottomColor: colors.borderColorDefaultBase,
|
|
54
|
+
},
|
|
55
|
+
settingRow: {
|
|
56
|
+
flexDirection: 'row',
|
|
57
|
+
alignItems: 'flex-start',
|
|
58
|
+
justifyContent: 'space-between',
|
|
59
|
+
paddingRight: 16,
|
|
60
|
+
paddingVertical: 12,
|
|
61
|
+
},
|
|
62
|
+
settingRowText: {
|
|
63
|
+
flex: 1,
|
|
64
|
+
gap: 8,
|
|
65
|
+
},
|
|
66
|
+
})
|
|
67
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CustomMessage } from '@planningcenter/jolt-client/dist/types/JoltConnection'
|
|
2
|
+
import type { ConversationDisabledReason } from '../resources/conversation'
|
|
2
3
|
|
|
3
4
|
type DateString = string
|
|
4
5
|
interface BaseConversationEventData extends Record<string, unknown> {
|
|
@@ -15,6 +16,7 @@ interface BaseConversationEventData extends Record<string, unknown> {
|
|
|
15
16
|
latest_read_message_sort_key?: string
|
|
16
17
|
organization_id: number
|
|
17
18
|
disabled: boolean
|
|
19
|
+
disabled_reason?: ConversationDisabledReason
|
|
18
20
|
replies_disabled: boolean
|
|
19
21
|
subtitle?: string
|
|
20
22
|
title: string
|
|
@@ -4,6 +4,8 @@ import { ConversationMembershipResource } from './conversation_membership'
|
|
|
4
4
|
import { GroupResource } from './group_resource'
|
|
5
5
|
import { MemberAbilityResource } from './member_ability'
|
|
6
6
|
|
|
7
|
+
export type ConversationDisabledReason = 'safety_check' | 'direct_messages_disabled'
|
|
8
|
+
|
|
7
9
|
export interface ConversationResource {
|
|
8
10
|
type: 'Conversation'
|
|
9
11
|
id: number
|
|
@@ -12,7 +14,9 @@ export interface ConversationResource {
|
|
|
12
14
|
conversationMembership?: Partial<ConversationMembershipResource>
|
|
13
15
|
createdAt: string
|
|
14
16
|
deleted?: boolean
|
|
17
|
+
directMessage?: boolean
|
|
15
18
|
disabled?: boolean
|
|
19
|
+
disabledReason?: ConversationDisabledReason
|
|
16
20
|
genderOption?: string | null
|
|
17
21
|
groups?: GroupResource[]
|
|
18
22
|
previewAvatarUrls?: string[]
|