@planningcenter/chat-react-native 3.14.0-rc.3 → 3.14.0-rc.5

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 (85) hide show
  1. package/build/components/conversation/empty_conversation_blank_state.d.ts.map +1 -1
  2. package/build/components/conversation/empty_conversation_blank_state.js +10 -2
  3. package/build/components/conversation/empty_conversation_blank_state.js.map +1 -1
  4. package/build/components/conversations/conversation_actions.js +3 -3
  5. package/build/components/conversations/conversation_actions.js.map +1 -1
  6. package/build/components/conversations/conversations.d.ts.map +1 -1
  7. package/build/components/conversations/conversations.js +7 -2
  8. package/build/components/conversations/conversations.js.map +1 -1
  9. package/build/components/conversations/{action_toggle_button.d.ts → swipeable_toggle_button.d.ts} +3 -3
  10. package/build/components/conversations/swipeable_toggle_button.d.ts.map +1 -0
  11. package/build/components/conversations/{action_toggle_button.js → swipeable_toggle_button.js} +7 -3
  12. package/build/components/conversations/swipeable_toggle_button.js.map +1 -0
  13. package/build/components/display/index.d.ts +0 -1
  14. package/build/components/display/index.d.ts.map +1 -1
  15. package/build/components/display/index.js +0 -1
  16. package/build/components/display/index.js.map +1 -1
  17. package/build/components/primitive/blank_state_primitive.d.ts +38 -0
  18. package/build/components/primitive/blank_state_primitive.d.ts.map +1 -0
  19. package/build/components/primitive/blank_state_primitive.js +88 -0
  20. package/build/components/primitive/blank_state_primitive.js.map +1 -0
  21. package/build/hooks/use_conversation.d.ts.map +1 -1
  22. package/build/hooks/use_conversation.js +2 -0
  23. package/build/hooks/use_conversation.js.map +1 -1
  24. package/build/hooks/use_message_create_or_update.d.ts.map +1 -1
  25. package/build/hooks/use_message_create_or_update.js +2 -1
  26. package/build/hooks/use_message_create_or_update.js.map +1 -1
  27. package/build/screens/attachment_actions/hooks/useDeleteAttachment.d.ts.map +1 -1
  28. package/build/screens/attachment_actions/hooks/useDeleteAttachment.js +2 -0
  29. package/build/screens/attachment_actions/hooks/useDeleteAttachment.js.map +1 -1
  30. package/build/screens/bug_report_screen.d.ts.map +1 -1
  31. package/build/screens/bug_report_screen.js +13 -7
  32. package/build/screens/bug_report_screen.js.map +1 -1
  33. package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts.map +1 -1
  34. package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js +8 -2
  35. package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js.map +1 -1
  36. package/build/screens/conversation_new/components/groups_form.d.ts.map +1 -1
  37. package/build/screens/conversation_new/components/groups_form.js +2 -0
  38. package/build/screens/conversation_new/components/groups_form.js.map +1 -1
  39. package/build/screens/conversation_new/components/services_form.d.ts.map +1 -1
  40. package/build/screens/conversation_new/components/services_form.js +3 -0
  41. package/build/screens/conversation_new/components/services_form.js.map +1 -1
  42. package/build/screens/conversation_screen.d.ts.map +1 -1
  43. package/build/screens/conversation_screen.js +8 -7
  44. package/build/screens/conversation_screen.js.map +1 -1
  45. package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.d.ts.map +1 -1
  46. package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.js +13 -3
  47. package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.js.map +1 -1
  48. package/build/screens/conversations/components/list_header_component.d.ts.map +1 -1
  49. package/build/screens/conversations/components/list_header_component.js +2 -0
  50. package/build/screens/conversations/components/list_header_component.js.map +1 -1
  51. package/build/screens/design_system_screen.js +13 -8
  52. package/build/screens/design_system_screen.js.map +1 -1
  53. package/build/screens/message_actions_screen.d.ts.map +1 -1
  54. package/build/screens/message_actions_screen.js +1 -0
  55. package/build/screens/message_actions_screen.js.map +1 -1
  56. package/build/screens/send_giphy_screen.d.ts.map +1 -1
  57. package/build/screens/send_giphy_screen.js +10 -5
  58. package/build/screens/send_giphy_screen.js.map +1 -1
  59. package/package.json +2 -2
  60. package/src/components/conversation/empty_conversation_blank_state.tsx +10 -6
  61. package/src/components/conversations/conversation_actions.tsx +3 -3
  62. package/src/components/conversations/conversations.tsx +7 -2
  63. package/src/components/conversations/{action_toggle_button.tsx → swipeable_toggle_button.tsx} +9 -5
  64. package/src/components/display/index.ts +0 -1
  65. package/src/components/primitive/blank_state_primitive.tsx +194 -0
  66. package/src/hooks/use_conversation.ts +2 -0
  67. package/src/hooks/use_message_create_or_update.ts +3 -0
  68. package/src/screens/attachment_actions/hooks/useDeleteAttachment.tsx +2 -0
  69. package/src/screens/bug_report_screen.tsx +17 -15
  70. package/src/screens/conversation_filter_recipients/conversation_filter_recipients_screen.tsx +11 -2
  71. package/src/screens/conversation_new/components/groups_form.tsx +2 -0
  72. package/src/screens/conversation_new/components/services_form.tsx +2 -0
  73. package/src/screens/conversation_screen.tsx +13 -11
  74. package/src/screens/conversation_select_recipients/conversation_select_recipients_screen.tsx +17 -6
  75. package/src/screens/conversations/components/list_header_component.tsx +2 -0
  76. package/src/screens/design_system_screen.tsx +17 -13
  77. package/src/screens/message_actions_screen.tsx +1 -0
  78. package/src/screens/send_giphy_screen.tsx +10 -11
  79. package/build/components/conversations/action_toggle_button.d.ts.map +0 -1
  80. package/build/components/conversations/action_toggle_button.js.map +0 -1
  81. package/build/components/display/blank_state.d.ts +0 -18
  82. package/build/components/display/blank_state.d.ts.map +0 -1
  83. package/build/components/display/blank_state.js +0 -47
  84. package/build/components/display/blank_state.js.map +0 -1
  85. package/src/components/display/blank_state.tsx +0 -76
@@ -1 +1 @@
1
- {"version":3,"file":"use_message_create_or_update.js","sourceRoot":"","sources":["../../src/hooks/use_message_create_or_update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACjE,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE/C,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EACL,uBAAuB,EACvB,+BAA+B,EAC/B,uBAAuB,GACxB,MAAM,U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AC,OAAyB;IACpD,OAAO,CAAC,OAAO,EAAE,EAAE,IAAI,oBAAoB,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;AACzD,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,YAAY;IACnB,OAAO,sCAAsC;SAC1C,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;SAChE,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAA;AAC1E,CAAC","sourcesContent":["import { InfiniteData, useMutation } from '@tanstack/react-query'\nimport { getMessagesQueryKey, getMessagesRequestArgs } from './use_conversation_messages'\nimport { useApiClient } from './use_api_client'\nimport { ApiCollection, ApiResource, MessageResource } from '../types'\nimport { chatQueryClient } from '../contexts/api_provider'\nimport {\n deleteRecordInPagesData,\n updateOrCreateRecordInPagesData,\n updateRecordInPagesData,\n} from '../utils'\nimport { DenormalizedAttachmentResourceForCreate } from '../types/resources/denormalized_attachment_resource_for_create'\nimport { useCurrentPerson } from './use_current_person'\nimport { optimisticallyUpdateMessage } from '../utils/cache/optimistically_update_message'\nimport { optimisticallyCreateMessage } from '../utils/cache/optimistically_create_message'\nimport { startMessageCreationTracking } from '../utils/performance_tracking'\n\ninterface Props {\n conversationId: number\n message?: MessageResource\n}\n\nexport function useMessageCreateOrUpdate({ conversationId, message }: Props) {\n const messageId = message?.id || null\n const isEditing = !isNewMessage(message)\n const apiClient = useApiClient()\n const currentPerson = useCurrentPerson()\n\n const mutation = useMutation({\n mutationFn: ({\n text,\n attachments,\n }: {\n text: string\n attachments?: DenormalizedAttachmentResourceForCreate[]\n }) => {\n const requestParams = getMessagesRequestArgs({ conversation_id: conversationId })\n const fieldsWithValueJoined = Object.fromEntries(\n Object.entries(requestParams.data.fields).map(([k, v]) => [k, v.join(',')])\n )\n let attributes: any = { text, ...(attachments ? { attachments } : {}) }\n if (!isEditing) {\n const idempotentKey = insecureUUID()\n attributes.idempotent_key = idempotentKey\n startMessageCreationTracking(idempotentKey)\n }\n const data = {\n ...requestParams.data,\n data: {\n type: 'Message',\n attributes,\n },\n fields: fieldsWithValueJoined,\n }\n\n if (isEditing) {\n return apiClient.chat.patch<ApiResource<MessageResource>>({\n url: `/me/conversations/${conversationId}/messages/${messageId}`,\n data,\n })\n } else {\n return apiClient.chat.post<ApiResource<MessageResource>>({\n url: `/me/conversations/${conversationId}/messages`,\n data,\n })\n }\n },\n onMutate: async ({\n text,\n attachments,\n }: {\n text: string\n attachments?: DenormalizedAttachmentResourceForCreate[]\n }) => {\n if (message && isEditing) {\n const optimisticMessage = optimisticallyUpdateMessage({\n conversationId,\n message,\n text,\n })\n\n return { message: optimisticMessage }\n }\n\n const optimisticMessage = optimisticallyCreateMessage({\n conversationId,\n message,\n text,\n attachments,\n currentPerson,\n })\n\n return { message: optimisticMessage }\n },\n onError: (error, variables, context) => {\n const { message: optimisticMessage } = context || {}\n // Add error to the optimistic message from the cache on error\n if (optimisticMessage) {\n const queryKey = getMessagesQueryKey({ conversation_id: conversationId })\n chatQueryClient.setQueryData(\n queryKey,\n (data: InfiniteData<ApiCollection<MessageResource>> | undefined) =>\n updateRecordInPagesData({\n data,\n record: optimisticMessage,\n processRecord: (_next, prev) => ({\n ...prev,\n error: error.message || 'Failed to send message',\n pending: false, // Mark as no longer pending\n }),\n })\n )\n }\n },\n onSuccess: (result: ApiResource<MessageResource>, variables, context) => {\n const { message: optimisticMessage } = context || {}\n const updatedMessage = result.data\n type QueryData = InfiniteData<ApiCollection<MessageResource>>\n const queryKey = getMessagesQueryKey({ conversation_id: conversationId })\n\n // First remove the optimistic message if it exists\n if (optimisticMessage) {\n chatQueryClient.setQueryData<QueryData>(queryKey, data =>\n deleteRecordInPagesData({\n data,\n record: optimisticMessage,\n })\n )\n }\n\n // Then add the real message\n chatQueryClient.setQueryData<QueryData>(queryKey, data =>\n updateOrCreateRecordInPagesData({\n data,\n record: updatedMessage,\n })\n )\n },\n })\n\n return mutation\n}\n\nexport function isTemporaryMessageId(messageId?: string | null): boolean {\n return !!messageId && messageId.endsWith('-temp')\n}\nexport function isNewMessage(message?: MessageResource): boolean {\n return !message?.id || isTemporaryMessageId(message.id)\n}\n\n/**\n * Generate a random UUID (v4) for idempotent keys.\n * Uses Math.random, which is not cryptographically secure.\n * An actual crypto library requires native dependencies.\n * This is OK for now since idempotent keys are not security-sensitive\n * or need to be guaranteed unique.\n * They are short lived and we use it in combination with the message's creator_id so\n * their impact is scoped only the current user.\n */\nfunction insecureUUID(): string {\n return 'xxxxxxxx-xxxx-4xxx-Nxxx-xxxxxxxxxxxx'\n .replace(/x/g, () => Math.floor(Math.random() * 16).toString(16))\n .replace(/N/g, () => (Math.floor(Math.random() * 4) + 8).toString(16))\n}\n"]}
1
+ {"version":3,"file":"use_message_create_or_update.js","sourceRoot":"","sources":["../../src/hooks/use_message_create_or_update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACjE,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE/C,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EACL,uBAAuB,EACvB,MAAM,EACN,+BAA+B,EAC/B,uBAAuB,GACxB,MAAM,UAAU,CAAA;AAEjB,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAA;AAC1F,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAA;AAC1F,OAAO,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IACnB,OAAO,sCAAsC;SAC1C,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;SAChE,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAA;AAC1E,CAAC","sourcesContent":["import { InfiniteData, useMutation } from '@tanstack/react-query'\nimport { getMessagesQueryKey, getMessagesRequestArgs } from './use_conversation_messages'\nimport { useApiClient } from './use_api_client'\nimport { ApiCollection, ApiResource, MessageResource } from '../types'\nimport { chatQueryClient } from '../contexts/api_provider'\nimport {\n deleteRecordInPagesData,\n Haptic,\n updateOrCreateRecordInPagesData,\n updateRecordInPagesData,\n} from '../utils'\nimport { DenormalizedAttachmentResourceForCreate } from '../types/resources/denormalized_attachment_resource_for_create'\nimport { useCurrentPerson } from './use_current_person'\nimport { optimisticallyUpdateMessage } from '../utils/cache/optimistically_update_message'\nimport { optimisticallyCreateMessage } from '../utils/cache/optimistically_create_message'\nimport { startMessageCreationTracking } from '../utils/performance_tracking'\n\ninterface Props {\n conversationId: number\n message?: MessageResource\n}\n\nexport function useMessageCreateOrUpdate({ conversationId, message }: Props) {\n const messageId = message?.id || null\n const isEditing = !isNewMessage(message)\n const apiClient = useApiClient()\n const currentPerson = useCurrentPerson()\n\n const mutation = useMutation({\n mutationFn: ({\n text,\n attachments,\n }: {\n text: string\n attachments?: DenormalizedAttachmentResourceForCreate[]\n }) => {\n const requestParams = getMessagesRequestArgs({ conversation_id: conversationId })\n const fieldsWithValueJoined = Object.fromEntries(\n Object.entries(requestParams.data.fields).map(([k, v]) => [k, v.join(',')])\n )\n let attributes: any = { text, ...(attachments ? { attachments } : {}) }\n if (!isEditing) {\n const idempotentKey = insecureUUID()\n attributes.idempotent_key = idempotentKey\n startMessageCreationTracking(idempotentKey)\n }\n const data = {\n ...requestParams.data,\n data: {\n type: 'Message',\n attributes,\n },\n fields: fieldsWithValueJoined,\n }\n\n if (isEditing) {\n return apiClient.chat.patch<ApiResource<MessageResource>>({\n url: `/me/conversations/${conversationId}/messages/${messageId}`,\n data,\n })\n } else {\n return apiClient.chat.post<ApiResource<MessageResource>>({\n url: `/me/conversations/${conversationId}/messages`,\n data,\n })\n }\n },\n onMutate: async ({\n text,\n attachments,\n }: {\n text: string\n attachments?: DenormalizedAttachmentResourceForCreate[]\n }) => {\n if (message && isEditing) {\n const optimisticMessage = optimisticallyUpdateMessage({\n conversationId,\n message,\n text,\n })\n\n return { message: optimisticMessage }\n }\n\n const optimisticMessage = optimisticallyCreateMessage({\n conversationId,\n message,\n text,\n attachments,\n currentPerson,\n })\n\n return { message: optimisticMessage }\n },\n onError: (error, variables, context) => {\n const { message: optimisticMessage } = context || {}\n Haptic.notificationError()\n\n // Add error to the optimistic message from the cache on error\n if (optimisticMessage) {\n const queryKey = getMessagesQueryKey({ conversation_id: conversationId })\n chatQueryClient.setQueryData(\n queryKey,\n (data: InfiniteData<ApiCollection<MessageResource>> | undefined) =>\n updateRecordInPagesData({\n data,\n record: optimisticMessage,\n processRecord: (_next, prev) => ({\n ...prev,\n error: error.message || 'Failed to send message',\n pending: false, // Mark as no longer pending\n }),\n })\n )\n }\n },\n onSuccess: (result: ApiResource<MessageResource>, variables, context) => {\n const { message: optimisticMessage } = context || {}\n const updatedMessage = result.data\n type QueryData = InfiniteData<ApiCollection<MessageResource>>\n const queryKey = getMessagesQueryKey({ conversation_id: conversationId })\n\n // First remove the optimistic message if it exists\n if (optimisticMessage) {\n chatQueryClient.setQueryData<QueryData>(queryKey, data =>\n deleteRecordInPagesData({\n data,\n record: optimisticMessage,\n })\n )\n }\n\n // Then add the real message\n chatQueryClient.setQueryData<QueryData>(queryKey, data =>\n updateOrCreateRecordInPagesData({\n data,\n record: updatedMessage,\n })\n )\n },\n })\n\n return mutation\n}\n\nexport function isTemporaryMessageId(messageId?: string | null): boolean {\n return !!messageId && messageId.endsWith('-temp')\n}\nexport function isNewMessage(message?: MessageResource): boolean {\n return !message?.id || isTemporaryMessageId(message.id)\n}\n\n/**\n * Generate a random UUID (v4) for idempotent keys.\n * Uses Math.random, which is not cryptographically secure.\n * An actual crypto library requires native dependencies.\n * This is OK for now since idempotent keys are not security-sensitive\n * or need to be guaranteed unique.\n * They are short lived and we use it in combination with the message's creator_id so\n * their impact is scoped only the current user.\n */\nfunction insecureUUID(): string {\n return 'xxxxxxxx-xxxx-4xxx-Nxxx-xxxxxxxxxxxx'\n .replace(/x/g, () => Math.floor(Math.random() * 16).toString(16))\n .replace(/N/g, () => (Math.floor(Math.random() * 4) + 8).toString(16))\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"useDeleteAttachment.d.ts","sourceRoot":"","sources":["../../../../src/screens/attachment_actions/hooks/useDeleteAttachment.tsx"],"names":[],"mappings":"AAOA,KAAK,wBAAwB,GAAG;IAC9B,eAAe,EAAE,MAAM,CAAA;IACvB,YAAY,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,cAAc,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,wBAAgB,mBAAmB,CAAC,EAClC,eAAe,EACf,YAAY,EACZ,cAAc,GACf,EAAE,wBAAwB;;EA4B1B"}
1
+ {"version":3,"file":"useDeleteAttachment.d.ts","sourceRoot":"","sources":["../../../../src/screens/attachment_actions/hooks/useDeleteAttachment.tsx"],"names":[],"mappings":"AAQA,KAAK,wBAAwB,GAAG;IAC9B,eAAe,EAAE,MAAM,CAAA;IACvB,YAAY,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,cAAc,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,wBAAgB,mBAAmB,CAAC,EAClC,eAAe,EACf,YAAY,EACZ,cAAc,GACf,EAAE,wBAAwB;;EA6B1B"}
@@ -4,6 +4,7 @@ import { useMutation } from '@tanstack/react-query';
4
4
  import { useApiClient } from '../../../hooks/use_api_client';
5
5
  import { useCallback } from 'react';
6
6
  import { useConversationMessages } from '../../../hooks/use_conversation_messages';
7
+ import { Haptic } from '../../../utils/native_adapters';
7
8
  export function useDeleteAttachment({ conversation_id, attachmentId, attachmentName, }) {
8
9
  const apiClient = useApiClient();
9
10
  const navigation = useNavigation();
@@ -16,6 +17,7 @@ export function useDeleteAttachment({ conversation_id, attachmentId, attachmentN
16
17
  mutationFn: deleteAttachment,
17
18
  onSuccess: () => {
18
19
  refetch();
20
+ Haptic.notificationSuccess();
19
21
  navigation.goBack();
20
22
  },
21
23
  onError: () => {
@@ -1 +1 @@
1
- {"version":3,"file":"useDeleteAttachment.js","sourceRoot":"","sources":["../../../../src/screens/attachment_actions/hooks/useDeleteAttachment.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AACnC,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAA;AAQlF,MAAM,UAAU,mBAAmB,CAAC,EAClC,eAAe,EACf,YAAY,EACZ,cAAc,GACW;IACzB,MAAM,SAAS,GAAG,YAAY,EAAE,CAAA;IAChC,MAAM,UAAU,GAAG,aAAa,EAAE,CAAA;IAClC,MAAM,EAAE,OAAO,EAAE,GAAG,uBAAuB,CAAC,EAAE,eAAe,EAAE,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,CAAA;IAE3F,MAAM,gBAAgB,GAAG,WAAW,CAAC,GAAG,EAAE;QACxC,MAAM,GAAG,GAAG,qBAAqB,eAAe,wBAAwB,YAAY,EAAE,CAAA;QAEtF,OAAO,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAA;IACvC,CAAC,EAAE,CAAC,SAAS,EAAE,eAAe,EAAE,YAAY,CAAC,CAAC,CAAA;IAE9C,MAAM,EAAE,MAAM,EAAE,sBAAsB,EAAE,GAAG,WAAW,CAAC;QACrD,UAAU,EAAE,gBAAgB;QAC5B,SAAS,EAAE,GAAG,EAAE;YACd,OAAO,EAAE,CAAA;YACT,UAAU,CAAC,MAAM,EAAE,CAAA;QACrB,CAAC;QACD,OAAO,EAAE,GAAG,EAAE;YACZ,KAAK,CAAC,KAAK,CACT,MAAM,EACN,iCAAiC,cAAc,gCAAgC,CAChF,CAAA;QACH,CAAC;KACF,CAAC,CAAA;IAEF,OAAO;QACL,sBAAsB;KACvB,CAAA;AACH,CAAC","sourcesContent":["import { Alert } from 'react-native'\nimport { useNavigation } from '@react-navigation/native'\nimport { useMutation } from '@tanstack/react-query'\nimport { useApiClient } from '../../../hooks/use_api_client'\nimport { useCallback } from 'react'\nimport { useConversationMessages } from '../../../hooks/use_conversation_messages'\n\ntype UseDeleteAttachmentProps = {\n conversation_id: number\n attachmentId: string | undefined\n attachmentName: string\n}\n\nexport function useDeleteAttachment({\n conversation_id,\n attachmentId,\n attachmentName,\n}: UseDeleteAttachmentProps) {\n const apiClient = useApiClient()\n const navigation = useNavigation()\n const { refetch } = useConversationMessages({ conversation_id }, { refetchOnMount: false })\n\n const deleteAttachment = useCallback(() => {\n const url = `/me/conversations/${conversation_id}/message_attachments/${attachmentId}`\n\n return apiClient.chat.delete({ url })\n }, [apiClient, conversation_id, attachmentId])\n\n const { mutate: handleDeleteAttachment } = useMutation({\n mutationFn: deleteAttachment,\n onSuccess: () => {\n refetch()\n navigation.goBack()\n },\n onError: () => {\n Alert.alert(\n 'Oops',\n `We were unable to delete this ${attachmentName} attachment. Please try again.`\n )\n },\n })\n\n return {\n handleDeleteAttachment,\n }\n}\n"]}
1
+ {"version":3,"file":"useDeleteAttachment.js","sourceRoot":"","sources":["../../../../src/screens/attachment_actions/hooks/useDeleteAttachment.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AACnC,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAA;AAClF,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAA;AAQvD,MAAM,UAAU,mBAAmB,CAAC,EAClC,eAAe,EACf,YAAY,EACZ,cAAc,GACW;IACzB,MAAM,SAAS,GAAG,YAAY,EAAE,CAAA;IAChC,MAAM,UAAU,GAAG,aAAa,EAAE,CAAA;IAClC,MAAM,EAAE,OAAO,EAAE,GAAG,uBAAuB,CAAC,EAAE,eAAe,EAAE,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,CAAA;IAE3F,MAAM,gBAAgB,GAAG,WAAW,CAAC,GAAG,EAAE;QACxC,MAAM,GAAG,GAAG,qBAAqB,eAAe,wBAAwB,YAAY,EAAE,CAAA;QAEtF,OAAO,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAA;IACvC,CAAC,EAAE,CAAC,SAAS,EAAE,eAAe,EAAE,YAAY,CAAC,CAAC,CAAA;IAE9C,MAAM,EAAE,MAAM,EAAE,sBAAsB,EAAE,GAAG,WAAW,CAAC;QACrD,UAAU,EAAE,gBAAgB;QAC5B,SAAS,EAAE,GAAG,EAAE;YACd,OAAO,EAAE,CAAA;YACT,MAAM,CAAC,mBAAmB,EAAE,CAAA;YAC5B,UAAU,CAAC,MAAM,EAAE,CAAA;QACrB,CAAC;QACD,OAAO,EAAE,GAAG,EAAE;YACZ,KAAK,CAAC,KAAK,CACT,MAAM,EACN,iCAAiC,cAAc,gCAAgC,CAChF,CAAA;QACH,CAAC;KACF,CAAC,CAAA;IAEF,OAAO;QACL,sBAAsB;KACvB,CAAA;AACH,CAAC","sourcesContent":["import { Alert } from 'react-native'\nimport { useNavigation } from '@react-navigation/native'\nimport { useMutation } from '@tanstack/react-query'\nimport { useApiClient } from '../../../hooks/use_api_client'\nimport { useCallback } from 'react'\nimport { useConversationMessages } from '../../../hooks/use_conversation_messages'\nimport { Haptic } from '../../../utils/native_adapters'\n\ntype UseDeleteAttachmentProps = {\n conversation_id: number\n attachmentId: string | undefined\n attachmentName: string\n}\n\nexport function useDeleteAttachment({\n conversation_id,\n attachmentId,\n attachmentName,\n}: UseDeleteAttachmentProps) {\n const apiClient = useApiClient()\n const navigation = useNavigation()\n const { refetch } = useConversationMessages({ conversation_id }, { refetchOnMount: false })\n\n const deleteAttachment = useCallback(() => {\n const url = `/me/conversations/${conversation_id}/message_attachments/${attachmentId}`\n\n return apiClient.chat.delete({ url })\n }, [apiClient, conversation_id, attachmentId])\n\n const { mutate: handleDeleteAttachment } = useMutation({\n mutationFn: deleteAttachment,\n onSuccess: () => {\n refetch()\n Haptic.notificationSuccess()\n navigation.goBack()\n },\n onError: () => {\n Alert.alert(\n 'Oops',\n `We were unable to delete this ${attachmentName} attachment. Please try again.`\n )\n },\n })\n\n return {\n handleDeleteAttachment,\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"bug_report_screen.d.ts","sourceRoot":"","sources":["../../src/screens/bug_report_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAA;AAErE,OAAO,KAAK,EACV,4BAA4B,EAC5B,sBAAsB,EACvB,MAAM,gCAAgC,CAAA;AAsCvC,eAAO,MAAM,sBAAsB,oBAEhC,sBAAsB,CAAC,GAAG,CAAC,KAAG,4BAI/B,CAAA;AAQF,wBAAgB,eAAe,sBAqU9B"}
1
+ {"version":3,"file":"bug_report_screen.d.ts","sourceRoot":"","sources":["../../src/screens/bug_report_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAA;AAErE,OAAO,KAAK,EACV,4BAA4B,EAC5B,sBAAsB,EACvB,MAAM,gCAAgC,CAAA;AAsCvC,eAAO,MAAM,sBAAsB,oBAEhC,sBAAsB,CAAC,GAAG,CAAC,KAAG,4BAI/B,CAAA;AAQF,wBAAgB,eAAe,sBAuU9B"}
@@ -1,7 +1,8 @@
1
1
  import React, { useCallback, useLayoutEffect, useState } from 'react';
2
2
  import { View, StyleSheet, TextInput, Linking, ScrollView, TouchableOpacity } from 'react-native';
3
3
  import { useNavigation } from '@react-navigation/native';
4
- import { Button, Spinner, Text, TextInlineButton, ImageAttachmentPreview, BlankState, Icon, KeyboardView, } from '../components';
4
+ import { Button, Spinner, Text, TextInlineButton, ImageAttachmentPreview, Icon, KeyboardView, } from '../components';
5
+ import BlankState from '../components/primitive/blank_state_primitive';
5
6
  import { useTheme } from '../hooks';
6
7
  import { useUploadClient } from '../hooks/use_upload_client';
7
8
  import { ImagePicker, platformFontWeightBold } from '../utils';
@@ -120,12 +121,17 @@ ${stepsToResolve}`;
120
121
  </View>);
121
122
  }
122
123
  if (status === 'success') {
123
- return (<BlankState iconName="general.checkCircle" iconStyle={styles.successIcon} title="Thank you!" titleStyle={styles.successTitle} subtitle="We appreciate you taking the time to help improve chat! We'll take a look at the issue you reported." subtitleStyle={styles.successSubtitle} buttonProps={{
124
- title: 'Return to chat',
125
- onPress: navigation.goBack,
126
- size: 'lg',
127
- variant: 'fill',
128
- }}/>);
124
+ return (<BlankState.Root>
125
+ <BlankState.Imagery name="general.checkCircle" style={styles.successIcon}/>
126
+ <BlankState.Content>
127
+ <BlankState.Heading style={styles.successTitle}>Thank you!</BlankState.Heading>
128
+ <BlankState.Text style={styles.successSubtitle}>
129
+ We appreciate you taking the time to help improve chat! We'll take a look at the issue
130
+ you reported.
131
+ </BlankState.Text>
132
+ </BlankState.Content>
133
+ <BlankState.Button title="Return to chat" onPress={navigation.goBack} size="lg" variant="fill"/>
134
+ </BlankState.Root>);
129
135
  }
130
136
  if (status === 'error') {
131
137
  return (<View style={styles.container}>
@@ -1 +1 @@
1
- {"version":3,"file":"bug_report_screen.js","sourceRoot":"","sources":["../../src/screens/bug_report_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACrE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAKjG,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EACL,MAAM,EACN,OAAO,EACP,IAAI,EACJ,gBAAgB,EAChB,sBAAsB,EACtB,UAAU,EACV,IAAI,EACJ,YAAY,GACb,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAE,WAAW,EAAqB,sBAAsB,EAAE,MAAM,UAAU,CAAA;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACnE,OAAO,EACL,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,qDAAqD,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACnC,OAAO,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAA;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAE7D,MAAM,sBAAsB,GAAG,IAAI,CAAA;AAEnC,MAAM,gBAAgB,GAAG;IACvB,sCAAsC;IACtC,qCAAqC;IACrC,8B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Content":["import React, { useCallback, useLayoutEffect, useState } from 'react'\nimport { View, StyleSheet, TextInput, Linking, ScrollView, TouchableOpacity } from 'react-native'\nimport type {\n NativeStackNavigationOptions,\n NativeStackScreenProps,\n} from '@react-navigation/native-stack'\nimport { useNavigation } from '@react-navigation/native'\nimport {\n Button,\n Spinner,\n Text,\n TextInlineButton,\n ImageAttachmentPreview,\n BlankState,\n Icon,\n KeyboardView,\n} from '../components'\nimport { useTheme } from '../hooks'\nimport { useUploadClient } from '../hooks/use_upload_client'\nimport { ImagePicker, ImagePickerResult, platformFontWeightBold } from '../utils'\nimport { useReportBugAction } from '../hooks/use_report_bug_action'\nimport {\n HeaderCancelButton,\n HeaderSubmitButton,\n} from '../components/display/platform_modal_header_buttons'\nimport { DefaultLoading } from '../components/page/loading'\nimport { startsWith } from 'lodash'\nimport { VideoAttachmentPreview } from '../components/display/video_attachment_preview'\nimport { SafeAreaModal } from '../components/safe_area_modal'\n\nconst MAX_DESCRIPTION_LENGTH = 2000\n\nconst BUG_TYPE_OPTIONS = [\n 'Issues sending or receiving messages',\n 'Trouble starting a new conversation',\n \"Notifications aren't working\",\n 'Incorrect read receipts or unread counts',\n 'Problems with file attachments',\n \"Something isn't displaying properly\",\n 'App is slow or crashes',\n 'Other',\n]\n\nexport const BugReportScreenOptions = ({\n navigation,\n}: NativeStackScreenProps<any>): NativeStackNavigationOptions => ({\n presentation: 'modal',\n title: 'Report a bug',\n headerLeft: () => <HeaderCancelButton title=\"Cancel\" onPress={() => navigation.goBack()} />,\n})\n\ninterface Attachment {\n id: string\n name: string\n type: string\n}\n\nexport function BugReportScreen() {\n const styles = useStyles()\n const navigation = useNavigation()\n const [bugType, setBugType] = useState('')\n const [showBugTypePicker, setShowBugTypePicker] = useState(false)\n const [whatWereDoing, setWhatWereDoing] = useState('')\n const [whatExpected, setWhatExpected] = useState('')\n const [stepsToResolve, setStepsToResolve] = useState('')\n const uploadApi = useUploadClient()\n const [uploading, setUploading] = useState(false)\n const [attachment, setAttachment] = useState<Attachment | null>(null)\n const [uploadError, setUploadError] = useState<string | null>(null)\n const mutation = useReportBugAction()\n const { mutate, status } = mutation\n const formValid =\n bugType.trim().length > 0 &&\n whatWereDoing.trim().length > 0 &&\n whatExpected.trim().length > 0 &&\n stepsToResolve.trim().length > 0 &&\n status === 'idle' &&\n !uploading\n const [imagePreviewURI, setImagePreviewURI] = useState<string>('')\n\n const isImageAttachment = startsWith(attachment?.type, 'image/')\n\n const handleSubmit = useCallback(() => {\n const description = `${whatWereDoing.substring(0, 100)}\n\n## What kind of bug did you experience?\n${bugType}\n\n## What were you trying to do when you encountered the bug?\n${whatWereDoing}\n\n## What did you expect to happen? What actually happened?\n${whatExpected}\n\n## What steps have you tried to resolve the issue?\n${stepsToResolve}`\n\n mutate({\n description,\n description_json: JSON.stringify({\n bugType,\n whatWereDoing,\n whatExpected,\n stepsToResolve,\n }),\n attachmentIds: attachment ? [attachment.id] : [],\n })\n }, [attachment, bugType, whatWereDoing, whatExpected, stepsToResolve, mutate])\n\n const handleRemoveAttachment = useCallback(() => {\n setAttachment(null)\n setImagePreviewURI('')\n }, [])\n\n function uploadImagePickerResult(result: ImagePickerResult) {\n if (result.canceled || result.assets.length === 0) {\n setUploading(false)\n return\n }\n\n const asset = result.assets[0]\n\n uploadApi\n ?.uploadFile({\n uri: asset.uri,\n name: asset.fileName as string,\n type: asset.mimeType as string,\n })\n .then(uploadedResource => {\n setUploading(false)\n setImagePreviewURI(asset.uri)\n setAttachment({\n id: uploadedResource.id,\n name: asset.fileName || 'File',\n type: asset.mimeType as string,\n })\n })\n .catch(() => {\n setUploading(false)\n setUploadError(`Failed to upload attachment`)\n })\n }\n\n function pickImage() {\n setUploading(true)\n return ImagePicker.openImageLibraryAsync().then(result => uploadImagePickerResult(result))\n }\n\n useLayoutEffect(() => {\n navigation.setOptions({\n // eslint-disable-next-line react/no-unstable-nested-components\n headerRight: () => (\n <HeaderSubmitButton title=\"Submit\" onPress={handleSubmit} disabled={!formValid} />\n ),\n })\n }, [formValid, handleSubmit, navigation])\n\n if (status === 'pending') {\n return (\n <View style={[styles.container, styles.fullHeight]}>\n <DefaultLoading />\n </View>\n )\n }\n\n if (status === 'success') {\n return (\n <BlankState\n iconName=\"general.checkCircle\"\n iconStyle={styles.successIcon}\n title=\"Thank you!\"\n titleStyle={styles.successTitle}\n subtitle=\"We appreciate you taking the time to help improve chat! We'll take a look at the issue you reported.\"\n subtitleStyle={styles.successSubtitle}\n buttonProps={{\n title: 'Return to chat',\n onPress: navigation.goBack,\n size: 'lg',\n variant: 'fill',\n }}\n />\n )\n }\n\n if (status === 'error') {\n return (\n <View style={styles.container}>\n <Text>\n This is embarrassing, we can't submit your bug report right now. If you still need help or\n would like to submit this bug report another way please{' '}\n <TextInlineButton\n accessibilityRole=\"link\"\n onPress={() =>\n Linking.openURL('https://support.planningcenteronline.com/hc/en-us/requests/new')\n }\n >\n contact our help center\n </TextInlineButton>\n .\n </Text>\n <Button title=\"Return to chat\" onPress={navigation.goBack} variant=\"fill\" size=\"lg\" />\n </View>\n )\n }\n\n return (\n <KeyboardView>\n <ScrollView contentContainerStyle={styles.container}>\n <Text style={styles.description}>\n Thanks for helping us improve chat. Please provide details about the issue you've\n encountered. We read every submission and your feedback helps us improve the experience.\n </Text>\n\n <View style={styles.textInputContainer}>\n <Text style={styles.fieldLabel}>\n What kind of bug did you experience? <Text style={styles.required}>*</Text>\n </Text>\n <TouchableOpacity style={styles.pickerButton} onPress={() => setShowBugTypePicker(true)}>\n <Text style={[styles.pickerText, !bugType && styles.pickerPlaceholder]}>\n {bugType || 'Select the bug type'}\n </Text>\n <Icon\n name=\"general.downChevron\"\n style={styles.pickerArrow}\n accessibilityElementsHidden\n />\n </TouchableOpacity>\n </View>\n\n <SafeAreaModal\n visible={showBugTypePicker}\n animationType=\"slide\"\n presentationStyle=\"pageSheet\"\n onRequestClose={() => setShowBugTypePicker(false)}\n >\n <View style={styles.modalContainer}>\n <View style={styles.modalHeader}>\n <HeaderCancelButton title=\"Cancel\" onPress={() => setShowBugTypePicker(false)} />\n <Text style={styles.modalTitle}>Select Bug Type</Text>\n <View style={styles.modalHeaderSpacer} />\n </View>\n <ScrollView style={styles.modalContent}>\n {BUG_TYPE_OPTIONS.map(option => (\n <TouchableOpacity\n key={option}\n style={styles.modalOption}\n onPress={() => {\n setBugType(option)\n setShowBugTypePicker(false)\n }}\n >\n <Text style={styles.modalOptionText}>{option}</Text>\n {bugType === option && (\n <Icon\n name=\"general.check\"\n style={styles.modalCheckmark}\n accessibilityElementsHidden\n />\n )}\n </TouchableOpacity>\n ))}\n </ScrollView>\n </View>\n </SafeAreaModal>\n\n <View style={styles.textInputContainer}>\n <Text style={styles.fieldLabel}>\n What were you trying to do when you encountered the bug?{' '}\n <Text style={styles.required}>*</Text>\n </Text>\n <TextInput\n style={styles.textInput}\n multiline\n placeholder=\"Description\"\n value={whatWereDoing}\n onChangeText={setWhatWereDoing}\n maxLength={MAX_DESCRIPTION_LENGTH}\n />\n {whatWereDoing.length >= MAX_DESCRIPTION_LENGTH - 100 && (\n <Text variant=\"footnote\">\n {whatWereDoing.length}/{MAX_DESCRIPTION_LENGTH}\n </Text>\n )}\n </View>\n\n <View style={styles.textInputContainer}>\n <Text style={styles.fieldLabel}>\n What did you expect to happen? What actually happened?{' '}\n <Text style={styles.required}>*</Text>\n </Text>\n <TextInput\n style={styles.textInput}\n multiline\n placeholder=\"Description\"\n value={whatExpected}\n onChangeText={setWhatExpected}\n maxLength={MAX_DESCRIPTION_LENGTH}\n />\n {whatExpected.length >= MAX_DESCRIPTION_LENGTH - 100 && (\n <Text variant=\"footnote\">\n {whatExpected.length}/{MAX_DESCRIPTION_LENGTH}\n </Text>\n )}\n </View>\n\n <View style={styles.textInputContainer}>\n <Text style={styles.fieldLabel}>\n What steps have you tried to resolve the issue? <Text style={styles.required}>*</Text>\n </Text>\n <TextInput\n style={styles.textInput}\n multiline\n placeholder=\"Description\"\n value={stepsToResolve}\n onChangeText={setStepsToResolve}\n maxLength={MAX_DESCRIPTION_LENGTH}\n />\n {stepsToResolve.length >= MAX_DESCRIPTION_LENGTH - 100 && (\n <Text variant=\"footnote\">\n {stepsToResolve.length}/{MAX_DESCRIPTION_LENGTH}\n </Text>\n )}\n </View>\n\n <View style={styles.attachmentSection}>\n <View style={styles.attachmentHeader}>\n <Text style={styles.attachmentLabel}>\n Attachment <Text style={styles.subLabel}>(optional)</Text>\n </Text>\n {uploading && <Spinner />}\n </View>\n {uploadError && <Text style={styles.attachmentErrorText}>{uploadError}</Text>}\n {attachment ? (\n <View style={styles.attachmentPreviewContainer}>\n {isImageAttachment ? (\n <ImageAttachmentPreview\n uri={imagePreviewURI}\n fileName={attachment.name}\n onRemovePress={handleRemoveAttachment}\n />\n ) : (\n <VideoAttachmentPreview\n name={attachment.name}\n onRemovePress={handleRemoveAttachment}\n />\n )}\n </View>\n ) : (\n <Button\n title=\"Attach a screenshot\"\n accessibilityHint=\"Opens your device's image gallery\"\n iconNameLeft=\"general.paperclip\"\n onPress={pickImage}\n size=\"sm\"\n variant=\"outline\"\n style={styles.attachButton}\n disabled={uploading || Boolean(attachment)}\n />\n )}\n </View>\n\n <View style={styles.footer}>\n <Text variant=\"footnote\">\n We can’t respond to every submission, but we may reach out if we have additional\n questions.\n </Text>\n\n <Text variant=\"footnote\">\n For details on how we process your data and ensure its security, please refer to our{' '}\n <TextInlineButton\n accessibilityRole=\"link\"\n variant=\"footnote\"\n onPress={() => Linking.openURL('https://www.planningcenter.com/privacy')}\n >\n Privacy Policy\n </TextInlineButton>\n .\n </Text>\n </View>\n </ScrollView>\n </KeyboardView>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n return StyleSheet.create({\n container: {\n padding: 16,\n paddingBottom: 16,\n gap: 24,\n },\n fullHeight: {\n flex: 1,\n },\n description: {\n color: colors.textColorDefaultSecondary,\n },\n textInputContainer: {\n gap: 8,\n },\n fieldLabel: {\n fontSize: 16,\n fontWeight: platformFontWeightBold,\n color: colors.textColorDefaultPrimary,\n },\n required: {\n color: colors.statusErrorText,\n },\n pickerButton: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n borderWidth: 1,\n borderColor: colors.borderColorDefaultBase,\n borderRadius: 8,\n paddingHorizontal: 16,\n paddingVertical: 12,\n backgroundColor: colors.surfaceColor100,\n minHeight: 48,\n },\n pickerText: {\n fontSize: 16,\n color: colors.textColorDefaultPrimary,\n flex: 1,\n },\n pickerPlaceholder: {\n color: colors.textColorDefaultSecondary,\n },\n pickerArrow: {\n fontSize: 12,\n color: colors.iconColorDefaultSecondary,\n marginLeft: 8,\n },\n modalContainer: {\n flex: 1,\n backgroundColor: colors.surfaceColor100,\n },\n modalHeader: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n padding: 16,\n borderBottomWidth: 1,\n borderBottomColor: colors.borderColorDefaultBase,\n },\n modalTitle: {\n fontSize: 18,\n fontWeight: platformFontWeightBold,\n color: colors.textColorDefaultPrimary,\n },\n modalHeaderSpacer: {\n width: 50, // Same width as cancel button to center title\n },\n modalContent: {\n flex: 1,\n },\n modalOption: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n paddingHorizontal: 16,\n paddingVertical: 16,\n borderBottomWidth: 1,\n borderBottomColor: colors.borderColorDefaultBase,\n },\n modalOptionText: {\n fontSize: 16,\n color: colors.textColorDefaultPrimary,\n flex: 1,\n },\n modalCheckmark: {\n fontSize: 16,\n color: colors.statusSuccessIcon,\n },\n textInput: {\n color: colors.textColorDefaultPrimary,\n fontSize: 16,\n textAlignVertical: 'top',\n minHeight: 120,\n maxHeight: 200,\n borderWidth: 1,\n borderColor: colors.borderColorDefaultBase,\n borderRadius: 8,\n paddingHorizontal: 16,\n paddingVertical: 12,\n backgroundColor: colors.surfaceColor100,\n },\n attachmentSection: {\n gap: 8,\n },\n attachmentHeader: {\n flexDirection: 'row',\n gap: 4,\n alignItems: 'center',\n },\n attachmentLabel: { fontWeight: platformFontWeightBold },\n subLabel: { fontWeight: 'normal', color: colors.textColorDefaultSecondary },\n attachmentPreviewContainer: {\n gap: 4,\n },\n attachmentErrorText: {\n color: colors.statusErrorText,\n },\n attachButton: {\n alignSelf: 'flex-start',\n },\n footer: { gap: 8 },\n successIcon: {\n color: colors.statusSuccessIcon,\n fontSize: 48,\n },\n successTitle: {\n fontSize: 24,\n marginBottom: 4,\n },\n successSubtitle: {\n fontSize: 16,\n marginBottom: 4,\n },\n })\n}\n"]}
1
+ {"version":3,"file":"bug_report_screen.js","sourceRoot":"","sources":["../../src/screens/bug_report_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACrE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAKjG,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EACL,MAAM,EACN,OAAO,EACP,IAAI,EACJ,gBAAgB,EAChB,sBAAsB,EACtB,IAAI,EACJ,YAAY,GACb,MAAM,eAAe,CAAA;AACtB,OAAO,UAAU,MAAM,+CAA+C,CAAA;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAE,WAAW,EAAqB,sBAAsB,EAAE,MAAM,UAAU,CAAA;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACnE,OAAO,EACL,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,qDAAqD,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACnC,OAAO,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAA;AACvF,OAAO,E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,KAAK,EAAE,MAAM,CAAC,eAAe;SAC9B;QACD,YAAY,EAAE;YACZ,SAAS,EAAE,YAAY;SACxB;QACD,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE;QAClB,WAAW,EAAE;YACX,KAAK,EAAE,MAAM,CAAC,iBAAiB;YAC/B,QAAQ,EAAE,EAAE;SACb;QACD,YAAY,EAAE;YACZ,QAAQ,EAAE,EAAE;YACZ,YAAY,EAAE,CAAC;SAChB;QACD,eAAe,EAAE;YACf,QAAQ,EAAE,EAAE;YACZ,YAAY,EAAE,CAAC;SAChB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React, { useCallback, useLayoutEffect, useState } from 'react'\nimport { View, StyleSheet, TextInput, Linking, ScrollView, TouchableOpacity } from 'react-native'\nimport type {\n NativeStackNavigationOptions,\n NativeStackScreenProps,\n} from '@react-navigation/native-stack'\nimport { useNavigation } from '@react-navigation/native'\nimport {\n Button,\n Spinner,\n Text,\n TextInlineButton,\n ImageAttachmentPreview,\n Icon,\n KeyboardView,\n} from '../components'\nimport BlankState from '../components/primitive/blank_state_primitive'\nimport { useTheme } from '../hooks'\nimport { useUploadClient } from '../hooks/use_upload_client'\nimport { ImagePicker, ImagePickerResult, platformFontWeightBold } from '../utils'\nimport { useReportBugAction } from '../hooks/use_report_bug_action'\nimport {\n HeaderCancelButton,\n HeaderSubmitButton,\n} from '../components/display/platform_modal_header_buttons'\nimport { DefaultLoading } from '../components/page/loading'\nimport { startsWith } from 'lodash'\nimport { VideoAttachmentPreview } from '../components/display/video_attachment_preview'\nimport { SafeAreaModal } from '../components/safe_area_modal'\n\nconst MAX_DESCRIPTION_LENGTH = 2000\n\nconst BUG_TYPE_OPTIONS = [\n 'Issues sending or receiving messages',\n 'Trouble starting a new conversation',\n \"Notifications aren't working\",\n 'Incorrect read receipts or unread counts',\n 'Problems with file attachments',\n \"Something isn't displaying properly\",\n 'App is slow or crashes',\n 'Other',\n]\n\nexport const BugReportScreenOptions = ({\n navigation,\n}: NativeStackScreenProps<any>): NativeStackNavigationOptions => ({\n presentation: 'modal',\n title: 'Report a bug',\n headerLeft: () => <HeaderCancelButton title=\"Cancel\" onPress={() => navigation.goBack()} />,\n})\n\ninterface Attachment {\n id: string\n name: string\n type: string\n}\n\nexport function BugReportScreen() {\n const styles = useStyles()\n const navigation = useNavigation()\n const [bugType, setBugType] = useState('')\n const [showBugTypePicker, setShowBugTypePicker] = useState(false)\n const [whatWereDoing, setWhatWereDoing] = useState('')\n const [whatExpected, setWhatExpected] = useState('')\n const [stepsToResolve, setStepsToResolve] = useState('')\n const uploadApi = useUploadClient()\n const [uploading, setUploading] = useState(false)\n const [attachment, setAttachment] = useState<Attachment | null>(null)\n const [uploadError, setUploadError] = useState<string | null>(null)\n const mutation = useReportBugAction()\n const { mutate, status } = mutation\n const formValid =\n bugType.trim().length > 0 &&\n whatWereDoing.trim().length > 0 &&\n whatExpected.trim().length > 0 &&\n stepsToResolve.trim().length > 0 &&\n status === 'idle' &&\n !uploading\n const [imagePreviewURI, setImagePreviewURI] = useState<string>('')\n\n const isImageAttachment = startsWith(attachment?.type, 'image/')\n\n const handleSubmit = useCallback(() => {\n const description = `${whatWereDoing.substring(0, 100)}\n\n## What kind of bug did you experience?\n${bugType}\n\n## What were you trying to do when you encountered the bug?\n${whatWereDoing}\n\n## What did you expect to happen? What actually happened?\n${whatExpected}\n\n## What steps have you tried to resolve the issue?\n${stepsToResolve}`\n\n mutate({\n description,\n description_json: JSON.stringify({\n bugType,\n whatWereDoing,\n whatExpected,\n stepsToResolve,\n }),\n attachmentIds: attachment ? [attachment.id] : [],\n })\n }, [attachment, bugType, whatWereDoing, whatExpected, stepsToResolve, mutate])\n\n const handleRemoveAttachment = useCallback(() => {\n setAttachment(null)\n setImagePreviewURI('')\n }, [])\n\n function uploadImagePickerResult(result: ImagePickerResult) {\n if (result.canceled || result.assets.length === 0) {\n setUploading(false)\n return\n }\n\n const asset = result.assets[0]\n\n uploadApi\n ?.uploadFile({\n uri: asset.uri,\n name: asset.fileName as string,\n type: asset.mimeType as string,\n })\n .then(uploadedResource => {\n setUploading(false)\n setImagePreviewURI(asset.uri)\n setAttachment({\n id: uploadedResource.id,\n name: asset.fileName || 'File',\n type: asset.mimeType as string,\n })\n })\n .catch(() => {\n setUploading(false)\n setUploadError(`Failed to upload attachment`)\n })\n }\n\n function pickImage() {\n setUploading(true)\n return ImagePicker.openImageLibraryAsync().then(result => uploadImagePickerResult(result))\n }\n\n useLayoutEffect(() => {\n navigation.setOptions({\n // eslint-disable-next-line react/no-unstable-nested-components\n headerRight: () => (\n <HeaderSubmitButton title=\"Submit\" onPress={handleSubmit} disabled={!formValid} />\n ),\n })\n }, [formValid, handleSubmit, navigation])\n\n if (status === 'pending') {\n return (\n <View style={[styles.container, styles.fullHeight]}>\n <DefaultLoading />\n </View>\n )\n }\n\n if (status === 'success') {\n return (\n <BlankState.Root>\n <BlankState.Imagery name=\"general.checkCircle\" style={styles.successIcon} />\n <BlankState.Content>\n <BlankState.Heading style={styles.successTitle}>Thank you!</BlankState.Heading>\n <BlankState.Text style={styles.successSubtitle}>\n We appreciate you taking the time to help improve chat! We'll take a look at the issue\n you reported.\n </BlankState.Text>\n </BlankState.Content>\n <BlankState.Button\n title=\"Return to chat\"\n onPress={navigation.goBack}\n size=\"lg\"\n variant=\"fill\"\n />\n </BlankState.Root>\n )\n }\n\n if (status === 'error') {\n return (\n <View style={styles.container}>\n <Text>\n This is embarrassing, we can't submit your bug report right now. If you still need help or\n would like to submit this bug report another way please{' '}\n <TextInlineButton\n accessibilityRole=\"link\"\n onPress={() =>\n Linking.openURL('https://support.planningcenteronline.com/hc/en-us/requests/new')\n }\n >\n contact our help center\n </TextInlineButton>\n .\n </Text>\n <Button title=\"Return to chat\" onPress={navigation.goBack} variant=\"fill\" size=\"lg\" />\n </View>\n )\n }\n\n return (\n <KeyboardView>\n <ScrollView contentContainerStyle={styles.container}>\n <Text style={styles.description}>\n Thanks for helping us improve chat. Please provide details about the issue you've\n encountered. We read every submission and your feedback helps us improve the experience.\n </Text>\n\n <View style={styles.textInputContainer}>\n <Text style={styles.fieldLabel}>\n What kind of bug did you experience? <Text style={styles.required}>*</Text>\n </Text>\n <TouchableOpacity style={styles.pickerButton} onPress={() => setShowBugTypePicker(true)}>\n <Text style={[styles.pickerText, !bugType && styles.pickerPlaceholder]}>\n {bugType || 'Select the bug type'}\n </Text>\n <Icon\n name=\"general.downChevron\"\n style={styles.pickerArrow}\n accessibilityElementsHidden\n />\n </TouchableOpacity>\n </View>\n\n <SafeAreaModal\n visible={showBugTypePicker}\n animationType=\"slide\"\n presentationStyle=\"pageSheet\"\n onRequestClose={() => setShowBugTypePicker(false)}\n >\n <View style={styles.modalContainer}>\n <View style={styles.modalHeader}>\n <HeaderCancelButton title=\"Cancel\" onPress={() => setShowBugTypePicker(false)} />\n <Text style={styles.modalTitle}>Select Bug Type</Text>\n <View style={styles.modalHeaderSpacer} />\n </View>\n <ScrollView style={styles.modalContent}>\n {BUG_TYPE_OPTIONS.map(option => (\n <TouchableOpacity\n key={option}\n style={styles.modalOption}\n onPress={() => {\n setBugType(option)\n setShowBugTypePicker(false)\n }}\n >\n <Text style={styles.modalOptionText}>{option}</Text>\n {bugType === option && (\n <Icon\n name=\"general.check\"\n style={styles.modalCheckmark}\n accessibilityElementsHidden\n />\n )}\n </TouchableOpacity>\n ))}\n </ScrollView>\n </View>\n </SafeAreaModal>\n\n <View style={styles.textInputContainer}>\n <Text style={styles.fieldLabel}>\n What were you trying to do when you encountered the bug?{' '}\n <Text style={styles.required}>*</Text>\n </Text>\n <TextInput\n style={styles.textInput}\n multiline\n placeholder=\"Description\"\n value={whatWereDoing}\n onChangeText={setWhatWereDoing}\n maxLength={MAX_DESCRIPTION_LENGTH}\n />\n {whatWereDoing.length >= MAX_DESCRIPTION_LENGTH - 100 && (\n <Text variant=\"footnote\">\n {whatWereDoing.length}/{MAX_DESCRIPTION_LENGTH}\n </Text>\n )}\n </View>\n\n <View style={styles.textInputContainer}>\n <Text style={styles.fieldLabel}>\n What did you expect to happen? What actually happened?{' '}\n <Text style={styles.required}>*</Text>\n </Text>\n <TextInput\n style={styles.textInput}\n multiline\n placeholder=\"Description\"\n value={whatExpected}\n onChangeText={setWhatExpected}\n maxLength={MAX_DESCRIPTION_LENGTH}\n />\n {whatExpected.length >= MAX_DESCRIPTION_LENGTH - 100 && (\n <Text variant=\"footnote\">\n {whatExpected.length}/{MAX_DESCRIPTION_LENGTH}\n </Text>\n )}\n </View>\n\n <View style={styles.textInputContainer}>\n <Text style={styles.fieldLabel}>\n What steps have you tried to resolve the issue? <Text style={styles.required}>*</Text>\n </Text>\n <TextInput\n style={styles.textInput}\n multiline\n placeholder=\"Description\"\n value={stepsToResolve}\n onChangeText={setStepsToResolve}\n maxLength={MAX_DESCRIPTION_LENGTH}\n />\n {stepsToResolve.length >= MAX_DESCRIPTION_LENGTH - 100 && (\n <Text variant=\"footnote\">\n {stepsToResolve.length}/{MAX_DESCRIPTION_LENGTH}\n </Text>\n )}\n </View>\n\n <View style={styles.attachmentSection}>\n <View style={styles.attachmentHeader}>\n <Text style={styles.attachmentLabel}>\n Attachment <Text style={styles.subLabel}>(optional)</Text>\n </Text>\n {uploading && <Spinner />}\n </View>\n {uploadError && <Text style={styles.attachmentErrorText}>{uploadError}</Text>}\n {attachment ? (\n <View style={styles.attachmentPreviewContainer}>\n {isImageAttachment ? (\n <ImageAttachmentPreview\n uri={imagePreviewURI}\n fileName={attachment.name}\n onRemovePress={handleRemoveAttachment}\n />\n ) : (\n <VideoAttachmentPreview\n name={attachment.name}\n onRemovePress={handleRemoveAttachment}\n />\n )}\n </View>\n ) : (\n <Button\n title=\"Attach a screenshot\"\n accessibilityHint=\"Opens your device's image gallery\"\n iconNameLeft=\"general.paperclip\"\n onPress={pickImage}\n size=\"sm\"\n variant=\"outline\"\n style={styles.attachButton}\n disabled={uploading || Boolean(attachment)}\n />\n )}\n </View>\n\n <View style={styles.footer}>\n <Text variant=\"footnote\">\n We can’t respond to every submission, but we may reach out if we have additional\n questions.\n </Text>\n\n <Text variant=\"footnote\">\n For details on how we process your data and ensure its security, please refer to our{' '}\n <TextInlineButton\n accessibilityRole=\"link\"\n variant=\"footnote\"\n onPress={() => Linking.openURL('https://www.planningcenter.com/privacy')}\n >\n Privacy Policy\n </TextInlineButton>\n .\n </Text>\n </View>\n </ScrollView>\n </KeyboardView>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n return StyleSheet.create({\n container: {\n padding: 16,\n paddingBottom: 16,\n gap: 24,\n },\n fullHeight: {\n flex: 1,\n },\n description: {\n color: colors.textColorDefaultSecondary,\n },\n textInputContainer: {\n gap: 8,\n },\n fieldLabel: {\n fontSize: 16,\n fontWeight: platformFontWeightBold,\n color: colors.textColorDefaultPrimary,\n },\n required: {\n color: colors.statusErrorText,\n },\n pickerButton: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n borderWidth: 1,\n borderColor: colors.borderColorDefaultBase,\n borderRadius: 8,\n paddingHorizontal: 16,\n paddingVertical: 12,\n backgroundColor: colors.surfaceColor100,\n minHeight: 48,\n },\n pickerText: {\n fontSize: 16,\n color: colors.textColorDefaultPrimary,\n flex: 1,\n },\n pickerPlaceholder: {\n color: colors.textColorDefaultSecondary,\n },\n pickerArrow: {\n fontSize: 12,\n color: colors.iconColorDefaultSecondary,\n marginLeft: 8,\n },\n modalContainer: {\n flex: 1,\n backgroundColor: colors.surfaceColor100,\n },\n modalHeader: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n padding: 16,\n borderBottomWidth: 1,\n borderBottomColor: colors.borderColorDefaultBase,\n },\n modalTitle: {\n fontSize: 18,\n fontWeight: platformFontWeightBold,\n color: colors.textColorDefaultPrimary,\n },\n modalHeaderSpacer: {\n width: 50, // Same width as cancel button to center title\n },\n modalContent: {\n flex: 1,\n },\n modalOption: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n paddingHorizontal: 16,\n paddingVertical: 16,\n borderBottomWidth: 1,\n borderBottomColor: colors.borderColorDefaultBase,\n },\n modalOptionText: {\n fontSize: 16,\n color: colors.textColorDefaultPrimary,\n flex: 1,\n },\n modalCheckmark: {\n fontSize: 16,\n color: colors.statusSuccessIcon,\n },\n textInput: {\n color: colors.textColorDefaultPrimary,\n fontSize: 16,\n textAlignVertical: 'top',\n minHeight: 120,\n maxHeight: 200,\n borderWidth: 1,\n borderColor: colors.borderColorDefaultBase,\n borderRadius: 8,\n paddingHorizontal: 16,\n paddingVertical: 12,\n backgroundColor: colors.surfaceColor100,\n },\n attachmentSection: {\n gap: 8,\n },\n attachmentHeader: {\n flexDirection: 'row',\n gap: 4,\n alignItems: 'center',\n },\n attachmentLabel: { fontWeight: platformFontWeightBold },\n subLabel: { fontWeight: 'normal', color: colors.textColorDefaultSecondary },\n attachmentPreviewContainer: {\n gap: 4,\n },\n attachmentErrorText: {\n color: colors.statusErrorText,\n },\n attachButton: {\n alignSelf: 'flex-start',\n },\n footer: { gap: 8 },\n successIcon: {\n color: colors.statusSuccessIcon,\n fontSize: 48,\n },\n successTitle: {\n fontSize: 24,\n marginBottom: 4,\n },\n successSubtitle: {\n fontSize: 16,\n marginBottom: 4,\n },\n })\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"conversation_filter_recipients_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation_filter_recipients/conversation_filter_recipients_screen.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAyC,MAAM,OAAO,CAAA;AAY7D,OAAO,EAAE,uCAAuC,EAAiC,MAAM,SAAS,CAAA;AAMhG,eAAO,MAAM,0CAA0C,uEAMrD,CAAA;AAEF,eAAO,MAAM,kCAAkC,eAE5C,uCAAuC,sBAwHzC,CAAA"}
1
+ {"version":3,"file":"conversation_filter_recipients_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation_filter_recipients/conversation_filter_recipients_screen.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAyC,MAAM,OAAO,CAAA;AAa7D,OAAO,EAAE,uCAAuC,EAAiC,MAAM,SAAS,CAAA;AAMhG,eAAO,MAAM,0CAA0C,uEAMrD,CAAA;AAEF,eAAO,MAAM,kCAAkC,eAE5C,uCAAuC,sBAwHzC,CAAA"}
@@ -3,7 +3,8 @@ import React, { useCallback, useMemo, useState } from 'react';
3
3
  import { Platform, StyleSheet, View } from 'react-native';
4
4
  import { FlatList, TextInput } from 'react-native-gesture-handler';
5
5
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
6
- import { BlankState, Heading, ToggleButton } from '../../components';
6
+ import { Heading, ToggleButton } from '../../components';
7
+ import BlankState from '../../components/primitive/blank_state_primitive';
7
8
  import FormSheet, { getFormSheetScreenOptions } from '../../components/primitive/form_sheet';
8
9
  import { useTheme } from '../../hooks';
9
10
  import { tokens } from '../../vendor/tapestry/tokens';
@@ -79,7 +80,7 @@ export const ConversationFilterRecipientsScreen = ({ route, }) => {
79
80
  Service Types
80
81
  </Heading>} contentContainerStyle={[styles.listContentContainer, listContainerStyle]} keyExtractor={item => item.type === SectionTypes.header
81
82
  ? `service-type-${item.data.serviceTypeId}`
82
- : `team-${item.data.teamId}-${item.data.serviceTypeId}`} ListEmptyComponent={isFetched ? <BlankState title="No teams found"/> : <DefaultLoading />} renderItem={({ item }) => {
83
+ : `team-${item.data.teamId}-${item.data.serviceTypeId}`} ListEmptyComponent={isFetched ? <ListBlankState /> : <DefaultLoading />} renderItem={({ item }) => {
83
84
  switch (item.type) {
84
85
  case SectionTypes.header:
85
86
  return (<HeaderRow data={item.data} style={item.sectionStyle} nativeID={`${SERVICE_TYPE_LABELLED_BY_PREFIX}${item.data.serviceTypeId}`} setTeamFilters={setTeamFilters}/>);
@@ -91,6 +92,11 @@ export const ConversationFilterRecipientsScreen = ({ route, }) => {
91
92
  }}/>
92
93
  </FormSheet.Root>);
93
94
  };
95
+ const ListBlankState = () => {
96
+ return (<BlankState.Root>
97
+ <BlankState.Heading>No teams found</BlankState.Heading>
98
+ </BlankState.Root>);
99
+ };
94
100
  const TeamFilters = ({ onLayout }) => {
95
101
  const styles = useStyles();
96
102
  const { colors } = useTheme();
@@ -1 +1 @@
1
- {"version":3,"file":"conversation_filter_recipients_screen.js","sourceRoot":"","sources":["../../../src/screens/conversation_filter_recipients/conversation_filter_recipients_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAE3F,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC7D,OAAO,EAAqB,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC5E,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACpE,OAAO,SAAS,EAAE,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAA;AAC5F,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,wCAAwC,EAAE,MAAM,yDAAyD,CAAA;AAClH,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAA;AAC/E,OAAO,EAA2C,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAChG,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAE9D,MAAM,+BAA+B,GAAG,SAAS,CAAA;AACjD,MAAM,eAAe,GAAG,EAAE,CAAA;AAE1B,MAAM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pB,GAAG,EAAE,EAAE;YACP,iBAAiB,EAAE,EAAE;YACrB,aAAa,EAAE,EAAE;YACjB,eAAe,EAAE,MAAM,CAAC,2BAA2B;YACnD,iBAAiB,EAAE,CAAC;YACpB,iBAAiB,EAAE,MAAM,CAAC,sBAAsB;SACjD;QACD,qBAAqB,EAAE;YACrB,aAAa,EAAE,KAAK;YACpB,GAAG,EAAE,CAAC;SACP;QACD,WAAW,EAAE;YACX,eAAe,EAAE,EAAE;YACnB,iBAAiB,EAAE,EAAE;YACrB,KAAK,EAAE,MAAM,CAAC,uBAAuB;YACrC,iBAAiB,EAAE,QAAQ;YAC3B,cAAc,EAAE,QAAQ;YACxB,QAAQ,EAAE,EAAE;YACZ,WAAW,EAAE,CAAC;YACd,WAAW,EAAE,MAAM,CAAC,sBAAsB;YAC1C,YAAY,EAAE,EAAE;YAChB,eAAe,EAAE,MAAM,CAAC,2BAA2B;SACpD;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { RouteProp, StackActions, useNavigation, useRoute } from '@react-navigation/native'\nimport { NativeStackNavigationProp } from '@react-navigation/native-stack'\nimport React, { useCallback, useMemo, useState } from 'react'\nimport { LayoutChangeEvent, Platform, StyleSheet, View } from 'react-native'\nimport { FlatList, TextInput } from 'react-native-gesture-handler'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { BlankState, Heading, ToggleButton } from '../../components'\nimport FormSheet, { getFormSheetScreenOptions } from '../../components/primitive/form_sheet'\nimport { useTheme } from '../../hooks'\nimport { tokens } from '../../vendor/tapestry/tokens'\nimport { CheckboxRow } from './components/checkbox_row'\nimport { HeaderRow } from './components/header_row'\nimport { useFlattenedArrayOfServiceTypesWithTeams } from './hooks/use_flattened_array_of_service_types_with_teams'\nimport { useServiceTypesWithTeams } from './hooks/use_service_types_with_teams'\nimport { ConversationFilterRecipientsScreenProps, SectionTypes, TeamFilterTypes } from './types'\nimport { DefaultLoading } from '../../components/page/loading'\n\nconst SERVICE_TYPE_LABELLED_BY_PREFIX = 'header-'\nconst SPACE_UNDER_ROW = 16\n\nexport const ConversationFilterReceipientsScreenOptions = getFormSheetScreenOptions({\n sheetAllowedDetents: Platform.select({\n android: [0.75, 0.94],\n default: [0.75, 1],\n }),\n headerTitle: 'Teams I lead',\n})\n\nexport const ConversationFilterRecipientsScreen = ({\n route,\n}: ConversationFilterRecipientsScreenProps) => {\n const styles = useStyles()\n\n // Set the height of the container to accommodate the team filters\n const [formSheetHeaderHeight, setFormSheetHeaderHeight] = useState(200)\n const { bottom } = useSafeAreaInsets()\n const listContainerStyle = useMemo(\n () =>\n Platform.select({\n ios: { paddingBottom: formSheetHeaderHeight + bottom + SPACE_UNDER_ROW },\n }),\n [formSheetHeaderHeight, bottom]\n )\n\n const navigation =\n useNavigation<NativeStackNavigationProp<ConversationFilterRecipientsScreenProps>>()\n const { team_ids: teamIds } = route.params\n const { params } = route\n const teamIdCount = Number(teamIds?.length)\n const headerTitle = useMemo(() => {\n return teamIdCount >= 1 ? `Selected teams (${teamIdCount})` : 'Select teams'\n }, [teamIdCount])\n\n const { serviceTypes, isFetched } = useServiceTypesWithTeams({\n filterType: params.team_filter_type,\n searchQuery: params.search_query,\n })\n const data = useFlattenedArrayOfServiceTypesWithTeams({\n data: serviceTypes,\n firstRowStyle: styles.firstRow,\n lastRowStyle: styles.lastRow,\n })\n\n const noTeamsSelected = params.team_ids?.length === 0 || !params.team_ids\n const applyButtonAccessibilityHint = noTeamsSelected\n ? 'Select at least one team to navigate to the final step in creating your conversation.'\n : 'Saves selected teams and navigates to the final step to create your conversation.'\n\n const setTeamFilters = useCallback(\n ({ team_ids }: { team_ids: number[] }) => {\n navigation.setParams({ team_ids })\n },\n [navigation]\n )\n\n const resetTeamFilters = useCallback(() => {\n navigation.goBack()\n }, [navigation])\n\n const applyTeamFilters = useCallback(() => {\n navigation.dispatch(StackActions.popTo('ConversationNew', params))\n }, [navigation, params])\n\n const handleFormSheetHeaderLayout = useCallback((event: LayoutChangeEvent) => {\n setFormSheetHeaderHeight(event.nativeEvent.layout.height)\n }, [])\n\n return (\n <FormSheet.Root style={styles.root}>\n <View onLayout={handleFormSheetHeaderLayout}>\n <FormSheet.Header style={styles.header}>\n <FormSheet.HeaderTitle>{headerTitle}</FormSheet.HeaderTitle>\n <FormSheet.HeaderActions>\n <FormSheet.HeaderTextButton\n onPress={resetTeamFilters}\n accessibilityHint=\"Cancels any selected teams and closes this modal.\"\n >\n Cancel\n </FormSheet.HeaderTextButton>\n <FormSheet.HeaderButton\n title=\"Apply\"\n accessibilityHint={applyButtonAccessibilityHint}\n onPress={applyTeamFilters}\n disabled={noTeamsSelected}\n />\n </FormSheet.HeaderActions>\n </FormSheet.Header>\n <TeamFilters />\n </View>\n <FlatList\n data={data}\n ListHeaderComponent={\n <Heading variant=\"h3\" style={styles.listHeader}>\n Service Types\n </Heading>\n }\n contentContainerStyle={[styles.listContentContainer, listContainerStyle]}\n keyExtractor={item =>\n item.type === SectionTypes.header\n ? `service-type-${item.data.serviceTypeId}`\n : `team-${item.data.teamId}-${item.data.serviceTypeId}`\n }\n ListEmptyComponent={isFetched ? <BlankState title=\"No teams found\" /> : <DefaultLoading />}\n renderItem={({ item }) => {\n switch (item.type) {\n case SectionTypes.header:\n return (\n <HeaderRow\n data={item.data}\n style={item.sectionStyle}\n nativeID={`${SERVICE_TYPE_LABELLED_BY_PREFIX}${item.data.serviceTypeId}`}\n setTeamFilters={setTeamFilters}\n />\n )\n case SectionTypes.team:\n return (\n <CheckboxRow\n data={item.data}\n style={item.sectionStyle}\n accessibilityLabelledBy={`${SERVICE_TYPE_LABELLED_BY_PREFIX}${item.data.serviceTypeId}`}\n setTeamFilters={setTeamFilters}\n />\n )\n default:\n return null\n }\n }}\n />\n </FormSheet.Root>\n )\n}\n\nconst TeamFilters = ({ onLayout }: { onLayout?: (event: LayoutChangeEvent) => void }) => {\n const styles = useStyles()\n const { colors } = useTheme()\n const navigation =\n useNavigation<NativeStackNavigationProp<ConversationFilterRecipientsScreenProps>>()\n const route = useRoute<RouteProp<ConversationFilterRecipientsScreenProps['route']>>()\n const { params } = route\n\n const active = params.team_filter_type || TeamFilterTypes.TeamsIlead\n\n const handleFilterChange = useCallback(\n (filter: TeamFilterTypes) => {\n navigation.setParams({\n team_filter_type: filter,\n team_ids: [],\n })\n },\n [navigation]\n )\n\n return (\n <View style={styles.teamFiltersContainer} onLayout={onLayout}>\n <TextInput\n defaultValue={params.search_query}\n placeholder=\"Search teams\"\n placeholderTextColor={colors.textColorDefaultPlaceholder}\n style={styles.searchInput}\n onChangeText={text => {\n navigation.setParams({\n search_query: text,\n })\n }}\n />\n <View style={styles.filterToggleContainer}>\n <ToggleButton\n active={active === TeamFilterTypes.TeamsIlead}\n title={TeamFilterTypes.TeamsIlead}\n accessibilityLabel=\"Show all teams I lead\"\n onPress={() => handleFilterChange(TeamFilterTypes.TeamsIlead)}\n />\n <ToggleButton\n active={active === TeamFilterTypes.MyTeams}\n title={TeamFilterTypes.MyTeams}\n accessibilityLabel=\"Show all my teams\"\n onPress={() => handleFilterChange(TeamFilterTypes.MyTeams)}\n />\n <ToggleButton\n active={active === TeamFilterTypes.All}\n title={TeamFilterTypes.All}\n accessibilityLabel=\"Show all teams\"\n onPress={() => handleFilterChange(TeamFilterTypes.All)}\n />\n </View>\n </View>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n const { bottom } = useSafeAreaInsets()\n\n return StyleSheet.create({\n root: {\n backgroundColor: colors.surfaceColor080,\n },\n header: {\n borderBottomWidth: 0,\n },\n listContentContainer: {\n padding: 16,\n paddingBottom: bottom + Platform.select({ android: 24, default: 16 }),\n },\n listHeader: {\n paddingBottom: 16,\n },\n firstRow: {\n borderTopStartRadius: tokens.borderRadiusLg,\n borderTopEndRadius: tokens.borderRadiusLg,\n },\n lastRow: {\n borderBottomStartRadius: tokens.borderRadiusLg,\n borderBottomEndRadius: tokens.borderRadiusLg,\n marginBottom: SPACE_UNDER_ROW,\n },\n teamFiltersContainer: {\n gap: 12,\n paddingHorizontal: 16,\n paddingBottom: 28,\n backgroundColor: colors.fillColorNeutral100Inverted,\n borderBottomWidth: 1,\n borderBottomColor: colors.borderColorDefaultBase,\n },\n filterToggleContainer: {\n flexDirection: 'row',\n gap: 8,\n },\n searchInput: {\n paddingVertical: 16,\n paddingHorizontal: 16,\n color: colors.textColorDefaultPrimary,\n textAlignVertical: 'center',\n justifyContent: 'center',\n fontSize: 16,\n borderWidth: 1,\n borderColor: colors.borderColorDefaultBase,\n borderRadius: 24,\n backgroundColor: colors.fillColorNeutral100Inverted,\n },\n })\n}\n"]}
1
+ {"version":3,"file":"conversation_filter_recipients_screen.js","sourceRoot":"","sources":["../../../src/screens/conversation_filter_recipients/conversation_filter_recipients_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAE3F,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC7D,OAAO,EAAqB,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC5E,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,UAAU,MAAM,kDAAkD,CAAA;AACzE,OAAO,SAAS,EAAE,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAA;AAC5F,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,wCAAwC,EA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iB,EAAE,CAAC;SACrB;QACD,oBAAoB,EAAE;YACpB,OAAO,EAAE,EAAE;YACX,aAAa,EAAE,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;SACtE;QACD,UAAU,EAAE;YACV,aAAa,EAAE,EAAE;SAClB;QACD,QAAQ,EAAE;YACR,oBAAoB,EAAE,MAAM,CAAC,cAAc;YAC3C,kBAAkB,EAAE,MAAM,CAAC,cAAc;SAC1C;QACD,OAAO,EAAE;YACP,uBAAuB,EAAE,MAAM,CAAC,cAAc;YAC9C,qBAAqB,EAAE,MAAM,CAAC,cAAc;YAC5C,YAAY,EAAE,eAAe;SAC9B;QACD,oBAAoB,EAAE;YACpB,GAAG,EAAE,EAAE;YACP,iBAAiB,EAAE,EAAE;YACrB,aAAa,EAAE,EAAE;YACjB,eAAe,EAAE,MAAM,CAAC,2BAA2B;YACnD,iBAAiB,EAAE,CAAC;YACpB,iBAAiB,EAAE,MAAM,CAAC,sBAAsB;SACjD;QACD,qBAAqB,EAAE;YACrB,aAAa,EAAE,KAAK;YACpB,GAAG,EAAE,CAAC;SACP;QACD,WAAW,EAAE;YACX,eAAe,EAAE,EAAE;YACnB,iBAAiB,EAAE,EAAE;YACrB,KAAK,EAAE,MAAM,CAAC,uBAAuB;YACrC,iBAAiB,EAAE,QAAQ;YAC3B,cAAc,EAAE,QAAQ;YACxB,QAAQ,EAAE,EAAE;YACZ,WAAW,EAAE,CAAC;YACd,WAAW,EAAE,MAAM,CAAC,sBAAsB;YAC1C,YAAY,EAAE,EAAE;YAChB,eAAe,EAAE,MAAM,CAAC,2BAA2B;SACpD;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { RouteProp, StackActions, useNavigation, useRoute } from '@react-navigation/native'\nimport { NativeStackNavigationProp } from '@react-navigation/native-stack'\nimport React, { useCallback, useMemo, useState } from 'react'\nimport { LayoutChangeEvent, Platform, StyleSheet, View } from 'react-native'\nimport { FlatList, TextInput } from 'react-native-gesture-handler'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { Heading, ToggleButton } from '../../components'\nimport BlankState from '../../components/primitive/blank_state_primitive'\nimport FormSheet, { getFormSheetScreenOptions } from '../../components/primitive/form_sheet'\nimport { useTheme } from '../../hooks'\nimport { tokens } from '../../vendor/tapestry/tokens'\nimport { CheckboxRow } from './components/checkbox_row'\nimport { HeaderRow } from './components/header_row'\nimport { useFlattenedArrayOfServiceTypesWithTeams } from './hooks/use_flattened_array_of_service_types_with_teams'\nimport { useServiceTypesWithTeams } from './hooks/use_service_types_with_teams'\nimport { ConversationFilterRecipientsScreenProps, SectionTypes, TeamFilterTypes } from './types'\nimport { DefaultLoading } from '../../components/page/loading'\n\nconst SERVICE_TYPE_LABELLED_BY_PREFIX = 'header-'\nconst SPACE_UNDER_ROW = 16\n\nexport const ConversationFilterReceipientsScreenOptions = getFormSheetScreenOptions({\n sheetAllowedDetents: Platform.select({\n android: [0.75, 0.94],\n default: [0.75, 1],\n }),\n headerTitle: 'Teams I lead',\n})\n\nexport const ConversationFilterRecipientsScreen = ({\n route,\n}: ConversationFilterRecipientsScreenProps) => {\n const styles = useStyles()\n\n // Set the height of the container to accommodate the team filters\n const [formSheetHeaderHeight, setFormSheetHeaderHeight] = useState(200)\n const { bottom } = useSafeAreaInsets()\n const listContainerStyle = useMemo(\n () =>\n Platform.select({\n ios: { paddingBottom: formSheetHeaderHeight + bottom + SPACE_UNDER_ROW },\n }),\n [formSheetHeaderHeight, bottom]\n )\n\n const navigation =\n useNavigation<NativeStackNavigationProp<ConversationFilterRecipientsScreenProps>>()\n const { team_ids: teamIds } = route.params\n const { params } = route\n const teamIdCount = Number(teamIds?.length)\n const headerTitle = useMemo(() => {\n return teamIdCount >= 1 ? `Selected teams (${teamIdCount})` : 'Select teams'\n }, [teamIdCount])\n\n const { serviceTypes, isFetched } = useServiceTypesWithTeams({\n filterType: params.team_filter_type,\n searchQuery: params.search_query,\n })\n const data = useFlattenedArrayOfServiceTypesWithTeams({\n data: serviceTypes,\n firstRowStyle: styles.firstRow,\n lastRowStyle: styles.lastRow,\n })\n\n const noTeamsSelected = params.team_ids?.length === 0 || !params.team_ids\n const applyButtonAccessibilityHint = noTeamsSelected\n ? 'Select at least one team to navigate to the final step in creating your conversation.'\n : 'Saves selected teams and navigates to the final step to create your conversation.'\n\n const setTeamFilters = useCallback(\n ({ team_ids }: { team_ids: number[] }) => {\n navigation.setParams({ team_ids })\n },\n [navigation]\n )\n\n const resetTeamFilters = useCallback(() => {\n navigation.goBack()\n }, [navigation])\n\n const applyTeamFilters = useCallback(() => {\n navigation.dispatch(StackActions.popTo('ConversationNew', params))\n }, [navigation, params])\n\n const handleFormSheetHeaderLayout = useCallback((event: LayoutChangeEvent) => {\n setFormSheetHeaderHeight(event.nativeEvent.layout.height)\n }, [])\n\n return (\n <FormSheet.Root style={styles.root}>\n <View onLayout={handleFormSheetHeaderLayout}>\n <FormSheet.Header style={styles.header}>\n <FormSheet.HeaderTitle>{headerTitle}</FormSheet.HeaderTitle>\n <FormSheet.HeaderActions>\n <FormSheet.HeaderTextButton\n onPress={resetTeamFilters}\n accessibilityHint=\"Cancels any selected teams and closes this modal.\"\n >\n Cancel\n </FormSheet.HeaderTextButton>\n <FormSheet.HeaderButton\n title=\"Apply\"\n accessibilityHint={applyButtonAccessibilityHint}\n onPress={applyTeamFilters}\n disabled={noTeamsSelected}\n />\n </FormSheet.HeaderActions>\n </FormSheet.Header>\n <TeamFilters />\n </View>\n <FlatList\n data={data}\n ListHeaderComponent={\n <Heading variant=\"h3\" style={styles.listHeader}>\n Service Types\n </Heading>\n }\n contentContainerStyle={[styles.listContentContainer, listContainerStyle]}\n keyExtractor={item =>\n item.type === SectionTypes.header\n ? `service-type-${item.data.serviceTypeId}`\n : `team-${item.data.teamId}-${item.data.serviceTypeId}`\n }\n ListEmptyComponent={isFetched ? <ListBlankState /> : <DefaultLoading />}\n renderItem={({ item }) => {\n switch (item.type) {\n case SectionTypes.header:\n return (\n <HeaderRow\n data={item.data}\n style={item.sectionStyle}\n nativeID={`${SERVICE_TYPE_LABELLED_BY_PREFIX}${item.data.serviceTypeId}`}\n setTeamFilters={setTeamFilters}\n />\n )\n case SectionTypes.team:\n return (\n <CheckboxRow\n data={item.data}\n style={item.sectionStyle}\n accessibilityLabelledBy={`${SERVICE_TYPE_LABELLED_BY_PREFIX}${item.data.serviceTypeId}`}\n setTeamFilters={setTeamFilters}\n />\n )\n default:\n return null\n }\n }}\n />\n </FormSheet.Root>\n )\n}\n\nconst ListBlankState = () => {\n return (\n <BlankState.Root>\n <BlankState.Heading>No teams found</BlankState.Heading>\n </BlankState.Root>\n )\n}\n\nconst TeamFilters = ({ onLayout }: { onLayout?: (event: LayoutChangeEvent) => void }) => {\n const styles = useStyles()\n const { colors } = useTheme()\n const navigation =\n useNavigation<NativeStackNavigationProp<ConversationFilterRecipientsScreenProps>>()\n const route = useRoute<RouteProp<ConversationFilterRecipientsScreenProps['route']>>()\n const { params } = route\n\n const active = params.team_filter_type || TeamFilterTypes.TeamsIlead\n\n const handleFilterChange = useCallback(\n (filter: TeamFilterTypes) => {\n navigation.setParams({\n team_filter_type: filter,\n team_ids: [],\n })\n },\n [navigation]\n )\n\n return (\n <View style={styles.teamFiltersContainer} onLayout={onLayout}>\n <TextInput\n defaultValue={params.search_query}\n placeholder=\"Search teams\"\n placeholderTextColor={colors.textColorDefaultPlaceholder}\n style={styles.searchInput}\n onChangeText={text => {\n navigation.setParams({\n search_query: text,\n })\n }}\n />\n <View style={styles.filterToggleContainer}>\n <ToggleButton\n active={active === TeamFilterTypes.TeamsIlead}\n title={TeamFilterTypes.TeamsIlead}\n accessibilityLabel=\"Show all teams I lead\"\n onPress={() => handleFilterChange(TeamFilterTypes.TeamsIlead)}\n />\n <ToggleButton\n active={active === TeamFilterTypes.MyTeams}\n title={TeamFilterTypes.MyTeams}\n accessibilityLabel=\"Show all my teams\"\n onPress={() => handleFilterChange(TeamFilterTypes.MyTeams)}\n />\n <ToggleButton\n active={active === TeamFilterTypes.All}\n title={TeamFilterTypes.All}\n accessibilityLabel=\"Show all teams\"\n onPress={() => handleFilterChange(TeamFilterTypes.All)}\n />\n </View>\n </View>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n const { bottom } = useSafeAreaInsets()\n\n return StyleSheet.create({\n root: {\n backgroundColor: colors.surfaceColor080,\n },\n header: {\n borderBottomWidth: 0,\n },\n listContentContainer: {\n padding: 16,\n paddingBottom: bottom + Platform.select({ android: 24, default: 16 }),\n },\n listHeader: {\n paddingBottom: 16,\n },\n firstRow: {\n borderTopStartRadius: tokens.borderRadiusLg,\n borderTopEndRadius: tokens.borderRadiusLg,\n },\n lastRow: {\n borderBottomStartRadius: tokens.borderRadiusLg,\n borderBottomEndRadius: tokens.borderRadiusLg,\n marginBottom: SPACE_UNDER_ROW,\n },\n teamFiltersContainer: {\n gap: 12,\n paddingHorizontal: 16,\n paddingBottom: 28,\n backgroundColor: colors.fillColorNeutral100Inverted,\n borderBottomWidth: 1,\n borderBottomColor: colors.borderColorDefaultBase,\n },\n filterToggleContainer: {\n flexDirection: 'row',\n gap: 8,\n },\n searchInput: {\n paddingVertical: 16,\n paddingHorizontal: 16,\n color: colors.textColorDefaultPrimary,\n textAlignVertical: 'center',\n justifyContent: 'center',\n fontSize: 16,\n borderWidth: 1,\n borderColor: colors.borderColorDefaultBase,\n borderRadius: 24,\n backgroundColor: colors.fillColorNeutral100Inverted,\n },\n })\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"groups_form.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversation_new/components/groups_form.tsx"],"names":[],"mappings":"AACA,OAAO,KAAiD,MAAM,OAAO,CAAA;AAYrE,OAAO,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAA;AAIjE,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,MAAM,CAAA;IACf,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAC9B,CAAA;AAED,eAAO,MAAM,UAAU,qCAAsC,eAAe,sBAyD3E,CAAA"}
1
+ {"version":3,"file":"groups_form.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversation_new/components/groups_form.tsx"],"names":[],"mappings":"AACA,OAAO,KAAiD,MAAM,OAAO,CAAA;AAYrE,OAAO,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAA;AAKjE,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,MAAM,CAAA;IACf,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAC9B,CAAA;AAED,eAAO,MAAM,UAAU,qCAAsC,eAAe,sBA0D3E,CAAA"}
@@ -9,6 +9,7 @@ import { useGroupMembersForNewConversation, } from '../../../hooks/groups/use_gr
9
9
  import { useGroupsConversationCreate } from '../../../hooks/groups/use_groups_conversation_create';
10
10
  import { pluralize } from '../../../utils';
11
11
  import { Divider, FormList } from './form_list';
12
+ import { Haptic } from '../../../utils/native_adapters';
12
13
  export const GroupsForm = ({ groupId, chat_group_graph_id }) => {
13
14
  const navigation = useNavigation();
14
15
  const [title, setTitle] = useState();
@@ -28,6 +29,7 @@ export const GroupsForm = ({ groupId, chat_group_graph_id }) => {
28
29
  conversation_id: conversationId,
29
30
  chat_group_graph_id,
30
31
  }));
32
+ Haptic.notificationSuccess();
31
33
  }, [chat_group_graph_id, navigation]);
32
34
  const { mutate: handleSave, isPending } = useGroupsConversationCreate({
33
35
  groupId,
@@ -1 +1 @@
1
- {"version":3,"file":"groups_form.js","sourceRoot":"","sources":["../../../../src/screens/conversation_new/components/groups_form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACtE,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACrE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,I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AAE,CAAC;SACR;QACD,YAAY,EAAE;YACZ,OAAO,EAAE,cAAc;YACvB,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC;gBAC7B,GAAG,EAAE,cAAc;gBACnB,OAAO,EAAE,cAAc,GAAG,YAAY;aACvC,CAAC;YACF,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC;gBACnB,GAAG,EAAE,CAAC;gBACN,OAAO,EAAE,CAAC;aACX,CAAC;SACH;QACD,UAAU,EAAE;YACV,QAAQ,EAAE,EAAE;YACZ,KAAK,EAAE,MAAM,CAAC,uBAAuB;SACtC;QACD,aAAa,EAAE;YACb,OAAO,EAAE,cAAc;YACvB,aAAa,EAAE,CAAC;SACjB;QACD,MAAM,EAAE;YACN,SAAS,EAAE,EAAE;SACd;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { StackActions, useNavigation } from '@react-navigation/native'\nimport React, { useCallback, useMemo, useRef, useState } from 'react'\nimport { Platform, Pressable, StyleSheet, TextInput, View } from 'react-native'\nimport { Banner, ChildNotice, Heading, Text } from '../../../components'\nimport { ActionButton } from '../../../components/display/action_button'\nimport { KeyboardView } from '../../../components/display/keyboard_view'\nimport { useCurrentPerson, useSuspenseGet, useTheme } from '../../../hooks'\nimport {\n GroupMembersForNewConversationResult,\n useGroupMembersForNewConversation,\n} from '../../../hooks/groups/use_group_members_for_new_conversation'\nimport { useGroupsConversationCreate } from '../../../hooks/groups/use_groups_conversation_create'\nimport { GroupsGroupResource } from '../../../types'\nimport { GraphId } from '../../../types/resources/group_resource'\nimport { pluralize } from '../../../utils'\nimport { Divider, FormList } from './form_list'\n\ntype GroupsFormProps = {\n groupId: number\n chat_group_graph_id?: GraphId\n}\n\nexport const GroupsForm = ({ groupId, chat_group_graph_id }: GroupsFormProps) => {\n const navigation = useNavigation()\n const [title, setTitle] = useState<string>()\n const { data: group } = useSuspenseGet<GroupsGroupResource>({\n url: `/me/groups/${groupId}`,\n data: {\n fields: {\n Group: [],\n },\n },\n app: 'groups',\n })\n\n const groupMemberships = useGroupMembersForNewConversation({ id: groupId })\n\n const redirectToConversation = useCallback(\n (conversationId: number) => {\n // navigate to the conversation screen\n navigation.dispatch(\n StackActions.popTo('Conversation', {\n conversation_id: conversationId,\n chat_group_graph_id,\n })\n )\n },\n [chat_group_graph_id, navigation]\n )\n\n const { mutate: handleSave, isPending } = useGroupsConversationCreate({\n groupId,\n title,\n onSuccess: redirectToConversation,\n })\n\n return (\n <KeyboardView>\n <FormList\n memberData={groupMemberships.adultMembers}\n loadingMore={groupMemberships.isFetchingNextPage}\n onEndReached={groupMemberships.fetchNextPage}\n FormContent={\n <FormContent\n group={group}\n title={title}\n setTitle={setTitle}\n groupMemberships={groupMemberships}\n />\n }\n />\n <ActionButton\n disabled={!title || isPending}\n title=\"Start Conversation\"\n onPress={() => handleSave()}\n infoText=\"Conversation will be automatically updated if any members are added or removed from this group.\"\n />\n </KeyboardView>\n )\n}\n\ninterface FormContentProps {\n group: GroupsGroupResource\n title?: string\n setTitle: (title: string) => void\n groupMemberships: GroupMembersForNewConversationResult\n}\n\nfunction FormContent({ group, title, setTitle, groupMemberships }: FormContentProps) {\n const styles = useStyles()\n const inputRef = useRef<TextInput>(null)\n const currentPerson = useCurrentPerson()\n const { name, membershipsCount } = group\n\n const myGroupsMembership = useMemo(\n () => groupMemberships.data.find(m => m.id === currentPerson.id),\n [groupMemberships.data, currentPerson.id]\n )\n const isLeader = myGroupsMembership?.role === 'leader'\n\n const childMembers = groupMemberships.childMembers\n const hasChildren = childMembers.length > 0\n const memberHeaderLabel = `${pluralize(membershipsCount, 'member')} selected`\n\n const showMemberError = groupMemberships.isError\n\n const handleTitleSectionPress = useCallback(() => {\n inputRef.current?.focus()\n }, [])\n\n return (\n <View style={styles.formContent}>\n <View style={styles.toSection}>\n <Heading variant=\"h3\">To:</Heading>\n <Text style={styles.groupName}>{name}</Text>\n </View>\n <Divider />\n <Pressable style={styles.titleSection} onPress={handleTitleSectionPress}>\n <Heading variant=\"h3\">Title</Heading>\n <TextInput\n placeholder=\"Topic of conversation (required)\"\n value={title}\n onChangeText={setTitle}\n style={styles.titleInput}\n autoFocus={true}\n ref={inputRef}\n />\n </Pressable>\n <Divider />\n <View style={styles.memberSection}>\n <Heading variant=\"h3\">{memberHeaderLabel}</Heading>\n {hasChildren && (\n <ChildNotice childMembers={childMembers} showMembers={isLeader} style={styles.banner} />\n )}\n {showMemberError && (\n <Banner\n appearance=\"error\"\n description=\"There was an issue loading group members, please refresh and try again.\"\n style={styles.banner}\n />\n )}\n </View>\n </View>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n const sectionPadding = 16\n const inputPadding = 8\n\n return StyleSheet.create({\n formContent: {\n paddingBottom: sectionPadding,\n flex: 1,\n },\n toSection: {\n padding: sectionPadding,\n flexDirection: 'row',\n gap: 8,\n },\n groupName: {\n fontSize: 18,\n flex: 1,\n },\n titleSection: {\n padding: sectionPadding,\n paddingBottom: Platform.select({\n ios: sectionPadding,\n android: sectionPadding - inputPadding,\n }),\n gap: Platform.select({\n ios: 8,\n android: 0,\n }),\n },\n titleInput: {\n fontSize: 18,\n color: colors.textColorDefaultPrimary,\n },\n memberSection: {\n padding: sectionPadding,\n paddingBottom: 0,\n },\n banner: {\n marginTop: 16,\n },\n })\n}\n"]}
1
+ {"version":3,"file":"groups_form.js","sourceRoot":"","sources":["../../../../src/screens/conversation_new/components/groups_form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACtE,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACrE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/E,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,C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YAAY,EAAE;YACZ,OAAO,EAAE,cAAc;YACvB,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC;gBAC7B,GAAG,EAAE,cAAc;gBACnB,OAAO,EAAE,cAAc,GAAG,YAAY;aACvC,CAAC;YACF,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC;gBACnB,GAAG,EAAE,CAAC;gBACN,OAAO,EAAE,CAAC;aACX,CAAC;SACH;QACD,UAAU,EAAE;YACV,QAAQ,EAAE,EAAE;YACZ,KAAK,EAAE,MAAM,CAAC,uBAAuB;SACtC;QACD,aAAa,EAAE;YACb,OAAO,EAAE,cAAc;YACvB,aAAa,EAAE,CAAC;SACjB;QACD,MAAM,EAAE;YACN,SAAS,EAAE,EAAE;SACd;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { StackActions, useNavigation } from '@react-navigation/native'\nimport React, { useCallback, useMemo, useRef, useState } from 'react'\nimport { Platform, Pressable, StyleSheet, TextInput, View } from 'react-native'\nimport { Banner, ChildNotice, Heading, Text } from '../../../components'\nimport { ActionButton } from '../../../components/display/action_button'\nimport { KeyboardView } from '../../../components/display/keyboard_view'\nimport { useCurrentPerson, useSuspenseGet, useTheme } from '../../../hooks'\nimport {\n GroupMembersForNewConversationResult,\n useGroupMembersForNewConversation,\n} from '../../../hooks/groups/use_group_members_for_new_conversation'\nimport { useGroupsConversationCreate } from '../../../hooks/groups/use_groups_conversation_create'\nimport { GroupsGroupResource } from '../../../types'\nimport { GraphId } from '../../../types/resources/group_resource'\nimport { pluralize } from '../../../utils'\nimport { Divider, FormList } from './form_list'\nimport { Haptic } from '../../../utils/native_adapters'\n\ntype GroupsFormProps = {\n groupId: number\n chat_group_graph_id?: GraphId\n}\n\nexport const GroupsForm = ({ groupId, chat_group_graph_id }: GroupsFormProps) => {\n const navigation = useNavigation()\n const [title, setTitle] = useState<string>()\n const { data: group } = useSuspenseGet<GroupsGroupResource>({\n url: `/me/groups/${groupId}`,\n data: {\n fields: {\n Group: [],\n },\n },\n app: 'groups',\n })\n\n const groupMemberships = useGroupMembersForNewConversation({ id: groupId })\n\n const redirectToConversation = useCallback(\n (conversationId: number) => {\n // navigate to the conversation screen\n navigation.dispatch(\n StackActions.popTo('Conversation', {\n conversation_id: conversationId,\n chat_group_graph_id,\n })\n )\n Haptic.notificationSuccess()\n },\n [chat_group_graph_id, navigation]\n )\n\n const { mutate: handleSave, isPending } = useGroupsConversationCreate({\n groupId,\n title,\n onSuccess: redirectToConversation,\n })\n\n return (\n <KeyboardView>\n <FormList\n memberData={groupMemberships.adultMembers}\n loadingMore={groupMemberships.isFetchingNextPage}\n onEndReached={groupMemberships.fetchNextPage}\n FormContent={\n <FormContent\n group={group}\n title={title}\n setTitle={setTitle}\n groupMemberships={groupMemberships}\n />\n }\n />\n <ActionButton\n disabled={!title || isPending}\n title=\"Start Conversation\"\n onPress={() => handleSave()}\n infoText=\"Conversation will be automatically updated if any members are added or removed from this group.\"\n />\n </KeyboardView>\n )\n}\n\ninterface FormContentProps {\n group: GroupsGroupResource\n title?: string\n setTitle: (title: string) => void\n groupMemberships: GroupMembersForNewConversationResult\n}\n\nfunction FormContent({ group, title, setTitle, groupMemberships }: FormContentProps) {\n const styles = useStyles()\n const inputRef = useRef<TextInput>(null)\n const currentPerson = useCurrentPerson()\n const { name, membershipsCount } = group\n\n const myGroupsMembership = useMemo(\n () => groupMemberships.data.find(m => m.id === currentPerson.id),\n [groupMemberships.data, currentPerson.id]\n )\n const isLeader = myGroupsMembership?.role === 'leader'\n\n const childMembers = groupMemberships.childMembers\n const hasChildren = childMembers.length > 0\n const memberHeaderLabel = `${pluralize(membershipsCount, 'member')} selected`\n\n const showMemberError = groupMemberships.isError\n\n const handleTitleSectionPress = useCallback(() => {\n inputRef.current?.focus()\n }, [])\n\n return (\n <View style={styles.formContent}>\n <View style={styles.toSection}>\n <Heading variant=\"h3\">To:</Heading>\n <Text style={styles.groupName}>{name}</Text>\n </View>\n <Divider />\n <Pressable style={styles.titleSection} onPress={handleTitleSectionPress}>\n <Heading variant=\"h3\">Title</Heading>\n <TextInput\n placeholder=\"Topic of conversation (required)\"\n value={title}\n onChangeText={setTitle}\n style={styles.titleInput}\n autoFocus={true}\n ref={inputRef}\n />\n </Pressable>\n <Divider />\n <View style={styles.memberSection}>\n <Heading variant=\"h3\">{memberHeaderLabel}</Heading>\n {hasChildren && (\n <ChildNotice childMembers={childMembers} showMembers={isLeader} style={styles.banner} />\n )}\n {showMemberError && (\n <Banner\n appearance=\"error\"\n description=\"There was an issue loading group members, please refresh and try again.\"\n style={styles.banner}\n />\n )}\n </View>\n </View>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n const sectionPadding = 16\n const inputPadding = 8\n\n return StyleSheet.create({\n formContent: {\n paddingBottom: sectionPadding,\n flex: 1,\n },\n toSection: {\n padding: sectionPadding,\n flexDirection: 'row',\n gap: 8,\n },\n groupName: {\n fontSize: 18,\n flex: 1,\n },\n titleSection: {\n padding: sectionPadding,\n paddingBottom: Platform.select({\n ios: sectionPadding,\n android: sectionPadding - inputPadding,\n }),\n gap: Platform.select({\n ios: 8,\n android: 0,\n }),\n },\n titleInput: {\n fontSize: 18,\n color: colors.textColorDefaultPrimary,\n },\n memberSection: {\n padding: sectionPadding,\n paddingBottom: 0,\n },\n banner: {\n marginTop: 16,\n },\n })\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"services_form.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversation_new/components/services_form.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoD,MAAM,OAAO,CAAA;AAYxE,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAA;AAI5E,KAAK,iBAAiB,GAAG;IACvB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,cAAc,CAAC,EAAE,eAAe,CAAA;CACjC,CAAA;AAED,eAAO,MAAM,YAAY,uDAItB,iBAAiB,sBA2EnB,CAAA"}
1
+ {"version":3,"file":"services_form.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversation_new/components/services_form.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoD,MAAM,OAAO,CAAA;AAYxE,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAA;AAI5E,KAAK,iBAAiB,GAAG;IACvB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,cAAc,CAAC,EAAE,eAAe,CAAA;CACjC,CAAA;AAED,eAAO,MAAM,YAAY,uDAItB,iBAAiB,sBA6EnB,CAAA"}
@@ -42,6 +42,9 @@ export const ServicesForm = ({ initialTeamIds, initialPlanId, teamFilterType, })
42
42
  navigation.dispatch(StackActions.push('Conversation', {
43
43
  conversation_id: conversation.id,
44
44
  }));
45
+ // Only trigger success haptic if creating a new conversation
46
+ if (!selectionHasConversation)
47
+ Haptic.notificationSuccess();
45
48
  },
46
49
  });
47
50
  return (<View style={styles.formContainer}>