@planningcenter/chat-react-native 3.2.0-rc.2 → 3.2.0-rc.21
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.d.ts +2 -2
- package/build/components/conversation/message_form.d.ts.map +1 -1
- package/build/components/conversation/message_form.js +95 -41
- package/build/components/conversation/message_form.js.map +1 -1
- package/build/components/conversations/action_toggle_button.d.ts +1 -1
- package/build/components/conversations/action_toggle_button.d.ts.map +1 -1
- package/build/components/conversations/action_toggle_button.js +2 -1
- package/build/components/conversations/action_toggle_button.js.map +1 -1
- package/build/components/conversations/conversation_actions.d.ts.map +1 -1
- package/build/components/conversations/conversation_actions.js +25 -11
- package/build/components/conversations/conversation_actions.js.map +1 -1
- package/build/components/conversations/conversations.d.ts +3 -6
- package/build/components/conversations/conversations.d.ts.map +1 -1
- package/build/components/conversations/conversations.js +8 -18
- package/build/components/conversations/conversations.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/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 -5
- 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 +5 -3
- package/build/contexts/chat_context.d.ts.map +1 -1
- package/build/contexts/chat_context.js +8 -3
- package/build/contexts/chat_context.js.map +1 -1
- package/build/contexts/conversations_context.d.ts +14 -0
- package/build/contexts/conversations_context.d.ts.map +1 -0
- package/build/contexts/conversations_context.js +38 -0
- package/build/contexts/conversations_context.js.map +1 -0
- package/build/hooks/groups/use_group_members_for_new_conversation.d.ts +226 -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 +54 -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/use_api.d.ts +41 -41
- 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_chat_permissions.d.ts +14 -14
- package/build/hooks/use_conversations.d.ts +6 -32
- package/build/hooks/use_conversations.d.ts.map +1 -1
- package/build/hooks/use_conversations.js +15 -14
- package/build/hooks/use_conversations.js.map +1 -1
- package/build/hooks/use_conversations_actions.d.ts +221 -0
- package/build/hooks/use_conversations_actions.d.ts.map +1 -0
- package/build/hooks/use_conversations_actions.js +103 -0
- package/build/hooks/use_conversations_actions.js.map +1 -0
- package/build/hooks/use_conversations_cache.d.ts +18 -0
- package/build/hooks/use_conversations_cache.d.ts.map +1 -0
- package/build/hooks/{use_conversation_jolt_events.js → use_conversations_cache.js} +27 -17
- package/build/hooks/use_conversations_cache.js.map +1 -0
- package/build/hooks/use_conversations_jolt_events.d.ts +3 -0
- package/build/hooks/use_conversations_jolt_events.d.ts.map +1 -0
- package/build/hooks/use_conversations_jolt_events.js +15 -0
- package/build/hooks/use_conversations_jolt_events.js.map +1 -0
- 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_giphy.d.ts +9 -0
- package/build/hooks/use_giphy.d.ts.map +1 -0
- package/build/hooks/use_giphy.js +63 -0
- package/build/hooks/use_giphy.js.map +1 -0
- 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 +42 -20
- package/build/hooks/use_jolt.js.map +1 -1
- package/build/hooks/use_message_create.d.ts +11 -0
- package/build/hooks/use_message_create.d.ts.map +1 -0
- package/build/hooks/use_message_create.js +35 -0
- package/build/hooks/use_message_create.js.map +1 -0
- 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/index.d.ts +2 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/build/navigation/index.d.ts +65 -38
- package/build/navigation/index.d.ts.map +1 -1
- package/build/navigation/index.js +29 -10
- 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/{create → 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 -0
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js +87 -0
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js.map +1 -0
- 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/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_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 +7 -0
- package/build/screens/conversation_new/components/groups_form.d.ts.map +1 -0
- package/build/screens/conversation_new/components/groups_form.js +105 -0
- package/build/screens/conversation_new/components/groups_form.js.map +1 -0
- package/build/screens/conversation_new/components/source_app_error_card.d.ts +2 -0
- package/build/screens/conversation_new/components/source_app_error_card.d.ts.map +1 -0
- package/build/screens/conversation_new/components/source_app_error_card.js +16 -0
- package/build/screens/conversation_new/components/source_app_error_card.js.map +1 -0
- package/build/screens/conversation_new/components/team_form.d.ts +8 -0
- package/build/screens/conversation_new/components/team_form.d.ts.map +1 -0
- package/build/screens/conversation_new/components/team_form.js +11 -0
- package/build/screens/conversation_new/components/team_form.js.map +1 -0
- package/build/screens/conversation_new/conversation_new_screen.d.ts +15 -0
- package/build/screens/conversation_new/conversation_new_screen.d.ts.map +1 -0
- package/build/screens/conversation_new/conversation_new_screen.js +16 -0
- package/build/screens/conversation_new/conversation_new_screen.js.map +1 -0
- package/build/screens/conversation_screen.d.ts +1 -0
- package/build/screens/conversation_screen.d.ts.map +1 -1
- package/build/screens/conversation_screen.js +1 -1
- 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 +4 -0
- package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.d.ts.map +1 -0
- package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.js +86 -0
- package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.js.map +1 -0
- 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 +22 -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 +35 -11
- package/build/screens/conversations/conversations_screen.js.map +1 -1
- package/build/screens/message_actions_screen.d.ts +2 -2
- package/build/screens/message_actions_screen.d.ts.map +1 -1
- package/build/screens/message_actions_screen.js.map +1 -1
- package/build/screens/send_giphy_screen.d.ts +10 -0
- package/build/screens/send_giphy_screen.d.ts.map +1 -0
- package/build/screens/send_giphy_screen.js +126 -0
- package/build/screens/send_giphy_screen.js.map +1 -0
- 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/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/cache/page_mutations.d.ts +18 -0
- package/build/utils/cache/page_mutations.d.ts.map +1 -1
- package/build/utils/cache/page_mutations.js +13 -0
- package/build/utils/cache/page_mutations.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/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/request/conversation.d.ts +1 -3
- package/build/utils/request/conversation.d.ts.map +1 -1
- package/build/utils/request/conversation.js +37 -30
- package/build/utils/request/conversation.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/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__/utils/cache/page_mutations.ts +49 -15
- 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.tsx +127 -58
- package/src/components/conversations/action_toggle_button.tsx +2 -1
- package/src/components/conversations/conversation_actions.tsx +41 -14
- package/src/components/conversations/conversations.tsx +39 -52
- 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/primitive/banner_primitive.tsx +12 -6
- package/src/contexts/api_provider.tsx +3 -3
- package/src/contexts/chat_context.tsx +13 -6
- package/src/contexts/conversations_context.tsx +69 -0
- package/src/hooks/groups/use_group_members_for_new_conversation.ts +62 -0
- package/src/hooks/groups/use_groups_conversation_create.ts +50 -0
- package/src/hooks/use_api.ts +11 -5
- package/src/hooks/use_api_client.ts +7 -3
- package/src/hooks/use_conversations.ts +34 -16
- package/src/hooks/use_conversations_actions.ts +119 -0
- package/src/hooks/{use_conversation_jolt_events.ts → use_conversations_cache.ts} +35 -20
- package/src/hooks/use_conversations_jolt_events.ts +25 -0
- package/src/hooks/use_current_person.ts +37 -9
- package/src/hooks/use_giphy.ts +97 -0
- package/src/hooks/use_jolt.ts +56 -20
- package/src/hooks/use_message_create.ts +55 -0
- package/src/hooks/use_suspense_api.ts +6 -0
- package/src/index.tsx +2 -1
- package/src/navigation/index.tsx +39 -10
- 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 +120 -0
- 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/hooks/filters.ts +1 -1
- package/src/screens/conversation_new/components/form_list.tsx +67 -0
- package/src/screens/conversation_new/components/groups_form.tsx +163 -0
- package/src/screens/conversation_new/components/source_app_error_card.tsx +24 -0
- package/src/screens/conversation_new/components/team_form.tsx +18 -0
- package/src/screens/conversation_new/conversation_new_screen.tsx +29 -0
- package/src/screens/conversation_screen.tsx +2 -1
- 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 +121 -0
- package/src/screens/conversation_select_recipients/types/screen_props.tsx +11 -0
- package/src/screens/conversations/components/list_header_component.tsx +25 -4
- package/src/screens/conversations/conversations_screen.tsx +39 -17
- package/src/screens/message_actions_screen.tsx +2 -2
- package/src/screens/send_giphy_screen.tsx +184 -0
- 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/oauth_token.ts +4 -4
- package/src/utils/cache/page_mutations.ts +22 -0
- package/src/utils/client/client.ts +13 -13
- package/src/utils/destructure_chat_group_graph_id.ts +25 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/request/conversation.ts +39 -34
- package/src/utils/session.ts +10 -4
- package/src/utils/uri.ts +30 -6
- package/src/vendor/tapestry/alias_tokens_color_map.ts +3 -0
- package/build/contexts/swipeable_active_conversation.d.ts +0 -11
- package/build/contexts/swipeable_active_conversation.d.ts.map +0 -1
- package/build/contexts/swipeable_active_conversation.js +0 -16
- package/build/contexts/swipeable_active_conversation.js.map +0 -1
- package/build/hooks/use_conversation_jolt_events.d.ts +0 -2
- package/build/hooks/use_conversation_jolt_events.d.ts.map +0 -1
- package/build/hooks/use_conversation_jolt_events.js.map +0 -1
- package/build/screens/create/conversation_create_screen.d.ts +0 -9
- package/build/screens/create/conversation_create_screen.d.ts.map +0 -1
- package/build/screens/create/conversation_create_screen.js +0 -122
- package/build/screens/create/conversation_create_screen.js.map +0 -1
- package/build/screens/create/conversation_filter_recipients_screen.d.ts.map +0 -1
- package/build/screens/create/conversation_filter_recipients_screen.js +0 -52
- package/build/screens/create/conversation_filter_recipients_screen.js.map +0 -1
- package/build/screens/create/conversation_select_recipients_screen.d.ts +0 -8
- package/build/screens/create/conversation_select_recipients_screen.d.ts.map +0 -1
- package/build/screens/create/conversation_select_recipients_screen.js +0 -97
- package/build/screens/create/conversation_select_recipients_screen.js.map +0 -1
- package/src/contexts/swipeable_active_conversation.tsx +0 -27
- package/src/screens/create/conversation_create_screen.tsx +0 -151
- package/src/screens/create/conversation_filter_recipients_screen.tsx +0 -79
- package/src/screens/create/conversation_select_recipients_screen.tsx +0 -128
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import React, { createContext, useContext, useState } from 'react'
|
|
2
|
-
|
|
3
|
-
type ConversationActionsValue = {
|
|
4
|
-
activeConversationId?: number
|
|
5
|
-
setActiveConversationId: (_id: number) => void
|
|
6
|
-
}
|
|
7
|
-
const ConversationActionsContext = createContext<ConversationActionsValue>({
|
|
8
|
-
activeConversationId: undefined,
|
|
9
|
-
setActiveConversationId: () => {},
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
export const ConversationActionsProvider = ({ children }: { children: React.ReactNode }) => {
|
|
13
|
-
const [activeConversationId, setActiveConversationId] = useState<number | undefined>()
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<ConversationActionsContext.Provider
|
|
17
|
-
value={{
|
|
18
|
-
activeConversationId,
|
|
19
|
-
setActiveConversationId,
|
|
20
|
-
}}
|
|
21
|
-
>
|
|
22
|
-
{children}
|
|
23
|
-
</ConversationActionsContext.Provider>
|
|
24
|
-
)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export const useConversationActionsContext = () => useContext(ConversationActionsContext)
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import { StackActions, StaticScreenProps, useNavigation } from '@react-navigation/native'
|
|
2
|
-
import React, { useCallback, useState } from 'react'
|
|
3
|
-
import { StyleSheet, TextInput, View } from 'react-native'
|
|
4
|
-
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
5
|
-
import { Text } from '../../components'
|
|
6
|
-
import { ActionButton } from '../../components/display/action_button'
|
|
7
|
-
import { useSuspenseGet, useTheme } from '../../hooks'
|
|
8
|
-
import { useApiClient } from '../../hooks/use_api_client'
|
|
9
|
-
import { useMutation } from '@tanstack/react-query'
|
|
10
|
-
import { ApiResource, ConversationResource, GroupsGroupResource, ResourceObject } from '../../types'
|
|
11
|
-
|
|
12
|
-
type ConversationCreateScreenProps = StaticScreenProps<{
|
|
13
|
-
group_id?: string
|
|
14
|
-
team_ids?: string[]
|
|
15
|
-
}>
|
|
16
|
-
|
|
17
|
-
interface ChatConversationPayload extends ResourceObject {
|
|
18
|
-
value: string
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const ConversationCreateScreen = ({ route }: ConversationCreateScreenProps) => {
|
|
22
|
-
const styles = useStyles()
|
|
23
|
-
const navigation = useNavigation()
|
|
24
|
-
const [title, setTitle] = useState<string>()
|
|
25
|
-
const apiClient = useApiClient()
|
|
26
|
-
const { data: group } = useSuspenseGet<GroupsGroupResource>({
|
|
27
|
-
url: `/me/groups/${route.params.group_id}`,
|
|
28
|
-
data: {
|
|
29
|
-
fields: {
|
|
30
|
-
Group: [],
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
app: 'groups',
|
|
34
|
-
})
|
|
35
|
-
const { mutate: handleSave } = useMutation({
|
|
36
|
-
throwOnError: true,
|
|
37
|
-
onSuccess: result => {
|
|
38
|
-
handleRedirectToConversation({ conversation_id: result.data.id })
|
|
39
|
-
},
|
|
40
|
-
mutationFn: () =>
|
|
41
|
-
apiClient.groups
|
|
42
|
-
.post<ApiResource<ChatConversationPayload>>({
|
|
43
|
-
url: `/me/groups/${route.params.group_id}/chat_conversation_payload`,
|
|
44
|
-
data: {
|
|
45
|
-
data: {
|
|
46
|
-
type: '',
|
|
47
|
-
attributes: {
|
|
48
|
-
title,
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
})
|
|
53
|
-
.then(res => res.data.value)
|
|
54
|
-
.then(payload =>
|
|
55
|
-
apiClient.chat.post<ApiResource<ConversationResource>>({
|
|
56
|
-
url: '/me/conversations',
|
|
57
|
-
data: {
|
|
58
|
-
data: {
|
|
59
|
-
type: 'Conversation',
|
|
60
|
-
attributes: {
|
|
61
|
-
payload,
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
})
|
|
66
|
-
),
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
const handleRedirectToConversation = useCallback(
|
|
70
|
-
({ conversation_id }: { conversation_id: number }) => {
|
|
71
|
-
// exit from the create stack
|
|
72
|
-
navigation.getParent()?.goBack()
|
|
73
|
-
// navigate to the conversation screen
|
|
74
|
-
navigation.dispatch(
|
|
75
|
-
StackActions.push('Conversation', {
|
|
76
|
-
conversation_id,
|
|
77
|
-
})
|
|
78
|
-
)
|
|
79
|
-
},
|
|
80
|
-
[navigation]
|
|
81
|
-
)
|
|
82
|
-
|
|
83
|
-
return (
|
|
84
|
-
<View style={styles.container}>
|
|
85
|
-
<View style={styles.section}>
|
|
86
|
-
<View style={styles.to}>
|
|
87
|
-
<Text>To:</Text>
|
|
88
|
-
<View>
|
|
89
|
-
<Text>{group.name}</Text>
|
|
90
|
-
<Text>{group.membershipsCount} members</Text>
|
|
91
|
-
</View>
|
|
92
|
-
</View>
|
|
93
|
-
<View style={styles.titleContainer}>
|
|
94
|
-
<Text style={styles.titleLabel}>Title</Text>
|
|
95
|
-
<TextInput
|
|
96
|
-
placeholder="Topic of conversation (required)"
|
|
97
|
-
value={title}
|
|
98
|
-
onChangeText={setTitle}
|
|
99
|
-
style={styles.titleInput}
|
|
100
|
-
/>
|
|
101
|
-
</View>
|
|
102
|
-
</View>
|
|
103
|
-
<ActionButton title="Start Conversation" onPress={() => handleSave()} />
|
|
104
|
-
</View>
|
|
105
|
-
)
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
const useStyles = () => {
|
|
109
|
-
const { bottom } = useSafeAreaInsets()
|
|
110
|
-
const theme = useTheme()
|
|
111
|
-
|
|
112
|
-
return StyleSheet.create({
|
|
113
|
-
container: {
|
|
114
|
-
flex: 1,
|
|
115
|
-
gap: 8,
|
|
116
|
-
},
|
|
117
|
-
section: {
|
|
118
|
-
padding: 16,
|
|
119
|
-
flex: 1,
|
|
120
|
-
},
|
|
121
|
-
sectionHeader: {
|
|
122
|
-
flexDirection: 'row',
|
|
123
|
-
justifyContent: 'space-between',
|
|
124
|
-
},
|
|
125
|
-
selectTeamsButton: {},
|
|
126
|
-
routeDebug: {
|
|
127
|
-
alignContent: 'center',
|
|
128
|
-
padding: 16,
|
|
129
|
-
paddingBottom: bottom,
|
|
130
|
-
borderTopWidth: 1,
|
|
131
|
-
borderTopColor: theme.colors.fillColorNeutral050Base,
|
|
132
|
-
},
|
|
133
|
-
titleContainer: {
|
|
134
|
-
paddingVertical: 12,
|
|
135
|
-
borderBottomWidth: 1,
|
|
136
|
-
borderBottomColor: theme.colors.fillColorNeutral050Base,
|
|
137
|
-
gap: 8,
|
|
138
|
-
},
|
|
139
|
-
titleInput: {
|
|
140
|
-
fontSize: 18,
|
|
141
|
-
},
|
|
142
|
-
titleLabel: {},
|
|
143
|
-
to: {
|
|
144
|
-
flexDirection: 'row',
|
|
145
|
-
gap: 8,
|
|
146
|
-
paddingVertical: 12,
|
|
147
|
-
borderBottomWidth: 1,
|
|
148
|
-
borderBottomColor: theme.colors.fillColorNeutral050Base,
|
|
149
|
-
},
|
|
150
|
-
})
|
|
151
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { StackActions, StaticScreenProps, useNavigation } from '@react-navigation/native'
|
|
2
|
-
import { NativeStackNavigationOptions } from '@react-navigation/native-stack'
|
|
3
|
-
import React from 'react'
|
|
4
|
-
import { StyleSheet, View } from 'react-native'
|
|
5
|
-
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
6
|
-
import { Button } from '../../components'
|
|
7
|
-
import { useTheme } from '../../hooks'
|
|
8
|
-
|
|
9
|
-
export const ConversationFilterReceipientsScreenOptions: NativeStackNavigationOptions = {
|
|
10
|
-
presentation: 'formSheet',
|
|
11
|
-
headerShown: false,
|
|
12
|
-
sheetAllowedDetents: [0.75],
|
|
13
|
-
sheetGrabberVisible: true,
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
type ConversationFilterRecipientsScreenProps = StaticScreenProps<{}>
|
|
17
|
-
|
|
18
|
-
export const ConversationFilterRecipientsScreen = ({}: ConversationFilterRecipientsScreenProps) => {
|
|
19
|
-
const styles = useStyles()
|
|
20
|
-
const navigation = useNavigation()
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<View style={styles.container}>
|
|
24
|
-
<View style={styles.section}>
|
|
25
|
-
<Button
|
|
26
|
-
style={styles.selectTeamsButton}
|
|
27
|
-
onPress={() =>
|
|
28
|
-
navigation.dispatch(
|
|
29
|
-
StackActions.popTo('ConversationSelectRecipients', {
|
|
30
|
-
chat_group_graph_id: 'TBD',
|
|
31
|
-
})
|
|
32
|
-
)
|
|
33
|
-
}
|
|
34
|
-
title="Redirect to select"
|
|
35
|
-
variant="outline"
|
|
36
|
-
/>
|
|
37
|
-
|
|
38
|
-
<Button
|
|
39
|
-
style={styles.selectTeamsButton}
|
|
40
|
-
onPress={() =>
|
|
41
|
-
navigation.dispatch(
|
|
42
|
-
StackActions.popTo('ConversationCreate', {
|
|
43
|
-
chat_group_graph_id: 'TBD',
|
|
44
|
-
})
|
|
45
|
-
)
|
|
46
|
-
}
|
|
47
|
-
title="Redirect to form"
|
|
48
|
-
variant="outline"
|
|
49
|
-
/>
|
|
50
|
-
</View>
|
|
51
|
-
</View>
|
|
52
|
-
)
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const useStyles = () => {
|
|
56
|
-
const { bottom } = useSafeAreaInsets()
|
|
57
|
-
const theme = useTheme()
|
|
58
|
-
|
|
59
|
-
return StyleSheet.create({
|
|
60
|
-
container: {
|
|
61
|
-
flex: 1,
|
|
62
|
-
gap: 8,
|
|
63
|
-
},
|
|
64
|
-
section: {
|
|
65
|
-
padding: 16,
|
|
66
|
-
flexDirection: 'row',
|
|
67
|
-
justifyContent: 'space-between',
|
|
68
|
-
flex: 1,
|
|
69
|
-
},
|
|
70
|
-
selectTeamsButton: {},
|
|
71
|
-
routeDebug: {
|
|
72
|
-
alignContent: 'center',
|
|
73
|
-
padding: 16,
|
|
74
|
-
paddingBottom: bottom,
|
|
75
|
-
borderTopWidth: 1,
|
|
76
|
-
borderTopColor: theme.colors.fillColorNeutral050Base,
|
|
77
|
-
},
|
|
78
|
-
})
|
|
79
|
-
}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { PlatformPressable } from '@react-navigation/elements'
|
|
2
|
-
import { StaticScreenProps, useNavigation } from '@react-navigation/native'
|
|
3
|
-
import React from 'react'
|
|
4
|
-
import { ScrollView, StyleSheet, View } from 'react-native'
|
|
5
|
-
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
6
|
-
import { Button, Heading, Icon, Image, Text } from '../../components'
|
|
7
|
-
import { useTheme } from '../../hooks'
|
|
8
|
-
import { GroupsGroupResource } from '../../types'
|
|
9
|
-
import { useGroupsGroups } from '../../hooks/use_groups_groups'
|
|
10
|
-
|
|
11
|
-
type ConversationSelectRecipientsScreenProps = StaticScreenProps<{
|
|
12
|
-
chat_group_graph_id?: string
|
|
13
|
-
}>
|
|
14
|
-
|
|
15
|
-
const ASPECT_RATIO = 16 / 9
|
|
16
|
-
const THUMBNAIL_WIDTH = 80
|
|
17
|
-
const THUMBNAIL_HEIGHT = THUMBNAIL_WIDTH / ASPECT_RATIO
|
|
18
|
-
|
|
19
|
-
export const ConversationSelectRecipientsScreen = ({}: ConversationSelectRecipientsScreenProps) => {
|
|
20
|
-
const styles = useStyles()
|
|
21
|
-
const navigation = useNavigation()
|
|
22
|
-
const { data: groups = [] } = useGroupsGroups()
|
|
23
|
-
const groupsWithCreatePermission = groups.filter(g => g.canCreateConversation)
|
|
24
|
-
|
|
25
|
-
const handleNavigateToCreateConversation = (group: GroupsGroupResource) => {
|
|
26
|
-
navigation.navigate('Create', {
|
|
27
|
-
screen: 'ConversationCreate',
|
|
28
|
-
params: {
|
|
29
|
-
group_id: group.id,
|
|
30
|
-
},
|
|
31
|
-
})
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return (
|
|
35
|
-
<ScrollView style={styles.container}>
|
|
36
|
-
<View style={styles.section}>
|
|
37
|
-
<View style={styles.sectionHeader}>
|
|
38
|
-
<Heading>My groups</Heading>
|
|
39
|
-
</View>
|
|
40
|
-
<View>
|
|
41
|
-
{groupsWithCreatePermission.map(group => (
|
|
42
|
-
<PlatformPressable
|
|
43
|
-
key={group.id}
|
|
44
|
-
style={styles.row}
|
|
45
|
-
onPress={() => handleNavigateToCreateConversation(group)}
|
|
46
|
-
>
|
|
47
|
-
<Image
|
|
48
|
-
source={{ uri: group.headerImage?.thumbnail }}
|
|
49
|
-
resizeMode="cover"
|
|
50
|
-
style={styles.rowImage}
|
|
51
|
-
alt={`Image for ${group.name}`}
|
|
52
|
-
/>
|
|
53
|
-
<View>
|
|
54
|
-
<Heading variant="h3">{group.name}</Heading>
|
|
55
|
-
<Text>{group.membershipsCount} members</Text>
|
|
56
|
-
</View>
|
|
57
|
-
<Icon name="general.rightChevron" size={16} style={styles.rowIconRight} />
|
|
58
|
-
</PlatformPressable>
|
|
59
|
-
))}
|
|
60
|
-
</View>
|
|
61
|
-
</View>
|
|
62
|
-
<View style={styles.section}>
|
|
63
|
-
<View style={styles.sectionHeader}>
|
|
64
|
-
<Heading>Teams I lead</Heading>
|
|
65
|
-
<Button
|
|
66
|
-
style={styles.selectTeamsButton}
|
|
67
|
-
onPress={() =>
|
|
68
|
-
navigation.navigate('Create', {
|
|
69
|
-
screen: 'ConversationFilterRecipients',
|
|
70
|
-
params: {
|
|
71
|
-
conversation_id: '2196252',
|
|
72
|
-
},
|
|
73
|
-
})
|
|
74
|
-
}
|
|
75
|
-
title="Select teams"
|
|
76
|
-
variant="outline"
|
|
77
|
-
iconNameLeft="general.search"
|
|
78
|
-
/>
|
|
79
|
-
</View>
|
|
80
|
-
</View>
|
|
81
|
-
</ScrollView>
|
|
82
|
-
)
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const useStyles = () => {
|
|
86
|
-
const { bottom } = useSafeAreaInsets()
|
|
87
|
-
const theme = useTheme()
|
|
88
|
-
|
|
89
|
-
return StyleSheet.create({
|
|
90
|
-
container: {
|
|
91
|
-
flex: 1,
|
|
92
|
-
gap: 8,
|
|
93
|
-
},
|
|
94
|
-
section: {
|
|
95
|
-
padding: 16,
|
|
96
|
-
flex: 1,
|
|
97
|
-
},
|
|
98
|
-
sectionHeader: {
|
|
99
|
-
flexDirection: 'row',
|
|
100
|
-
justifyContent: 'space-between',
|
|
101
|
-
},
|
|
102
|
-
selectTeamsButton: {},
|
|
103
|
-
row: {
|
|
104
|
-
flexDirection: 'row',
|
|
105
|
-
alignItems: 'center',
|
|
106
|
-
gap: 12,
|
|
107
|
-
paddingVertical: 16,
|
|
108
|
-
borderBottomWidth: 1,
|
|
109
|
-
borderColor: theme.colors.fillColorNeutral050Base,
|
|
110
|
-
},
|
|
111
|
-
rowImage: {
|
|
112
|
-
width: THUMBNAIL_WIDTH,
|
|
113
|
-
height: THUMBNAIL_HEIGHT,
|
|
114
|
-
borderRadius: 4,
|
|
115
|
-
},
|
|
116
|
-
rowIconRight: {
|
|
117
|
-
marginLeft: 'auto',
|
|
118
|
-
color: theme.colors.fillColorNeutral030,
|
|
119
|
-
},
|
|
120
|
-
routeDebug: {
|
|
121
|
-
alignContent: 'center',
|
|
122
|
-
padding: 16,
|
|
123
|
-
paddingBottom: bottom,
|
|
124
|
-
borderTopWidth: 1,
|
|
125
|
-
borderTopColor: theme.colors.fillColorNeutral050Base,
|
|
126
|
-
},
|
|
127
|
-
})
|
|
128
|
-
}
|