@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.
Files changed (76) hide show
  1. package/build/components/conversations/conversation_actions.d.ts.map +1 -1
  2. package/build/components/conversations/conversation_actions.js +186 -322
  3. package/build/components/conversations/conversation_actions.js.map +1 -1
  4. package/build/components/group_conversation_list.d.ts.map +1 -1
  5. package/build/components/group_conversation_list.js +0 -1
  6. package/build/components/group_conversation_list.js.map +1 -1
  7. package/build/contexts/conversations_context.d.ts +1 -3
  8. package/build/contexts/conversations_context.d.ts.map +1 -1
  9. package/build/contexts/conversations_context.js +27 -32
  10. package/build/contexts/conversations_context.js.map +1 -1
  11. package/build/hooks/use_conversation.d.ts.map +1 -1
  12. package/build/hooks/use_conversation.js +1 -1
  13. package/build/hooks/use_conversation.js.map +1 -1
  14. package/build/hooks/use_features.d.ts +0 -1
  15. package/build/hooks/use_features.d.ts.map +1 -1
  16. package/build/hooks/use_features.js +1 -2
  17. package/build/hooks/use_features.js.map +1 -1
  18. package/build/navigation/index.d.ts +0 -5
  19. package/build/navigation/index.d.ts.map +1 -1
  20. package/build/navigation/index.js +0 -5
  21. package/build/navigation/index.js.map +1 -1
  22. package/build/screens/conversation_details_screen.d.ts.map +1 -1
  23. package/build/screens/conversation_details_screen.js +394 -460
  24. package/build/screens/conversation_details_screen.js.map +1 -1
  25. package/build/screens/conversations/conversations_screen.d.ts.map +1 -1
  26. package/build/screens/conversations/conversations_screen.js +10 -18
  27. package/build/screens/conversations/conversations_screen.js.map +1 -1
  28. package/build/screens/index.d.ts +0 -1
  29. package/build/screens/index.d.ts.map +1 -1
  30. package/build/screens/index.js +0 -1
  31. package/build/screens/index.js.map +1 -1
  32. package/build/types/resources/conversation_membership.d.ts +0 -1
  33. package/build/types/resources/conversation_membership.d.ts.map +1 -1
  34. package/build/types/resources/conversation_membership.js.map +1 -1
  35. package/package.json +3 -3
  36. package/src/components/conversations/__tests__/conversation_actions.test.tsx +2 -76
  37. package/src/components/conversations/conversation_actions.tsx +4 -68
  38. package/src/components/group_conversation_list.tsx +1 -4
  39. package/src/contexts/conversations_context.tsx +1 -6
  40. package/src/hooks/use_conversation.ts +0 -1
  41. package/src/hooks/use_features.ts +0 -1
  42. package/src/navigation/index.tsx +0 -8
  43. package/src/screens/__tests__/conversation_details_screen.test.tsx +1 -49
  44. package/src/screens/conversation_details_screen.tsx +0 -19
  45. package/src/screens/conversations/__tests__/conversations_screen.test.tsx +0 -1
  46. package/src/screens/conversations/conversations_screen.tsx +0 -2
  47. package/src/screens/index.ts +0 -1
  48. package/src/types/resources/conversation_membership.ts +0 -1
  49. package/build/components/display/toast.d.ts +0 -3
  50. package/build/components/display/toast.d.ts.map +0 -1
  51. package/build/components/display/toast.js +0 -224
  52. package/build/components/display/toast.js.map +0 -1
  53. package/build/hooks/use_hide_conversation.d.ts +0 -107
  54. package/build/hooks/use_hide_conversation.d.ts.map +0 -1
  55. package/build/hooks/use_hide_conversation.js +0 -238
  56. package/build/hooks/use_hide_conversation.js.map +0 -1
  57. package/build/hooks/use_hide_conversations_enabled.d.ts +0 -2
  58. package/build/hooks/use_hide_conversations_enabled.d.ts.map +0 -1
  59. package/build/hooks/use_hide_conversations_enabled.js +0 -18
  60. package/build/hooks/use_hide_conversations_enabled.js.map +0 -1
  61. package/build/screens/conversation_actions_screen.d.ts +0 -7
  62. package/build/screens/conversation_actions_screen.d.ts.map +0 -1
  63. package/build/screens/conversation_actions_screen.js +0 -89
  64. package/build/screens/conversation_actions_screen.js.map +0 -1
  65. package/build/utils/toast_store.d.ts +0 -21
  66. package/build/utils/toast_store.d.ts.map +0 -1
  67. package/build/utils/toast_store.js +0 -27
  68. package/build/utils/toast_store.js.map +0 -1
  69. package/src/components/display/__tests__/toast.test.tsx +0 -55
  70. package/src/components/display/toast.tsx +0 -115
  71. package/src/hooks/__tests__/use_hide_conversation.test.tsx +0 -147
  72. package/src/hooks/use_hide_conversation.ts +0 -118
  73. package/src/hooks/use_hide_conversations_enabled.ts +0 -7
  74. package/src/screens/__tests__/conversation_actions_screen.test.tsx +0 -79
  75. package/src/screens/conversation_actions_screen.tsx +0 -53
  76. 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
- })
@@ -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
- }