@planningcenter/chat-react-native 4.7.1-qa-staging.0 → 4.7.1-qa-1092.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 +186 -322
- package/build/components/conversations/conversation_actions.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 +27 -32
- 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 +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/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/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/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/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/package.json +3 -3
- package/src/components/conversations/__tests__/conversation_actions.test.tsx +2 -76
- package/src/components/conversations/conversation_actions.tsx +4 -68
- package/src/components/group_conversation_list.tsx +1 -4
- package/src/contexts/conversations_context.tsx +1 -6
- package/src/hooks/use_conversation.ts +0 -1
- package/src/hooks/use_features.ts +0 -1
- package/src/navigation/index.tsx +0 -8
- package/src/screens/__tests__/conversation_details_screen.test.tsx +1 -49
- package/src/screens/conversation_details_screen.tsx +0 -19
- package/src/screens/conversations/__tests__/conversations_screen.test.tsx +0 -1
- package/src/screens/conversations/conversations_screen.tsx +0 -2
- package/src/screens/index.ts +0 -1
- package/src/types/resources/conversation_membership.ts +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_hide_conversation.d.ts +0 -107
- package/build/hooks/use_hide_conversation.d.ts.map +0 -1
- package/build/hooks/use_hide_conversation.js +0 -238
- 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/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/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 -147
- package/src/hooks/use_hide_conversation.ts +0 -118
- 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/toast_store.ts +0 -45
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { StaticScreenProps, useNavigation } from '@react-navigation/native'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import { StyleSheet } from 'react-native'
|
|
4
|
-
import FormSheet, { getFormSheetScreenOptions } from '../components/primitive/form_sheet'
|
|
5
|
-
import { useConversation } from '../hooks/use_conversation'
|
|
6
|
-
import { useHideConversation } from '../hooks/use_hide_conversation'
|
|
7
|
-
import { useHideConversationsEnabled } from '../hooks/use_hide_conversations_enabled'
|
|
8
|
-
|
|
9
|
-
export const ConversationActionsScreenOptions = getFormSheetScreenOptions({
|
|
10
|
-
headerTitle: 'Conversation actions',
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
export type ConversationActionsScreenProps = StaticScreenProps<{
|
|
14
|
-
conversation_id: number
|
|
15
|
-
}>
|
|
16
|
-
|
|
17
|
-
export function ConversationActionsScreen({ route }: ConversationActionsScreenProps) {
|
|
18
|
-
const navigation = useNavigation()
|
|
19
|
-
const styles = useStyles()
|
|
20
|
-
const { data: conversation } = useConversation(route.params)
|
|
21
|
-
const { hidden, setHidden, isPending } = useHideConversation({ conversation })
|
|
22
|
-
const hideConversationsEnabled = useHideConversationsEnabled()
|
|
23
|
-
|
|
24
|
-
const handleHidePress = () => {
|
|
25
|
-
setHidden(!hidden)
|
|
26
|
-
navigation.goBack()
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<FormSheet.Root style={styles.formSheetContent}>
|
|
31
|
-
{hideConversationsEnabled && (
|
|
32
|
-
<FormSheet.Action
|
|
33
|
-
onPress={handleHidePress}
|
|
34
|
-
title={hidden ? 'Unhide conversation' : 'Hide conversation'}
|
|
35
|
-
iconName={hidden ? 'general.showEye' : 'general.hideEye'}
|
|
36
|
-
disabled={isPending}
|
|
37
|
-
accessibilityHint={
|
|
38
|
-
hidden
|
|
39
|
-
? 'Shows this conversation in your conversation list again.'
|
|
40
|
-
: 'Hides this conversation from your conversation list.'
|
|
41
|
-
}
|
|
42
|
-
/>
|
|
43
|
-
)}
|
|
44
|
-
</FormSheet.Root>
|
|
45
|
-
)
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const useStyles = () =>
|
|
49
|
-
StyleSheet.create({
|
|
50
|
-
formSheetContent: {
|
|
51
|
-
paddingTop: 16,
|
|
52
|
-
},
|
|
53
|
-
})
|
package/src/utils/toast_store.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
export interface ToastAction {
|
|
2
|
-
label: string
|
|
3
|
-
onPress: () => void
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export interface ToastOptions {
|
|
7
|
-
title: string
|
|
8
|
-
subtitle?: string
|
|
9
|
-
action?: ToastAction
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface ToastState extends ToastOptions {
|
|
13
|
-
id: number
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
type Listener = () => void
|
|
17
|
-
|
|
18
|
-
let currentToast: ToastState | null = null
|
|
19
|
-
let nextId = 1
|
|
20
|
-
const listeners = new Set<Listener>()
|
|
21
|
-
|
|
22
|
-
const emit = () => listeners.forEach(listener => listener())
|
|
23
|
-
|
|
24
|
-
export const toastStore = {
|
|
25
|
-
getSnapshot: () => currentToast,
|
|
26
|
-
subscribe: (listener: Listener) => {
|
|
27
|
-
listeners.add(listener)
|
|
28
|
-
return () => {
|
|
29
|
-
listeners.delete(listener)
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export function showToast(options: ToastOptions) {
|
|
35
|
-
currentToast = { ...options, id: nextId++ }
|
|
36
|
-
emit()
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export function dismissToast(id?: number) {
|
|
40
|
-
if (!currentToast) return
|
|
41
|
-
if (id !== undefined && currentToast.id !== id) return
|
|
42
|
-
|
|
43
|
-
currentToast = null
|
|
44
|
-
emit()
|
|
45
|
-
}
|