@planningcenter/chat-react-native 3.2.0-rc.8 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/conversation/message_form/message_form_attachment_image.d.ts +13 -0
- package/build/components/conversation/message_form/message_form_attachment_image.d.ts.map +1 -0
- package/build/components/conversation/message_form/message_form_attachment_image.js +78 -0
- package/build/components/conversation/message_form/message_form_attachment_image.js.map +1 -0
- package/build/components/conversation/message_form.d.ts.map +1 -1
- package/build/components/conversation/message_form.js +128 -16
- package/build/components/conversation/message_form.js.map +1 -1
- package/build/components/conversations/conversation_actions.d.ts +2 -2
- package/build/components/conversations/conversation_actions.d.ts.map +1 -1
- package/build/components/conversations/conversation_actions.js.map +1 -1
- package/build/components/conversations/conversation_preview.d.ts +3 -1
- package/build/components/conversations/conversation_preview.d.ts.map +1 -1
- package/build/components/conversations/conversation_preview.js +2 -2
- package/build/components/conversations/conversation_preview.js.map +1 -1
- package/build/components/display/action_button.d.ts +2 -1
- package/build/components/display/action_button.d.ts.map +1 -1
- package/build/components/display/action_button.js +3 -4
- package/build/components/display/action_button.js.map +1 -1
- package/build/components/display/banner.d.ts +6 -1
- package/build/components/display/banner.d.ts.map +1 -1
- package/build/components/display/banner.js +2 -2
- package/build/components/display/banner.js.map +1 -1
- package/build/components/display/banner_collapsible.d.ts +1 -1
- package/build/components/display/banner_collapsible.d.ts.map +1 -1
- package/build/components/display/banner_collapsible.js +2 -2
- package/build/components/display/banner_collapsible.js.map +1 -1
- package/build/components/display/child_notice.d.ts +3 -1
- package/build/components/display/child_notice.d.ts.map +1 -1
- package/build/components/display/child_notice.js +2 -2
- package/build/components/display/child_notice.js.map +1 -1
- package/build/components/display/person.d.ts +3 -1
- package/build/components/display/person.d.ts.map +1 -1
- package/build/components/display/person.js +2 -2
- package/build/components/display/person.js.map +1 -1
- package/build/components/group_conversation_list.d.ts +19 -0
- package/build/components/group_conversation_list.d.ts.map +1 -0
- package/build/components/group_conversation_list.js +48 -0
- package/build/components/group_conversation_list.js.map +1 -0
- package/build/components/index.d.ts +1 -0
- package/build/components/index.d.ts.map +1 -1
- package/build/components/index.js +1 -0
- package/build/components/index.js.map +1 -1
- package/build/components/primitive/banner_primitive.d.ts +3 -0
- package/build/components/primitive/banner_primitive.d.ts.map +1 -1
- package/build/components/primitive/banner_primitive.js +4 -4
- package/build/components/primitive/banner_primitive.js.map +1 -1
- package/build/contexts/api_provider.d.ts +1 -1
- package/build/contexts/api_provider.d.ts.map +1 -1
- package/build/contexts/api_provider.js +3 -3
- package/build/contexts/api_provider.js.map +1 -1
- package/build/contexts/chat_context.d.ts +4 -4
- package/build/contexts/chat_context.d.ts.map +1 -1
- package/build/contexts/chat_context.js +3 -3
- package/build/contexts/chat_context.js.map +1 -1
- package/build/contexts/conversations_context.js +1 -1
- package/build/contexts/conversations_context.js.map +1 -1
- package/build/hooks/attachments/supported_extensions.d.ts +2 -0
- package/build/hooks/attachments/supported_extensions.d.ts.map +1 -0
- package/build/hooks/attachments/supported_extensions.js +48 -0
- package/build/hooks/attachments/supported_extensions.js.map +1 -0
- package/build/hooks/groups/use_group_members_for_new_conversation.d.ts +235 -0
- package/build/hooks/groups/use_group_members_for_new_conversation.d.ts.map +1 -0
- package/build/hooks/groups/use_group_members_for_new_conversation.js +55 -0
- package/build/hooks/groups/use_group_members_for_new_conversation.js.map +1 -0
- package/build/hooks/groups/use_groups_conversation_create.d.ts +9 -0
- package/build/hooks/groups/use_groups_conversation_create.d.ts.map +1 -0
- package/build/hooks/groups/use_groups_conversation_create.js +36 -0
- package/build/hooks/groups/use_groups_conversation_create.js.map +1 -0
- package/build/hooks/index.d.ts +4 -0
- package/build/hooks/index.d.ts.map +1 -1
- package/build/hooks/index.js +4 -0
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/use_api.d.ts +43 -43
- package/build/hooks/use_api.d.ts.map +1 -1
- package/build/hooks/use_api.js +5 -0
- package/build/hooks/use_api.js.map +1 -1
- package/build/hooks/use_api_client.d.ts.map +1 -1
- package/build/hooks/use_api_client.js +5 -3
- package/build/hooks/use_api_client.js.map +1 -1
- package/build/hooks/use_attachment_uploader.d.ts +26 -0
- package/build/hooks/use_attachment_uploader.d.ts.map +1 -0
- package/build/hooks/use_attachment_uploader.js +111 -0
- package/build/hooks/use_attachment_uploader.js.map +1 -0
- package/build/hooks/use_chat_permissions.d.ts +14 -14
- package/build/hooks/use_conversation.d.ts.map +1 -1
- package/build/hooks/use_conversation.js +1 -0
- package/build/hooks/use_conversation.js.map +1 -1
- package/build/hooks/use_conversations_actions.d.ts.map +1 -1
- package/build/hooks/use_conversations_actions.js +10 -0
- package/build/hooks/use_conversations_actions.js.map +1 -1
- package/build/hooks/use_conversations_jolt_events.d.ts.map +1 -1
- package/build/hooks/use_conversations_jolt_events.js +4 -1
- package/build/hooks/use_conversations_jolt_events.js.map +1 -1
- package/build/hooks/use_current_person.d.ts +15 -0
- package/build/hooks/use_current_person.d.ts.map +1 -1
- package/build/hooks/use_current_person.js +26 -9
- package/build/hooks/use_current_person.js.map +1 -1
- package/build/hooks/use_groups.d.ts +26 -26
- package/build/hooks/use_groups_groups.d.ts +26 -26
- package/build/hooks/use_jolt.d.ts.map +1 -1
- package/build/hooks/use_jolt.js +15 -22
- package/build/hooks/use_jolt.js.map +1 -1
- package/build/hooks/use_message_create.js +2 -2
- package/build/hooks/use_message_create.js.map +1 -1
- package/build/hooks/use_suspense_api.d.ts.map +1 -1
- package/build/hooks/use_suspense_api.js +5 -0
- package/build/hooks/use_suspense_api.js.map +1 -1
- package/build/hooks/use_teams.d.ts +26 -26
- package/build/hooks/use_upload_client.d.ts +28 -0
- package/build/hooks/use_upload_client.d.ts.map +1 -0
- package/build/hooks/use_upload_client.js +32 -0
- package/build/hooks/use_upload_client.js.map +1 -0
- package/build/index.d.ts +3 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +3 -2
- package/build/index.js.map +1 -1
- package/build/navigation/index.d.ts +52 -34
- package/build/navigation/index.d.ts.map +1 -1
- package/build/navigation/index.js +16 -2
- package/build/navigation/index.js.map +1 -1
- package/build/screens/conversation_details_screen.js +2 -2
- package/build/screens/conversation_details_screen.js.map +1 -1
- package/build/screens/conversation_filter_recipients/components/checkbox_row.d.ts +10 -0
- package/build/screens/conversation_filter_recipients/components/checkbox_row.d.ts.map +1 -0
- package/build/screens/conversation_filter_recipients/components/checkbox_row.js +74 -0
- package/build/screens/conversation_filter_recipients/components/checkbox_row.js.map +1 -0
- package/build/screens/conversation_filter_recipients/components/header_row.d.ts +10 -0
- package/build/screens/conversation_filter_recipients/components/header_row.d.ts.map +1 -0
- package/build/screens/conversation_filter_recipients/components/header_row.js +69 -0
- package/build/screens/conversation_filter_recipients/components/header_row.js.map +1 -0
- package/build/screens/conversation_filter_recipients/components/navigation_header.d.ts +5 -0
- package/build/screens/conversation_filter_recipients/components/navigation_header.d.ts.map +1 -0
- package/build/screens/conversation_filter_recipients/components/navigation_header.js +46 -0
- package/build/screens/conversation_filter_recipients/components/navigation_header.js.map +1 -0
- package/build/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.d.ts +17 -0
- package/build/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.d.ts.map +1 -0
- package/build/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.js +37 -0
- package/build/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.js.map +1 -0
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts +1 -3
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts.map +1 -1
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js +67 -32
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js.map +1 -1
- package/build/screens/conversation_filter_recipients/hooks/use_flattened_array_of_service_types_with_teams.d.ts +10 -0
- package/build/screens/conversation_filter_recipients/hooks/use_flattened_array_of_service_types_with_teams.d.ts.map +1 -0
- package/build/screens/conversation_filter_recipients/hooks/use_flattened_array_of_service_types_with_teams.js +32 -0
- package/build/screens/conversation_filter_recipients/hooks/use_flattened_array_of_service_types_with_teams.js.map +1 -0
- package/build/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.d.ts +8 -0
- package/build/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.d.ts.map +1 -0
- package/build/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.js +65 -0
- package/build/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.js.map +1 -0
- package/build/screens/conversation_filter_recipients/types.d.ts +38 -0
- package/build/screens/conversation_filter_recipients/types.d.ts.map +1 -0
- package/build/screens/conversation_filter_recipients/types.js +6 -0
- package/build/screens/conversation_filter_recipients/types.js.map +1 -0
- package/build/screens/conversation_filters/components/conversation_filters.js +5 -2
- package/build/screens/conversation_filters/components/conversation_filters.js.map +1 -1
- package/build/screens/conversation_filters/components/rows.d.ts.map +1 -1
- package/build/screens/conversation_filters/components/rows.js +6 -1
- package/build/screens/conversation_filters/components/rows.js.map +1 -1
- package/build/screens/conversation_filters/group_filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/group_filters.js +12 -4
- package/build/screens/conversation_filters/group_filters.js.map +1 -1
- package/build/screens/conversation_filters/hooks/filters.d.ts +40 -40
- package/build/screens/conversation_filters/hooks/filters.js +1 -1
- package/build/screens/conversation_filters/hooks/filters.js.map +1 -1
- package/build/screens/conversation_filters/team_filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/team_filters.js +12 -4
- package/build/screens/conversation_filters/team_filters.js.map +1 -1
- package/build/screens/conversation_filters_screen.js +1 -0
- package/build/screens/conversation_filters_screen.js.map +1 -1
- package/build/screens/conversation_new/components/form_list.d.ts +12 -0
- package/build/screens/conversation_new/components/form_list.d.ts.map +1 -0
- package/build/screens/conversation_new/components/form_list.js +42 -0
- package/build/screens/conversation_new/components/form_list.js.map +1 -0
- package/build/screens/conversation_new/components/groups_form.d.ts +4 -2
- package/build/screens/conversation_new/components/groups_form.d.ts.map +1 -1
- package/build/screens/conversation_new/components/groups_form.js +82 -90
- package/build/screens/conversation_new/components/groups_form.js.map +1 -1
- package/build/screens/conversation_new/components/team_form.d.ts +1 -1
- package/build/screens/conversation_new/components/team_form.js.map +1 -1
- package/build/screens/conversation_new/conversation_new_screen.d.ts +5 -2
- package/build/screens/conversation_new/conversation_new_screen.d.ts.map +1 -1
- package/build/screens/conversation_new/conversation_new_screen.js +2 -2
- package/build/screens/conversation_new/conversation_new_screen.js.map +1 -1
- package/build/screens/conversation_screen.d.ts +7 -0
- package/build/screens/conversation_screen.d.ts.map +1 -1
- package/build/screens/conversation_screen.js +103 -4
- package/build/screens/conversation_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/components/groups_without_chat_disclaimer_row.d.ts +2 -0
- package/build/screens/conversation_select_recipients/components/groups_without_chat_disclaimer_row.d.ts.map +1 -0
- package/build/screens/conversation_select_recipients/components/groups_without_chat_disclaimer_row.js +17 -0
- package/build/screens/conversation_select_recipients/components/groups_without_chat_disclaimer_row.js.map +1 -0
- package/build/screens/conversation_select_recipients/components/recipient_link_row.d.ts +12 -0
- package/build/screens/conversation_select_recipients/components/recipient_link_row.d.ts.map +1 -0
- package/build/screens/conversation_select_recipients/components/recipient_link_row.js +61 -0
- package/build/screens/conversation_select_recipients/components/recipient_link_row.js.map +1 -0
- package/build/screens/conversation_select_recipients/components/view_more_link_row.d.ts +7 -0
- package/build/screens/conversation_select_recipients/components/view_more_link_row.d.ts.map +1 -0
- package/build/screens/conversation_select_recipients/components/view_more_link_row.js +21 -0
- package/build/screens/conversation_select_recipients/components/view_more_link_row.js.map +1 -0
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.d.ts +4 -0
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.d.ts.map +1 -0
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.js +48 -0
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.js.map +1 -0
- package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.d.ts +2 -6
- package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.js +37 -49
- package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/types/screen_props.d.ts +9 -0
- package/build/screens/conversation_select_recipients/types/screen_props.d.ts.map +1 -0
- package/build/screens/conversation_select_recipients/types/screen_props.js +2 -0
- package/build/screens/conversation_select_recipients/types/screen_props.js.map +1 -0
- package/build/screens/conversations/components/list_header_component.d.ts.map +1 -1
- package/build/screens/conversations/components/list_header_component.js +18 -4
- package/build/screens/conversations/components/list_header_component.js.map +1 -1
- package/build/screens/conversations/conversations_screen.d.ts +2 -1
- package/build/screens/conversations/conversations_screen.d.ts.map +1 -1
- package/build/screens/conversations/conversations_screen.js +32 -1
- package/build/screens/conversations/conversations_screen.js.map +1 -1
- package/build/screens/send_giphy_screen.js +29 -1
- package/build/screens/send_giphy_screen.js.map +1 -1
- package/build/types/resources/groups/groups_group_resource.d.ts +1 -1
- package/build/types/resources/groups/groups_group_resource.js.map +1 -1
- package/build/types/resources/groups/groups_member_resource_with_person.d.ts +14 -0
- package/build/types/resources/groups/groups_member_resource_with_person.d.ts.map +1 -0
- package/build/types/resources/groups/groups_member_resource_with_person.js +2 -0
- package/build/types/resources/groups/groups_member_resource_with_person.js.map +1 -0
- package/build/types/resources/member.d.ts +0 -10
- package/build/types/resources/member.d.ts.map +1 -1
- package/build/types/resources/member.js.map +1 -1
- package/build/types/resources/message.d.ts +2 -0
- package/build/types/resources/message.d.ts.map +1 -1
- package/build/types/resources/message.js.map +1 -1
- package/build/types/resources/oauth_token.d.ts +4 -4
- package/build/types/resources/oauth_token.d.ts.map +1 -1
- package/build/types/resources/oauth_token.js.map +1 -1
- package/build/utils/client/client.d.ts +4 -8
- package/build/utils/client/client.d.ts.map +1 -1
- package/build/utils/client/client.js +10 -9
- package/build/utils/client/client.js.map +1 -1
- package/build/utils/date.d.ts +5 -0
- package/build/utils/date.d.ts.map +1 -1
- package/build/utils/date.js +8 -1
- package/build/utils/date.js.map +1 -1
- package/build/utils/destructure_chat_group_graph_id.d.ts +10 -0
- package/build/utils/destructure_chat_group_graph_id.d.ts.map +1 -0
- package/build/utils/destructure_chat_group_graph_id.js +8 -0
- package/build/utils/destructure_chat_group_graph_id.js.map +1 -0
- package/build/utils/index.d.ts +1 -0
- package/build/utils/index.d.ts.map +1 -1
- package/build/utils/index.js +1 -0
- package/build/utils/index.js.map +1 -1
- package/build/utils/native_adapters/configuration.d.ts +4 -1
- package/build/utils/native_adapters/configuration.d.ts.map +1 -1
- package/build/utils/native_adapters/configuration.js +13 -1
- package/build/utils/native_adapters/configuration.js.map +1 -1
- package/build/utils/native_adapters/image_picker.d.ts +25 -0
- package/build/utils/native_adapters/image_picker.d.ts.map +1 -0
- package/build/utils/native_adapters/image_picker.js +9 -0
- package/build/utils/native_adapters/image_picker.js.map +1 -0
- package/build/utils/native_adapters/index.d.ts +1 -0
- package/build/utils/native_adapters/index.d.ts.map +1 -1
- package/build/utils/native_adapters/index.js +1 -0
- package/build/utils/native_adapters/index.js.map +1 -1
- package/build/utils/session.d.ts +6 -2
- package/build/utils/session.d.ts.map +1 -1
- package/build/utils/session.js +6 -1
- package/build/utils/session.js.map +1 -1
- package/build/utils/upload_uri.d.ts +23 -0
- package/build/utils/upload_uri.d.ts.map +1 -0
- package/build/utils/upload_uri.js +60 -0
- package/build/utils/upload_uri.js.map +1 -0
- package/build/utils/uri.d.ts +10 -2
- package/build/utils/uri.d.ts.map +1 -1
- package/build/utils/uri.js +24 -6
- package/build/utils/uri.js.map +1 -1
- package/build/vendor/tapestry/alias_tokens_color_map.d.ts +2 -0
- package/build/vendor/tapestry/alias_tokens_color_map.d.ts.map +1 -1
- package/build/vendor/tapestry/alias_tokens_color_map.js +2 -0
- package/build/vendor/tapestry/alias_tokens_color_map.js.map +1 -1
- package/package.json +4 -3
- package/src/__tests__/hooks/useTheme.tsx +1 -1
- package/src/__tests__/{client.ts → utils/client.ts} +7 -115
- package/src/__tests__/{session.ts → utils/session.ts} +4 -4
- package/src/__tests__/utils/uri.ts +107 -0
- package/src/components/conversation/message_form/message_form_attachment_image.tsx +121 -0
- package/src/components/conversation/message_form.tsx +197 -31
- package/src/components/conversations/conversation_actions.tsx +2 -2
- package/src/components/conversations/conversation_preview.tsx +8 -2
- package/src/components/display/action_button.tsx +4 -3
- package/src/components/display/banner.tsx +7 -1
- package/src/components/display/banner_collapsible.tsx +6 -1
- package/src/components/display/child_notice.tsx +9 -3
- package/src/components/display/person.tsx +4 -3
- package/src/components/group_conversation_list.tsx +82 -0
- package/src/components/index.tsx +1 -0
- package/src/components/primitive/banner_primitive.tsx +12 -5
- package/src/contexts/api_provider.tsx +3 -3
- package/src/contexts/chat_context.tsx +7 -7
- package/src/contexts/conversations_context.tsx +1 -1
- package/src/hooks/attachments/supported_extensions.ts +47 -0
- package/src/hooks/groups/use_group_members_for_new_conversation.ts +74 -0
- package/src/hooks/groups/use_groups_conversation_create.ts +50 -0
- package/src/hooks/index.ts +4 -0
- package/src/hooks/use_api.ts +13 -7
- package/src/hooks/use_api_client.ts +7 -3
- package/src/hooks/use_attachment_uploader.ts +179 -0
- package/src/hooks/use_conversation.ts +1 -0
- package/src/hooks/use_conversations_actions.ts +11 -0
- package/src/hooks/use_conversations_jolt_events.ts +5 -1
- package/src/hooks/use_current_person.ts +37 -9
- package/src/hooks/use_jolt.ts +18 -23
- package/src/hooks/use_message_create.ts +2 -2
- package/src/hooks/use_suspense_api.ts +6 -0
- package/src/hooks/use_upload_client.ts +67 -0
- package/src/index.tsx +3 -1
- package/src/navigation/index.tsx +23 -2
- package/src/screens/conversation_details_screen.tsx +2 -2
- package/src/screens/conversation_filter_recipients/components/checkbox_row.tsx +101 -0
- package/src/screens/conversation_filter_recipients/components/header_row.tsx +99 -0
- package/src/screens/conversation_filter_recipients/components/navigation_header.tsx +68 -0
- package/src/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.tsx +53 -0
- package/src/screens/conversation_filter_recipients/conversation_filter_recipients_screen.tsx +90 -49
- package/src/screens/conversation_filter_recipients/hooks/use_flattened_array_of_service_types_with_teams.tsx +50 -0
- package/src/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.ts +90 -0
- package/src/screens/conversation_filter_recipients/types.tsx +47 -0
- package/src/screens/conversation_filters/components/conversation_filters.tsx +5 -2
- package/src/screens/conversation_filters/components/rows.tsx +6 -1
- package/src/screens/conversation_filters/group_filters.tsx +23 -14
- package/src/screens/conversation_filters/hooks/filters.ts +1 -1
- package/src/screens/conversation_filters/team_filters.tsx +23 -14
- package/src/screens/conversation_filters_screen.tsx +1 -0
- package/src/screens/conversation_new/components/form_list.tsx +67 -0
- package/src/screens/conversation_new/components/groups_form.tsx +133 -107
- package/src/screens/conversation_new/components/team_form.tsx +1 -1
- package/src/screens/conversation_new/conversation_new_screen.tsx +11 -4
- package/src/screens/conversation_screen.tsx +123 -4
- package/src/screens/conversation_select_recipients/components/groups_without_chat_disclaimer_row.tsx +21 -0
- package/src/screens/conversation_select_recipients/components/recipient_link_row.tsx +91 -0
- package/src/screens/conversation_select_recipients/components/view_more_link_row.tsx +30 -0
- package/src/screens/conversation_select_recipients/conversation_select_group_recipients_screen.tsx +79 -0
- package/src/screens/conversation_select_recipients/conversation_select_recipients_screen.tsx +57 -65
- package/src/screens/conversation_select_recipients/types/screen_props.tsx +11 -0
- package/src/screens/conversations/components/list_header_component.tsx +20 -4
- package/src/screens/conversations/conversations_screen.tsx +37 -2
- package/src/screens/send_giphy_screen.tsx +30 -1
- package/src/types/resources/groups/groups_group_resource.ts +1 -1
- package/src/types/resources/groups/groups_member_resource_with_person.ts +13 -0
- package/src/types/resources/member.ts +0 -11
- package/src/types/resources/message.ts +2 -0
- package/src/types/resources/oauth_token.ts +4 -4
- package/src/utils/client/client.ts +13 -13
- package/src/utils/date.ts +11 -1
- package/src/utils/destructure_chat_group_graph_id.ts +25 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/native_adapters/configuration.ts +15 -1
- package/src/utils/native_adapters/image_picker.ts +31 -0
- package/src/utils/native_adapters/index.ts +1 -0
- package/src/utils/session.ts +10 -4
- package/src/utils/upload_uri.ts +69 -0
- package/src/utils/uri.ts +30 -6
- package/src/vendor/tapestry/alias_tokens_color_map.ts +3 -0
|
@@ -1,32 +1,28 @@
|
|
|
1
1
|
import { StackActions, useNavigation } from '@react-navigation/native'
|
|
2
|
-
import React, { useCallback, useState } from 'react'
|
|
3
|
-
import { StyleSheet, TextInput, View } from 'react-native'
|
|
4
|
-
import {
|
|
5
|
-
import { Text } from '../../../components'
|
|
2
|
+
import React, { useCallback, useMemo, useState } from 'react'
|
|
3
|
+
import { Platform, StyleSheet, TextInput, View } from 'react-native'
|
|
4
|
+
import { Banner, ChildNotice, Heading, Text } from '../../../components'
|
|
6
5
|
import { ActionButton } from '../../../components/display/action_button'
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { useMutation } from '@tanstack/react-query'
|
|
6
|
+
import { KeyboardView } from '../../../components/display/keyboard_view'
|
|
7
|
+
import { useCurrentPerson, useSuspenseGet, useTheme } from '../../../hooks'
|
|
10
8
|
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} from '../../../types'
|
|
9
|
+
GroupMembersForNewConversationResult,
|
|
10
|
+
useGroupMembersForNewConversation,
|
|
11
|
+
} from '../../../hooks/groups/use_group_members_for_new_conversation'
|
|
12
|
+
import { useGroupsConversationCreate } from '../../../hooks/groups/use_groups_conversation_create'
|
|
13
|
+
import { GroupsGroupResource } from '../../../types'
|
|
14
|
+
import { GraphId } from '../../../types/resources/group_resource'
|
|
15
|
+
import { pluralize } from '../../../utils'
|
|
16
|
+
import { Divider, FormList } from './form_list'
|
|
16
17
|
|
|
17
18
|
type GroupsFormProps = {
|
|
18
|
-
groupId
|
|
19
|
+
groupId: number
|
|
20
|
+
chat_group_graph_id?: GraphId
|
|
19
21
|
}
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
value: string
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export const GroupsForm = ({ groupId }: GroupsFormProps) => {
|
|
26
|
-
const styles = useStyles()
|
|
23
|
+
export const GroupsForm = ({ groupId, chat_group_graph_id }: GroupsFormProps) => {
|
|
27
24
|
const navigation = useNavigation()
|
|
28
25
|
const [title, setTitle] = useState<string>()
|
|
29
|
-
const apiClient = useApiClient()
|
|
30
26
|
const { data: group } = useSuspenseGet<GroupsGroupResource>({
|
|
31
27
|
url: `/me/groups/${groupId}`,
|
|
32
28
|
data: {
|
|
@@ -36,120 +32,150 @@ export const GroupsForm = ({ groupId }: GroupsFormProps) => {
|
|
|
36
32
|
},
|
|
37
33
|
app: 'groups',
|
|
38
34
|
})
|
|
39
|
-
const { mutate: handleSave } = useMutation({
|
|
40
|
-
throwOnError: true,
|
|
41
|
-
onSuccess: result => {
|
|
42
|
-
handleRedirectToConversation({ conversation_id: result.data.id })
|
|
43
|
-
},
|
|
44
|
-
mutationFn: () =>
|
|
45
|
-
apiClient.groups
|
|
46
|
-
.post<ApiResource<ChatConversationPayload>>({
|
|
47
|
-
url: `/me/groups/${groupId}/chat_conversation_payload`,
|
|
48
|
-
data: {
|
|
49
|
-
data: {
|
|
50
|
-
type: '',
|
|
51
|
-
attributes: {
|
|
52
|
-
title,
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
})
|
|
57
|
-
.then(res => res.data.value)
|
|
58
|
-
.then(payload =>
|
|
59
|
-
apiClient.chat.post<ApiResource<ConversationResource>>({
|
|
60
|
-
url: '/me/conversations',
|
|
61
|
-
data: {
|
|
62
|
-
data: {
|
|
63
|
-
type: 'Conversation',
|
|
64
|
-
attributes: {
|
|
65
|
-
payload,
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
})
|
|
70
|
-
),
|
|
71
|
-
})
|
|
72
35
|
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
36
|
+
const groupMemberships = useGroupMembersForNewConversation({ id: groupId })
|
|
37
|
+
|
|
38
|
+
const redirectToConversation = useCallback(
|
|
39
|
+
(conversationId: number) => {
|
|
77
40
|
// navigate to the conversation screen
|
|
78
41
|
navigation.dispatch(
|
|
79
|
-
StackActions.
|
|
80
|
-
conversation_id,
|
|
42
|
+
StackActions.popTo('Conversation', {
|
|
43
|
+
conversation_id: conversationId,
|
|
44
|
+
chat_group_graph_id,
|
|
81
45
|
})
|
|
82
46
|
)
|
|
83
47
|
},
|
|
84
|
-
[navigation]
|
|
48
|
+
[chat_group_graph_id, navigation]
|
|
85
49
|
)
|
|
86
50
|
|
|
51
|
+
const { mutate: handleSave } = useGroupsConversationCreate({
|
|
52
|
+
groupId,
|
|
53
|
+
title,
|
|
54
|
+
onSuccess: redirectToConversation,
|
|
55
|
+
})
|
|
56
|
+
|
|
87
57
|
return (
|
|
88
|
-
<
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
<
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
<View style={styles.titleContainer}>
|
|
98
|
-
<Text style={styles.titleLabel}>Title</Text>
|
|
99
|
-
<TextInput
|
|
100
|
-
placeholder="Topic of conversation (required)"
|
|
101
|
-
value={title}
|
|
102
|
-
onChangeText={setTitle}
|
|
103
|
-
style={styles.titleInput}
|
|
58
|
+
<KeyboardView>
|
|
59
|
+
<FormList
|
|
60
|
+
memberData={groupMemberships.adultMembers}
|
|
61
|
+
FormContent={
|
|
62
|
+
<FormContent
|
|
63
|
+
group={group}
|
|
64
|
+
title={title}
|
|
65
|
+
setTitle={setTitle}
|
|
66
|
+
groupMemberships={groupMemberships}
|
|
104
67
|
/>
|
|
105
|
-
|
|
68
|
+
}
|
|
69
|
+
/>
|
|
70
|
+
<ActionButton
|
|
71
|
+
disabled={!title}
|
|
72
|
+
title="Start Conversation"
|
|
73
|
+
onPress={() => handleSave()}
|
|
74
|
+
infoText="Conversation will be automatically updated if any members are added or removed from this group."
|
|
75
|
+
/>
|
|
76
|
+
</KeyboardView>
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
interface FormContentProps {
|
|
81
|
+
group: GroupsGroupResource
|
|
82
|
+
title?: string
|
|
83
|
+
setTitle: (title: string) => void
|
|
84
|
+
groupMemberships: GroupMembersForNewConversationResult
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function FormContent({ group, title, setTitle, groupMemberships }: FormContentProps) {
|
|
88
|
+
const styles = useStyles()
|
|
89
|
+
const currentPerson = useCurrentPerson()
|
|
90
|
+
const { name, membershipsCount } = group
|
|
91
|
+
|
|
92
|
+
const myGroupsMembership = useMemo(
|
|
93
|
+
() => groupMemberships.data.find(m => m.id === currentPerson.id),
|
|
94
|
+
[groupMemberships.data, currentPerson.id]
|
|
95
|
+
)
|
|
96
|
+
const isLeader = myGroupsMembership?.role === 'leader'
|
|
97
|
+
|
|
98
|
+
const childMembers = groupMemberships.childMembers
|
|
99
|
+
const hasChildren = childMembers.length > 0
|
|
100
|
+
const adultCount = groupMemberships.adultMembers.length
|
|
101
|
+
const memberCount = isLeader ? membershipsCount : adultCount
|
|
102
|
+
const memberHeaderLabel = `${pluralize(memberCount, 'member')} selected`
|
|
103
|
+
|
|
104
|
+
const showMemberError = groupMemberships.isError
|
|
105
|
+
const showChildNotice = hasChildren && isLeader
|
|
106
|
+
|
|
107
|
+
return (
|
|
108
|
+
<View style={styles.formContent}>
|
|
109
|
+
<View style={styles.toSection}>
|
|
110
|
+
<Heading variant="h3">To:</Heading>
|
|
111
|
+
<Text style={styles.groupName}>{name}</Text>
|
|
112
|
+
</View>
|
|
113
|
+
<Divider />
|
|
114
|
+
<View style={styles.titleSection}>
|
|
115
|
+
<Heading variant="h3">Title</Heading>
|
|
116
|
+
<TextInput
|
|
117
|
+
placeholder="Topic of conversation (required)"
|
|
118
|
+
value={title}
|
|
119
|
+
onChangeText={setTitle}
|
|
120
|
+
style={styles.titleInput}
|
|
121
|
+
autoFocus={true}
|
|
122
|
+
/>
|
|
123
|
+
</View>
|
|
124
|
+
<Divider />
|
|
125
|
+
<View style={styles.memberSection}>
|
|
126
|
+
<Heading variant="h3">{memberHeaderLabel}</Heading>
|
|
127
|
+
{showChildNotice && <ChildNotice childMembers={childMembers} style={styles.banner} />}
|
|
128
|
+
{showMemberError && (
|
|
129
|
+
<Banner
|
|
130
|
+
appearance="error"
|
|
131
|
+
description="There was an issue loading group members, please refresh and try again."
|
|
132
|
+
style={styles.banner}
|
|
133
|
+
/>
|
|
134
|
+
)}
|
|
106
135
|
</View>
|
|
107
|
-
<ActionButton title="Start Conversation" onPress={() => handleSave()} />
|
|
108
136
|
</View>
|
|
109
137
|
)
|
|
110
138
|
}
|
|
111
139
|
|
|
112
140
|
const useStyles = () => {
|
|
113
|
-
const {
|
|
114
|
-
const
|
|
141
|
+
const { colors } = useTheme()
|
|
142
|
+
const sectionPadding = 16
|
|
143
|
+
const inputPadding = 8
|
|
115
144
|
|
|
116
145
|
return StyleSheet.create({
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
gap: 8,
|
|
120
|
-
},
|
|
121
|
-
section: {
|
|
122
|
-
padding: 16,
|
|
146
|
+
formContent: {
|
|
147
|
+
paddingVertical: sectionPadding,
|
|
123
148
|
flex: 1,
|
|
124
149
|
},
|
|
125
|
-
|
|
150
|
+
toSection: {
|
|
151
|
+
padding: sectionPadding,
|
|
126
152
|
flexDirection: 'row',
|
|
127
|
-
|
|
153
|
+
gap: 8,
|
|
128
154
|
},
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
alignContent: 'center',
|
|
132
|
-
padding: 16,
|
|
133
|
-
paddingBottom: bottom,
|
|
134
|
-
borderTopWidth: 1,
|
|
135
|
-
borderTopColor: theme.colors.fillColorNeutral050Base,
|
|
155
|
+
groupName: {
|
|
156
|
+
fontSize: 18,
|
|
136
157
|
},
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
158
|
+
titleSection: {
|
|
159
|
+
padding: sectionPadding,
|
|
160
|
+
paddingBottom: Platform.select({
|
|
161
|
+
ios: sectionPadding,
|
|
162
|
+
android: sectionPadding - inputPadding,
|
|
163
|
+
}),
|
|
164
|
+
gap: Platform.select({
|
|
165
|
+
ios: 8,
|
|
166
|
+
android: 0,
|
|
167
|
+
}),
|
|
142
168
|
},
|
|
143
169
|
titleInput: {
|
|
144
170
|
fontSize: 18,
|
|
171
|
+
color: colors.textColorDefaultPrimary,
|
|
145
172
|
},
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
borderBottomColor: theme.colors.fillColorNeutral050Base,
|
|
173
|
+
memberSection: {
|
|
174
|
+
padding: sectionPadding,
|
|
175
|
+
paddingBottom: 0,
|
|
176
|
+
},
|
|
177
|
+
banner: {
|
|
178
|
+
marginTop: 16,
|
|
153
179
|
},
|
|
154
180
|
})
|
|
155
181
|
}
|
|
@@ -4,20 +4,27 @@ import { GroupsForm } from './components/groups_form'
|
|
|
4
4
|
import { TeamsForm } from './components/team_form'
|
|
5
5
|
import { SourceAppErrorCard } from './components/source_app_error_card'
|
|
6
6
|
import { AppName } from '../../types/resources/app_name'
|
|
7
|
+
import { GraphId } from '../../types/resources/group_resource'
|
|
7
8
|
|
|
8
9
|
type ConversationNewScreenProps = StaticScreenProps<{
|
|
9
|
-
group_id?:
|
|
10
|
-
team_ids?:
|
|
10
|
+
group_id?: number
|
|
11
|
+
team_ids?: number[]
|
|
11
12
|
plan_id?: number
|
|
12
13
|
source_app_name: AppName
|
|
14
|
+
chat_group_graph_id?: GraphId
|
|
15
|
+
group_source_app_name?: AppName
|
|
13
16
|
}>
|
|
14
17
|
|
|
15
18
|
export const ConversationNewScreen = ({ route }: ConversationNewScreenProps) => {
|
|
16
|
-
const { group_id, team_ids, source_app_name, plan_id } = route.params
|
|
19
|
+
const { group_id, team_ids, source_app_name, plan_id, chat_group_graph_id } = route.params
|
|
17
20
|
|
|
18
21
|
switch (source_app_name) {
|
|
19
22
|
case 'Groups':
|
|
20
|
-
return
|
|
23
|
+
return group_id ? (
|
|
24
|
+
<GroupsForm groupId={group_id} chat_group_graph_id={chat_group_graph_id} />
|
|
25
|
+
) : (
|
|
26
|
+
<SourceAppErrorCard />
|
|
27
|
+
)
|
|
21
28
|
case 'Services':
|
|
22
29
|
return <TeamsForm initialTeamIds={team_ids} initialPlanId={plan_id} />
|
|
23
30
|
default:
|
|
@@ -1,19 +1,27 @@
|
|
|
1
|
+
// @ts-expect-error
|
|
2
|
+
import { date as formatDate } from '@planningcenter/datetime-fmt'
|
|
1
3
|
import { HeaderTitle, HeaderTitleProps, PlatformPressable } from '@react-navigation/elements'
|
|
2
4
|
import {
|
|
5
|
+
CommonActions,
|
|
6
|
+
RouteProp,
|
|
3
7
|
StaticScreenProps,
|
|
4
8
|
useNavigation,
|
|
5
9
|
useTheme as useNavigationTheme,
|
|
6
10
|
useRoute,
|
|
7
11
|
} from '@react-navigation/native'
|
|
12
|
+
import moment from 'moment'
|
|
8
13
|
import React, { useCallback, useEffect } from 'react'
|
|
9
14
|
import { FlatList, Platform, StyleSheet, View } from 'react-native'
|
|
10
15
|
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
11
|
-
import { Badge, Icon } from '../components'
|
|
16
|
+
import { Badge, Icon, Text } from '../components'
|
|
12
17
|
import { Message } from '../components/conversation/message'
|
|
13
18
|
import { MessageForm } from '../components/conversation/message_form'
|
|
14
19
|
import { KeyboardView } from '../components/display/keyboard_view'
|
|
20
|
+
import { useTheme } from '../hooks'
|
|
15
21
|
import { useConversation } from '../hooks/use_conversation'
|
|
16
22
|
import { useConversationMessages } from '../hooks/use_conversation_messages'
|
|
23
|
+
import { MessageResource } from '../types'
|
|
24
|
+
import { getRelativeDateStatus } from '../utils/date'
|
|
17
25
|
|
|
18
26
|
type ConversationRouteProps = {
|
|
19
27
|
conversation_id: number
|
|
@@ -32,6 +40,8 @@ export function ConversationScreen({ route }: ConversationScreenProps) {
|
|
|
32
40
|
const { messages, refetch, isRefetching, fetchNextPage } = useConversationMessages({
|
|
33
41
|
conversation_id,
|
|
34
42
|
})
|
|
43
|
+
useEnsureConversationsRouteExists()
|
|
44
|
+
const messagesWithSeparators = groupMessages(messages)
|
|
35
45
|
|
|
36
46
|
// Seems to be necessary to define this way so we get the route picked up
|
|
37
47
|
const headerTitle = useCallback(
|
|
@@ -51,13 +61,19 @@ export function ConversationScreen({ route }: ConversationScreenProps) {
|
|
|
51
61
|
contentContainerStyle={styles.listContainer}
|
|
52
62
|
refreshing={isRefetching}
|
|
53
63
|
onRefresh={refetch}
|
|
54
|
-
data={
|
|
64
|
+
data={messagesWithSeparators}
|
|
55
65
|
keyExtractor={item => item.id}
|
|
56
|
-
renderItem={({ item }) =>
|
|
66
|
+
renderItem={({ item }) => {
|
|
67
|
+
if (item.type === 'DateSeparator') {
|
|
68
|
+
return <InlineDateSeparator {...item} />
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return <Message {...item} conversation_id={conversation_id} />
|
|
72
|
+
}}
|
|
57
73
|
onEndReached={() => fetchNextPage()}
|
|
58
74
|
/>
|
|
59
75
|
<MessageForm.Root conversation={conversation}>
|
|
60
|
-
|
|
76
|
+
<MessageForm.AttachmentPicker />
|
|
61
77
|
<MessageForm.Commands />
|
|
62
78
|
<MessageForm.TextInput />
|
|
63
79
|
<MessageForm.SubmitButton />
|
|
@@ -67,6 +83,82 @@ export function ConversationScreen({ route }: ConversationScreenProps) {
|
|
|
67
83
|
)
|
|
68
84
|
}
|
|
69
85
|
|
|
86
|
+
export type DateSeparator = { type: 'DateSeparator'; id: string; date: string }
|
|
87
|
+
|
|
88
|
+
function InlineDateSeparator({ date }: DateSeparator) {
|
|
89
|
+
const styles = useDateSeparatorStyles()
|
|
90
|
+
const { isThisYear } = getRelativeDateStatus(date)
|
|
91
|
+
const showYear = !isThisYear
|
|
92
|
+
const dateStamp = formatDate(date, { style: 'long', year: showYear })
|
|
93
|
+
|
|
94
|
+
return (
|
|
95
|
+
<View style={styles.container}>
|
|
96
|
+
<View style={styles.separator} />
|
|
97
|
+
<Text variant="footnote" style={styles.dateText}>
|
|
98
|
+
{dateStamp}
|
|
99
|
+
</Text>
|
|
100
|
+
<View style={styles.separator} />
|
|
101
|
+
</View>
|
|
102
|
+
)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const useDateSeparatorStyles = () => {
|
|
106
|
+
const theme = useTheme()
|
|
107
|
+
return StyleSheet.create({
|
|
108
|
+
container: {
|
|
109
|
+
alignItems: 'center',
|
|
110
|
+
flexDirection: 'row',
|
|
111
|
+
paddingHorizontal: 16,
|
|
112
|
+
paddingVertical: 16,
|
|
113
|
+
},
|
|
114
|
+
separator: {
|
|
115
|
+
flex: 1,
|
|
116
|
+
height: 1,
|
|
117
|
+
borderTopWidth: 1,
|
|
118
|
+
borderTopColor: theme.colors.borderColorDefaultBase,
|
|
119
|
+
},
|
|
120
|
+
dateText: {
|
|
121
|
+
paddingHorizontal: 8,
|
|
122
|
+
},
|
|
123
|
+
})
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export const groupMessages = (ms: MessageResource[]) => {
|
|
127
|
+
let enrichedMessages: (MessageResource | DateSeparator)[] = []
|
|
128
|
+
let encounteredOneOfMyMessages = false
|
|
129
|
+
|
|
130
|
+
ms.forEach((message, i) => {
|
|
131
|
+
const prevMessage = ms[i + 1]
|
|
132
|
+
const nextMessage = ms[i - 1]
|
|
133
|
+
const date = moment(message.createdAt).format('YYYY-MM-DD')
|
|
134
|
+
const prevMessageDifferentAuthor = message.author?.id !== prevMessage?.author?.id
|
|
135
|
+
const nextMessageDifferentAuthor = message.author?.id !== nextMessage?.author?.id
|
|
136
|
+
const prevMessageMoreThan5Minutes =
|
|
137
|
+
prevMessage &&
|
|
138
|
+
new Date(message.createdAt).getTime() - new Date(prevMessage.createdAt).getTime() > 60000 * 5
|
|
139
|
+
const nextMessageMoreThan5Minutes =
|
|
140
|
+
nextMessage &&
|
|
141
|
+
new Date(nextMessage.createdAt).getTime() - new Date(message.createdAt).getTime() > 60000 * 5
|
|
142
|
+
|
|
143
|
+
if (message.mine && !encounteredOneOfMyMessages) {
|
|
144
|
+
encounteredOneOfMyMessages = true
|
|
145
|
+
message.myLatestInConversation = true
|
|
146
|
+
} else {
|
|
147
|
+
message.myLatestInConversation = false
|
|
148
|
+
}
|
|
149
|
+
message.lastInGroup = !nextMessage || nextMessageDifferentAuthor || nextMessageMoreThan5Minutes
|
|
150
|
+
message.renderAuthor =
|
|
151
|
+
!message.mine && (!prevMessage || prevMessageDifferentAuthor || prevMessageMoreThan5Minutes)
|
|
152
|
+
|
|
153
|
+
enrichedMessages.push(message)
|
|
154
|
+
if (!prevMessage || date !== moment(prevMessage.createdAt).format('YYYY-MM-DD')) {
|
|
155
|
+
enrichedMessages.push({ type: 'DateSeparator', id: `day-divider-${message.id}`, date })
|
|
156
|
+
}
|
|
157
|
+
})
|
|
158
|
+
|
|
159
|
+
return enrichedMessages
|
|
160
|
+
}
|
|
161
|
+
|
|
70
162
|
const PressableHeaderTitle = ({ style, children }: HeaderTitleProps) => {
|
|
71
163
|
const styles = usePressableHeaderStyle()
|
|
72
164
|
const navigation = useNavigation()
|
|
@@ -143,3 +235,30 @@ const useStyles = () => {
|
|
|
143
235
|
},
|
|
144
236
|
})
|
|
145
237
|
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* useEnsureConversationsRouteExists
|
|
241
|
+
*/
|
|
242
|
+
const useEnsureConversationsRouteExists = () => {
|
|
243
|
+
const navigation = useNavigation()
|
|
244
|
+
const { params } = useRoute<RouteProp<ConversationScreenProps['route']>>()
|
|
245
|
+
|
|
246
|
+
useEffect(() => {
|
|
247
|
+
const navigationState = navigation.getState()
|
|
248
|
+
const routes = navigationState?.routes || []
|
|
249
|
+
const conversationsRoute = routes.find(r => r.name === 'Conversations')
|
|
250
|
+
|
|
251
|
+
if (conversationsRoute) return
|
|
252
|
+
|
|
253
|
+
navigation.dispatch(state => {
|
|
254
|
+
return CommonActions.reset({
|
|
255
|
+
...state,
|
|
256
|
+
routes: [
|
|
257
|
+
{ name: 'Conversations', params: { chat_group_graph_id: params?.chat_group_graph_id } },
|
|
258
|
+
...routes,
|
|
259
|
+
],
|
|
260
|
+
index: state.index + 1,
|
|
261
|
+
})
|
|
262
|
+
})
|
|
263
|
+
}, [navigation, params?.chat_group_graph_id])
|
|
264
|
+
}
|
package/src/screens/conversation_select_recipients/components/groups_without_chat_disclaimer_row.tsx
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Text } from '../../../components'
|
|
2
|
+
import { StyleSheet } from 'react-native'
|
|
3
|
+
|
|
4
|
+
export const GroupsWithoutChatDisclaimerRow = () => {
|
|
5
|
+
const styles = useStyles()
|
|
6
|
+
|
|
7
|
+
return (
|
|
8
|
+
<Text variant="footnote" style={styles.disclaimer}>
|
|
9
|
+
*You have additional groups without chat enabled or permissions to start a new conversation.
|
|
10
|
+
</Text>
|
|
11
|
+
)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const useStyles = () => {
|
|
15
|
+
return StyleSheet.create({
|
|
16
|
+
disclaimer: {
|
|
17
|
+
paddingHorizontal: 16,
|
|
18
|
+
paddingVertical: 12,
|
|
19
|
+
},
|
|
20
|
+
})
|
|
21
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { PlatformPressable } from '@react-navigation/elements'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { StyleSheet, View } from 'react-native'
|
|
4
|
+
import { Icon, Image, Text } from '../../../components'
|
|
5
|
+
import { useTheme } from '../../../hooks'
|
|
6
|
+
import { platformFontWeightMedium } from '../../../utils'
|
|
7
|
+
|
|
8
|
+
interface RecipientLinkRowProps {
|
|
9
|
+
onPress: () => void
|
|
10
|
+
accessibilityLabel: string
|
|
11
|
+
accessibilityHint: string
|
|
12
|
+
imageUri?: string
|
|
13
|
+
title: string
|
|
14
|
+
subtitle: string
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const RecipientLinkRow = ({
|
|
18
|
+
onPress,
|
|
19
|
+
accessibilityLabel,
|
|
20
|
+
accessibilityHint,
|
|
21
|
+
imageUri,
|
|
22
|
+
title,
|
|
23
|
+
subtitle,
|
|
24
|
+
}: RecipientLinkRowProps) => {
|
|
25
|
+
const styles = useStyles()
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<PlatformPressable
|
|
29
|
+
style={styles.row}
|
|
30
|
+
onPress={onPress}
|
|
31
|
+
accessibilityRole="link"
|
|
32
|
+
accessibilityLabel={accessibilityLabel}
|
|
33
|
+
accessibilityHint={accessibilityHint}
|
|
34
|
+
>
|
|
35
|
+
<View style={styles.innerContainer}>
|
|
36
|
+
{imageUri && (
|
|
37
|
+
<Image source={{ uri: imageUri }} resizeMode="cover" style={styles.image} alt="" />
|
|
38
|
+
)}
|
|
39
|
+
<View style={styles.content}>
|
|
40
|
+
<Text style={styles.title} numberOfLines={2}>
|
|
41
|
+
{title}
|
|
42
|
+
</Text>
|
|
43
|
+
<Text variant="tertiary" numberOfLines={1}>
|
|
44
|
+
{subtitle}
|
|
45
|
+
</Text>
|
|
46
|
+
</View>
|
|
47
|
+
<Icon name="general.rightChevron" size={16} style={styles.icon} />
|
|
48
|
+
</View>
|
|
49
|
+
</PlatformPressable>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const ASPECT_RATIO = 16 / 9
|
|
54
|
+
const THUMBNAIL_WIDTH = 80
|
|
55
|
+
const THUMBNAIL_HEIGHT = THUMBNAIL_WIDTH / ASPECT_RATIO
|
|
56
|
+
|
|
57
|
+
const useStyles = () => {
|
|
58
|
+
const theme = useTheme()
|
|
59
|
+
|
|
60
|
+
return StyleSheet.create({
|
|
61
|
+
row: {
|
|
62
|
+
paddingLeft: 16,
|
|
63
|
+
},
|
|
64
|
+
innerContainer: {
|
|
65
|
+
flexDirection: 'row',
|
|
66
|
+
alignItems: 'center',
|
|
67
|
+
gap: 12,
|
|
68
|
+
paddingVertical: 16,
|
|
69
|
+
paddingRight: 16,
|
|
70
|
+
borderBottomWidth: 1,
|
|
71
|
+
borderColor: theme.colors.fillColorNeutral050Base,
|
|
72
|
+
},
|
|
73
|
+
image: {
|
|
74
|
+
width: THUMBNAIL_WIDTH,
|
|
75
|
+
height: THUMBNAIL_HEIGHT,
|
|
76
|
+
borderRadius: 4,
|
|
77
|
+
},
|
|
78
|
+
title: {
|
|
79
|
+
fontWeight: platformFontWeightMedium,
|
|
80
|
+
flexShrink: 1,
|
|
81
|
+
},
|
|
82
|
+
content: {
|
|
83
|
+
flexShrink: 1,
|
|
84
|
+
gap: 2,
|
|
85
|
+
},
|
|
86
|
+
icon: {
|
|
87
|
+
marginLeft: 'auto',
|
|
88
|
+
color: theme.colors.fillColorNeutral030,
|
|
89
|
+
},
|
|
90
|
+
})
|
|
91
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { StyleSheet, View } from 'react-native'
|
|
2
|
+
import { TextButton } from '../../../components'
|
|
3
|
+
|
|
4
|
+
interface ViewMoreLinkRowProps {
|
|
5
|
+
onPress: () => void
|
|
6
|
+
accessibilityHint: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const ViewMoreLinkRow = ({ accessibilityHint, onPress }: ViewMoreLinkRowProps) => {
|
|
10
|
+
const styles = useRowStyles()
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<View style={[styles.row]}>
|
|
14
|
+
<TextButton onPress={onPress} accessibilityHint={accessibilityHint} accessibilityRole="link">
|
|
15
|
+
View more
|
|
16
|
+
</TextButton>
|
|
17
|
+
</View>
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const useRowStyles = () => {
|
|
22
|
+
return StyleSheet.create({
|
|
23
|
+
row: {
|
|
24
|
+
flexDirection: 'row',
|
|
25
|
+
alignItems: 'center',
|
|
26
|
+
paddingVertical: 12,
|
|
27
|
+
paddingHorizontal: 16,
|
|
28
|
+
},
|
|
29
|
+
})
|
|
30
|
+
}
|