@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
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { StaticScreenProps } from '@react-navigation/native';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { AppName } from '../../types/resources/app_name';
|
|
4
|
+
import { GraphId } from '../../types/resources/group_resource';
|
|
5
|
+
type ConversationNewScreenProps = StaticScreenProps<{
|
|
6
|
+
group_id?: number;
|
|
7
|
+
team_ids?: number[];
|
|
8
|
+
plan_id?: number;
|
|
9
|
+
source_app_name: AppName;
|
|
10
|
+
chat_group_graph_id?: GraphId;
|
|
11
|
+
group_source_app_name?: AppName;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const ConversationNewScreen: ({ route }: ConversationNewScreenProps) => React.JSX.Element;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=conversation_new_screen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation_new_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation_new/conversation_new_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAA;AAE9D,KAAK,0BAA0B,GAAG,iBAAiB,CAAC;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,eAAe,EAAE,OAAO,CAAA;IACxB,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC,CAAC,CAAA;AAEF,eAAO,MAAM,qBAAqB,cAAe,0BAA0B,sBAW1E,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { GroupsForm } from './components/groups_form';
|
|
3
|
+
import { TeamsForm } from './components/team_form';
|
|
4
|
+
import { SourceAppErrorCard } from './components/source_app_error_card';
|
|
5
|
+
export const ConversationNewScreen = ({ route }) => {
|
|
6
|
+
const { group_id, team_ids, source_app_name, plan_id } = route.params;
|
|
7
|
+
switch (source_app_name) {
|
|
8
|
+
case 'Groups':
|
|
9
|
+
return group_id ? <GroupsForm groupId={group_id}/> : <SourceAppErrorCard />;
|
|
10
|
+
case 'Services':
|
|
11
|
+
return <TeamsForm initialTeamIds={team_ids} initialPlanId={plan_id}/>;
|
|
12
|
+
default:
|
|
13
|
+
return <SourceAppErrorCard />;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=conversation_new_screen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation_new_screen.js","sourceRoot":"","sources":["../../../src/screens/conversation_new/conversation_new_screen.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAA;AAavE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,EAAE,KAAK,EAA8B,EAAE,EAAE;IAC7E,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,MAAM,CAAA;IAErE,QAAQ,eAAe,EAAE,CAAC;QACxB,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAG,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,AAAD,EAAG,CAAA;QAC9E,KAAK,UAAU;YACb,OAAO,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,EAAG,CAAA;QACxE;YACE,OAAO,CAAC,kBAAkB,CAAC,AAAD,EAAG,CAAA;IACjC,CAAC;AACH,CAAC,CAAA","sourcesContent":["import { StaticScreenProps } from '@react-navigation/native'\nimport React from 'react'\nimport { GroupsForm } from './components/groups_form'\nimport { TeamsForm } from './components/team_form'\nimport { SourceAppErrorCard } from './components/source_app_error_card'\nimport { AppName } from '../../types/resources/app_name'\nimport { GraphId } from '../../types/resources/group_resource'\n\ntype ConversationNewScreenProps = StaticScreenProps<{\n group_id?: number\n team_ids?: number[]\n plan_id?: number\n source_app_name: AppName\n chat_group_graph_id?: GraphId\n group_source_app_name?: AppName\n}>\n\nexport const ConversationNewScreen = ({ route }: ConversationNewScreenProps) => {\n const { group_id, team_ids, source_app_name, plan_id } = route.params\n\n switch (source_app_name) {\n case 'Groups':\n return group_id ? <GroupsForm groupId={group_id} /> : <SourceAppErrorCard />\n case 'Services':\n return <TeamsForm initialTeamIds={team_ids} initialPlanId={plan_id} />\n default:\n return <SourceAppErrorCard />\n }\n}\n"]}
|
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
type ConversationRouteProps = {
|
|
4
4
|
conversation_id: number;
|
|
5
5
|
chat_group_graph_id?: string;
|
|
6
|
+
clear_input?: boolean;
|
|
6
7
|
};
|
|
7
8
|
export type ConversationScreenProps = StaticScreenProps<ConversationRouteProps>;
|
|
8
9
|
export declare function ConversationScreen({ route }: ConversationScreenProps): React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_screen.d.ts","sourceRoot":"","sources":["../../src/screens/conversation_screen.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EAIlB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAiC,MAAM,OAAO,CAAA;AAUrD,KAAK,sBAAsB,GAAG;IAC5B,eAAe,EAAE,MAAM,CAAA;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"conversation_screen.d.ts","sourceRoot":"","sources":["../../src/screens/conversation_screen.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EAIlB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAiC,MAAM,OAAO,CAAA;AAUrD,KAAK,sBAAsB,GAAG;IAC5B,eAAe,EAAE,MAAM,CAAA;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,CAAC,sBAAsB,CAAC,CAAA;AAE/E,wBAAgB,kBAAkB,CAAC,EAAE,KAAK,EAAE,EAAE,uBAAuB,qBA0CpE"}
|
|
@@ -27,7 +27,7 @@ export function ConversationScreen({ route }) {
|
|
|
27
27
|
<FlatList inverted contentContainerStyle={styles.listContainer} refreshing={isRefetching} onRefresh={refetch} data={messages} keyExtractor={item => item.id} renderItem={({ item }) => <Message {...item} conversation_id={conversation_id}/>} onEndReached={() => fetchNextPage()}/>
|
|
28
28
|
<MessageForm.Root conversation={conversation}>
|
|
29
29
|
{/* <MessageForm.AttachmentPicker /> */}
|
|
30
|
-
|
|
30
|
+
<MessageForm.Commands />
|
|
31
31
|
<MessageForm.TextInput />
|
|
32
32
|
<MessageForm.SubmitButton />
|
|
33
33
|
</MessageForm.Root>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_screen.js","sourceRoot":"","sources":["../../src/screens/conversation_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAoB,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC7F,OAAO,EAEL,aAAa,EACb,QAAQ,IAAI,kBAAkB,EAC9B,QAAQ,GACT,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,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MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,eAAe,GAAG,kBAAkB,EAAE,CAAA;IAC5C,MAAM,EAAE,MAAM,EAAE,GAAG,iBAAiB,EAAE,CAAA;IAEtC,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,SAAS,EAAE;YACT,IAAI,EAAE,CAAC;YACP,cAAc,EAAE,QAAQ;YACxB,eAAe,EAAE,eAAe,CAAC,MAAM,CAAC,IAAI;YAC5C,aAAa,EAAE,MAAM;SACtB;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,CAAC;SACR;QACD,aAAa,EAAE;YACb,GAAG,EAAE,EAAE;YACP,iBAAiB,EAAE,EAAE;YACrB,eAAe,EAAE,EAAE;SACpB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { HeaderTitle, HeaderTitleProps, PlatformPressable } from '@react-navigation/elements'\nimport {\n StaticScreenProps,\n useNavigation,\n useTheme as useNavigationTheme,\n useRoute,\n} from '@react-navigation/native'\nimport React, { useCallback, useEffect } from 'react'\nimport { FlatList, Platform, StyleSheet, View } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { Badge, Icon } from '../components'\nimport { Message } from '../components/conversation/message'\nimport { MessageForm } from '../components/conversation/message_form'\nimport { KeyboardView } from '../components/display/keyboard_view'\nimport { useConversation } from '../hooks/use_conversation'\nimport { useConversationMessages } from '../hooks/use_conversation_messages'\n\ntype ConversationRouteProps = {\n conversation_id: number\n chat_group_graph_id?: string\n clear_input?: boolean\n}\n\nexport type ConversationScreenProps = StaticScreenProps<ConversationRouteProps>\n\nexport function ConversationScreen({ route }: ConversationScreenProps) {\n const styles = useStyles()\n const navigation = useNavigation()\n\n const { conversation_id } = route.params\n const { data: conversation } = useConversation(route.params)\n const { messages, refetch, isRefetching, fetchNextPage } = useConversationMessages({\n conversation_id,\n })\n\n // Seems to be necessary to define this way so we get the route picked up\n const headerTitle = useCallback(\n (props: HeaderTitleProps) => <PressableHeaderTitle {...props} />,\n []\n )\n\n useEffect(() => {\n navigation.setOptions({ headerTitle, title: conversation?.title })\n }, [conversation, conversation_id, navigation, headerTitle, conversation?.title])\n\n return (\n <View style={styles.container}>\n <KeyboardView style={styles.keyboardView}>\n <FlatList\n inverted\n contentContainerStyle={styles.listContainer}\n refreshing={isRefetching}\n onRefresh={refetch}\n data={messages}\n keyExtractor={item => item.id}\n renderItem={({ item }) => <Message {...item} conversation_id={conversation_id} />}\n onEndReached={() => fetchNextPage()}\n />\n <MessageForm.Root conversation={conversation}>\n {/* <MessageForm.AttachmentPicker /> */}\n <MessageForm.Commands />\n <MessageForm.TextInput />\n <MessageForm.SubmitButton />\n </MessageForm.Root>\n </KeyboardView>\n </View>\n )\n}\n\nconst PressableHeaderTitle = ({ style, children }: HeaderTitleProps) => {\n const styles = usePressableHeaderStyle()\n const navigation = useNavigation()\n\n const route = useRoute() as ConversationScreenProps['route']\n\n const { data: conversation } = useConversation(route.params)\n const badge = conversation.badges?.[0]\n const resourceType = badge?.pcoResourceType || ''\n const productName = badge?.appName\n const name = badge?.text || undefined\n\n return (\n <PlatformPressable\n style={styles.container}\n onPress={() =>\n navigation.navigate('ConversationDetails', { conversation_id: conversation?.id })\n }\n >\n <View style={styles.titleWrapper}>\n <HeaderTitle style={[styles.title, style]}>{children}</HeaderTitle>\n <Icon name=\"general.downChevron\" size={12} />\n </View>\n <Badge\n variant=\"metaSubtle\"\n productLogoName={productName}\n label={resourceType}\n metaLabel={name}\n style={styles.badge}\n />\n </PlatformPressable>\n )\n}\n\nconst usePressableHeaderStyle = () => {\n return StyleSheet.create({\n container: {\n alignItems: Platform.select({ android: 'flex-start', default: 'center' }),\n },\n titleWrapper: {\n alignItems: 'center',\n columnGap: 4,\n flexDirection: 'row',\n },\n title: {\n padding: 0,\n margin: 0,\n },\n badge: {\n alignSelf: Platform.select({ android: 'flex-start', default: 'center' }),\n marginTop: 2,\n },\n })\n}\n\nconst useStyles = () => {\n const navigationTheme = useNavigationTheme()\n const { bottom } = useSafeAreaInsets()\n\n return StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'center',\n backgroundColor: navigationTheme.colors.card,\n paddingBottom: bottom,\n },\n keyboardView: {\n flex: 1,\n },\n listContainer: {\n gap: 12,\n paddingHorizontal: 16,\n paddingVertical: 12,\n },\n })\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groups_without_chat_disclaimer_row.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversation_select_recipients/components/groups_without_chat_disclaimer_row.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,8BAA8B,mCAQ1C,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Text } from '../../../components';
|
|
2
|
+
import { StyleSheet } from 'react-native';
|
|
3
|
+
export const GroupsWithoutChatDisclaimerRow = () => {
|
|
4
|
+
const styles = useStyles();
|
|
5
|
+
return (<Text variant="footnote" style={styles.disclaimer}>
|
|
6
|
+
*You have additional groups without chat enabled or permissions to start a new conversation.
|
|
7
|
+
</Text>);
|
|
8
|
+
};
|
|
9
|
+
const useStyles = () => {
|
|
10
|
+
return StyleSheet.create({
|
|
11
|
+
disclaimer: {
|
|
12
|
+
paddingHorizontal: 16,
|
|
13
|
+
paddingVertical: 12,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=groups_without_chat_disclaimer_row.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groups_without_chat_disclaimer_row.js","sourceRoot":"","sources":["../../../../src/screens/conversation_select_recipients/components/groups_without_chat_disclaimer_row.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,MAAM,CAAC,MAAM,8BAA8B,GAAG,GAAG,EAAE;IACjD,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAE1B,OAAO,CACL,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAChD;;IACF,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,UAAU,EAAE;YACV,iBAAiB,EAAE,EAAE;YACrB,eAAe,EAAE,EAAE;SACpB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { Text } from '../../../components'\nimport { StyleSheet } from 'react-native'\n\nexport const GroupsWithoutChatDisclaimerRow = () => {\n const styles = useStyles()\n\n return (\n <Text variant=\"footnote\" style={styles.disclaimer}>\n *You have additional groups without chat enabled or permissions to start a new conversation.\n </Text>\n )\n}\n\nconst useStyles = () => {\n return StyleSheet.create({\n disclaimer: {\n paddingHorizontal: 16,\n paddingVertical: 12,\n },\n })\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface RecipientLinkRowProps {
|
|
3
|
+
onPress: () => void;
|
|
4
|
+
accessibilityLabel: string;
|
|
5
|
+
accessibilityHint: string;
|
|
6
|
+
imageUri?: string;
|
|
7
|
+
title: string;
|
|
8
|
+
subtitle: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const RecipientLinkRow: ({ onPress, accessibilityLabel, accessibilityHint, imageUri, title, subtitle, }: RecipientLinkRowProps) => React.JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=recipient_link_row.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recipient_link_row.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversation_select_recipients/components/recipient_link_row.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,UAAU,qBAAqB;IAC7B,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,iBAAiB,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,eAAO,MAAM,gBAAgB,mFAO1B,qBAAqB,sBA2BvB,CAAA"}
|
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
export const RecipientLinkRow = ({ onPress, accessibilityLabel, accessibilityHint, imageUri, title, subtitle, }) => {
|
|
8
|
+
const styles = useStyles();
|
|
9
|
+
return (<PlatformPressable style={styles.row} onPress={onPress} accessibilityRole="link" accessibilityLabel={accessibilityLabel} accessibilityHint={accessibilityHint}>
|
|
10
|
+
<View style={styles.innerContainer}>
|
|
11
|
+
{imageUri && (<Image source={{ uri: imageUri }} resizeMode="cover" style={styles.image} alt=""/>)}
|
|
12
|
+
<View style={styles.content}>
|
|
13
|
+
<Text style={styles.title} numberOfLines={2}>
|
|
14
|
+
{title}
|
|
15
|
+
</Text>
|
|
16
|
+
<Text variant="tertiary" numberOfLines={1}>
|
|
17
|
+
{subtitle}
|
|
18
|
+
</Text>
|
|
19
|
+
</View>
|
|
20
|
+
<Icon name="general.rightChevron" size={16} style={styles.icon}/>
|
|
21
|
+
</View>
|
|
22
|
+
</PlatformPressable>);
|
|
23
|
+
};
|
|
24
|
+
const ASPECT_RATIO = 16 / 9;
|
|
25
|
+
const THUMBNAIL_WIDTH = 80;
|
|
26
|
+
const THUMBNAIL_HEIGHT = THUMBNAIL_WIDTH / ASPECT_RATIO;
|
|
27
|
+
const useStyles = () => {
|
|
28
|
+
const theme = useTheme();
|
|
29
|
+
return StyleSheet.create({
|
|
30
|
+
row: {
|
|
31
|
+
paddingLeft: 16,
|
|
32
|
+
},
|
|
33
|
+
innerContainer: {
|
|
34
|
+
flexDirection: 'row',
|
|
35
|
+
alignItems: 'center',
|
|
36
|
+
gap: 12,
|
|
37
|
+
paddingVertical: 16,
|
|
38
|
+
paddingRight: 16,
|
|
39
|
+
borderBottomWidth: 1,
|
|
40
|
+
borderColor: theme.colors.fillColorNeutral050Base,
|
|
41
|
+
},
|
|
42
|
+
image: {
|
|
43
|
+
width: THUMBNAIL_WIDTH,
|
|
44
|
+
height: THUMBNAIL_HEIGHT,
|
|
45
|
+
borderRadius: 4,
|
|
46
|
+
},
|
|
47
|
+
title: {
|
|
48
|
+
fontWeight: platformFontWeightMedium,
|
|
49
|
+
flexShrink: 1,
|
|
50
|
+
},
|
|
51
|
+
content: {
|
|
52
|
+
flexShrink: 1,
|
|
53
|
+
gap: 2,
|
|
54
|
+
},
|
|
55
|
+
icon: {
|
|
56
|
+
marginLeft: 'auto',
|
|
57
|
+
color: theme.colors.fillColorNeutral030,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=recipient_link_row.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recipient_link_row.js","sourceRoot":"","sources":["../../../../src/screens/conversation_select_recipients/components/recipient_link_row.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AAWz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,CACR;IAAA,EAAE,iBAAiB,CAAC,CACrB,CAAA;AACH,CAAC,CAAA;AAED,MAAM,YAAY,GAAG,EAAE,GAAG,CAAC,CAAA;AAC3B,MAAM,eAAe,GAAG,EAAE,CAAA;AAC1B,MAAM,gBAAgB,GAAG,eAAe,GAAG,YAAY,CAAA;AAEvD,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IAExB,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,GAAG,EAAE;YACH,WAAW,EAAE,EAAE;SAChB;QACD,cAAc,EAAE;YACd,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,EAAE;YACP,eAAe,EAAE,EAAE;YACnB,YAAY,EAAE,EAAE;YAChB,iBAAiB,EAAE,CAAC;YACpB,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,uBAAuB;SAClD;QACD,KAAK,EAAE;YACL,KAAK,EAAE,eAAe;YACtB,MAAM,EAAE,gBAAgB;YACxB,YAAY,EAAE,CAAC;SAChB;QACD,KAAK,EAAE;YACL,UAAU,EAAE,wBAAwB;YACpC,UAAU,EAAE,CAAC;SACd;QACD,OAAO,EAAE;YACP,UAAU,EAAE,CAAC;YACb,GAAG,EAAE,CAAC;SACP;QACD,IAAI,EAAE;YACJ,UAAU,EAAE,MAAM;YAClB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,mBAAmB;SACxC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { PlatformPressable } from '@react-navigation/elements'\nimport React from 'react'\nimport { StyleSheet, View } from 'react-native'\nimport { Icon, Image, Text } from '../../../components'\nimport { useTheme } from '../../../hooks'\nimport { platformFontWeightMedium } from '../../../utils'\n\ninterface RecipientLinkRowProps {\n onPress: () => void\n accessibilityLabel: string\n accessibilityHint: string\n imageUri?: string\n title: string\n subtitle: string\n}\n\nexport const RecipientLinkRow = ({\n onPress,\n accessibilityLabel,\n accessibilityHint,\n imageUri,\n title,\n subtitle,\n}: RecipientLinkRowProps) => {\n const styles = useStyles()\n\n return (\n <PlatformPressable\n style={styles.row}\n onPress={onPress}\n accessibilityRole=\"link\"\n accessibilityLabel={accessibilityLabel}\n accessibilityHint={accessibilityHint}\n >\n <View style={styles.innerContainer}>\n {imageUri && (\n <Image source={{ uri: imageUri }} resizeMode=\"cover\" style={styles.image} alt=\"\" />\n )}\n <View style={styles.content}>\n <Text style={styles.title} numberOfLines={2}>\n {title}\n </Text>\n <Text variant=\"tertiary\" numberOfLines={1}>\n {subtitle}\n </Text>\n </View>\n <Icon name=\"general.rightChevron\" size={16} style={styles.icon} />\n </View>\n </PlatformPressable>\n )\n}\n\nconst ASPECT_RATIO = 16 / 9\nconst THUMBNAIL_WIDTH = 80\nconst THUMBNAIL_HEIGHT = THUMBNAIL_WIDTH / ASPECT_RATIO\n\nconst useStyles = () => {\n const theme = useTheme()\n\n return StyleSheet.create({\n row: {\n paddingLeft: 16,\n },\n innerContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 12,\n paddingVertical: 16,\n paddingRight: 16,\n borderBottomWidth: 1,\n borderColor: theme.colors.fillColorNeutral050Base,\n },\n image: {\n width: THUMBNAIL_WIDTH,\n height: THUMBNAIL_HEIGHT,\n borderRadius: 4,\n },\n title: {\n fontWeight: platformFontWeightMedium,\n flexShrink: 1,\n },\n content: {\n flexShrink: 1,\n gap: 2,\n },\n icon: {\n marginLeft: 'auto',\n color: theme.colors.fillColorNeutral030,\n },\n })\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface ViewMoreLinkRowProps {
|
|
2
|
+
onPress: () => void;
|
|
3
|
+
accessibilityHint: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const ViewMoreLinkRow: ({ accessibilityHint, onPress }: ViewMoreLinkRowProps) => import("react").JSX.Element;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=view_more_link_row.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view_more_link_row.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversation_select_recipients/components/view_more_link_row.tsx"],"names":[],"mappings":"AAGA,UAAU,oBAAoB;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,iBAAiB,EAAE,MAAM,CAAA;CAC1B;AAED,eAAO,MAAM,eAAe,mCAAoC,oBAAoB,gCAUnF,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { StyleSheet, View } from 'react-native';
|
|
2
|
+
import { TextButton } from '../../../components';
|
|
3
|
+
export const ViewMoreLinkRow = ({ accessibilityHint, onPress }) => {
|
|
4
|
+
const styles = useRowStyles();
|
|
5
|
+
return (<View style={[styles.row]}>
|
|
6
|
+
<TextButton onPress={onPress} accessibilityHint={accessibilityHint} accessibilityRole="link">
|
|
7
|
+
View more
|
|
8
|
+
</TextButton>
|
|
9
|
+
</View>);
|
|
10
|
+
};
|
|
11
|
+
const useRowStyles = () => {
|
|
12
|
+
return StyleSheet.create({
|
|
13
|
+
row: {
|
|
14
|
+
flexDirection: 'row',
|
|
15
|
+
alignItems: 'center',
|
|
16
|
+
paddingVertical: 12,
|
|
17
|
+
paddingHorizontal: 16,
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=view_more_link_row.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view_more_link_row.js","sourceRoot":"","sources":["../../../../src/screens/conversation_select_recipients/components/view_more_link_row.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAOhD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,iBAAiB,EAAE,OAAO,EAAwB,EAAE,EAAE;IACtF,MAAM,MAAM,GAAG,YAAY,EAAE,CAAA;IAE7B,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CACxB;MAAA,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAC1F;;MACF,EAAE,UAAU,CACd;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC,CAAA;AAED,MAAM,YAAY,GAAG,GAAG,EAAE;IACxB,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,GAAG,EAAE;YACH,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,eAAe,EAAE,EAAE;YACnB,iBAAiB,EAAE,EAAE;SACtB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { StyleSheet, View } from 'react-native'\nimport { TextButton } from '../../../components'\n\ninterface ViewMoreLinkRowProps {\n onPress: () => void\n accessibilityHint: string\n}\n\nexport const ViewMoreLinkRow = ({ accessibilityHint, onPress }: ViewMoreLinkRowProps) => {\n const styles = useRowStyles()\n\n return (\n <View style={[styles.row]}>\n <TextButton onPress={onPress} accessibilityHint={accessibilityHint} accessibilityRole=\"link\">\n View more\n </TextButton>\n </View>\n )\n}\n\nconst useRowStyles = () => {\n return StyleSheet.create({\n row: {\n flexDirection: 'row',\n alignItems: 'center',\n paddingVertical: 12,\n paddingHorizontal: 16,\n },\n })\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ConversationSelectRecipientsScreenProps } from './types/screen_props';
|
|
3
|
+
export declare const ConversationSelectGroupRecipientsScreen: ({ route, }: ConversationSelectRecipientsScreenProps) => React.JSX.Element;
|
|
4
|
+
//# sourceMappingURL=conversation_select_group_recipients_screen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation_select_group_recipients_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation_select_recipients/conversation_select_group_recipients_screen.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AASzB,OAAO,EAAE,uCAAuC,EAAE,MAAM,sBAAsB,CAAA;AAG9E,eAAO,MAAM,uCAAuC,eAEjD,uCAAuC,sBA+CzC,CAAA"}
|
package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { useNavigation } from '@react-navigation/native';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { StyleSheet, View } from 'react-native';
|
|
4
|
+
import { FlashList } from '@shopify/flash-list';
|
|
5
|
+
import { Heading } from '../../components';
|
|
6
|
+
import { useGroupsGroups } from '../../hooks/use_groups_groups';
|
|
7
|
+
import { pluralize } from '../../utils';
|
|
8
|
+
import { RecipientLinkRow } from './components/recipient_link_row';
|
|
9
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
10
|
+
import { GroupsWithoutChatDisclaimerRow } from './components/groups_without_chat_disclaimer_row';
|
|
11
|
+
export const ConversationSelectGroupRecipientsScreen = ({ route, }) => {
|
|
12
|
+
const styles = useStyles();
|
|
13
|
+
const navigation = useNavigation();
|
|
14
|
+
const { data: groups = [] } = useGroupsGroups();
|
|
15
|
+
const groupsWithCreatePermission = groups.filter(g => g.canCreateConversation);
|
|
16
|
+
const showGroupsDisclaimer = groups.length > groupsWithCreatePermission.length;
|
|
17
|
+
const handleNavigateToConversationNew = (group) => {
|
|
18
|
+
navigation.navigate('New', {
|
|
19
|
+
screen: 'ConversationNew',
|
|
20
|
+
params: {
|
|
21
|
+
group_id: group.id,
|
|
22
|
+
source_app_name: 'Groups',
|
|
23
|
+
...route.params,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
return (<FlashList data={groupsWithCreatePermission} keyExtractor={item => item.id.toString()} estimatedItemSize={65} contentContainerStyle={styles.contentContainer} ListHeaderComponent={<View style={styles.sectionHeader}>
|
|
28
|
+
<Heading variant="h3">All my groups</Heading>
|
|
29
|
+
</View>} renderItem={({ item: group }) => {
|
|
30
|
+
const groupAccessibilityLabel = `Select ${group.name} with ${pluralize(group.membershipsCount, 'member')}`;
|
|
31
|
+
return (<RecipientLinkRow key={group.id} imageUri={group.headerImage?.thumbnail} title={group.name} subtitle={`${group.membershipsCount} members`} onPress={() => handleNavigateToConversationNew(group)} accessibilityLabel={groupAccessibilityLabel} accessibilityHint={`Selects group as recipient and navigates to the final screen to finish creating the conversation`}/>);
|
|
32
|
+
}} ListFooterComponent={showGroupsDisclaimer ? <GroupsWithoutChatDisclaimerRow /> : null}/>);
|
|
33
|
+
};
|
|
34
|
+
const useStyles = () => {
|
|
35
|
+
const { bottom } = useSafeAreaInsets();
|
|
36
|
+
return StyleSheet.create({
|
|
37
|
+
contentContainer: {
|
|
38
|
+
paddingBottom: bottom,
|
|
39
|
+
},
|
|
40
|
+
sectionHeader: {
|
|
41
|
+
flexDirection: 'row',
|
|
42
|
+
justifyContent: 'space-between',
|
|
43
|
+
padding: 16,
|
|
44
|
+
paddingBottom: 4,
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=conversation_select_group_recipients_screen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation_select_group_recipients_screen.js","sourceRoot":"","sources":["../../../src/screens/conversation_select_recipients/conversation_select_group_recipients_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAE1C,OAAO,EAAE,eAAe,E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KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { useNavigation } from '@react-navigation/native'\nimport React from 'react'\nimport { StyleSheet, View } from 'react-native'\nimport { FlashList } from '@shopify/flash-list'\nimport { Heading } from '../../components'\nimport { GroupsGroupResource } from '../../types'\nimport { useGroupsGroups } from '../../hooks/use_groups_groups'\nimport { pluralize } from '../../utils'\nimport { RecipientLinkRow } from './components/recipient_link_row'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { ConversationSelectRecipientsScreenProps } from './types/screen_props'\nimport { GroupsWithoutChatDisclaimerRow } from './components/groups_without_chat_disclaimer_row'\n\nexport const ConversationSelectGroupRecipientsScreen = ({\n route,\n}: ConversationSelectRecipientsScreenProps) => {\n const styles = useStyles()\n const navigation = useNavigation()\n const { data: groups = [] } = useGroupsGroups()\n const groupsWithCreatePermission = groups.filter(g => g.canCreateConversation)\n const showGroupsDisclaimer = groups.length > groupsWithCreatePermission.length\n\n const handleNavigateToConversationNew = (group: GroupsGroupResource) => {\n navigation.navigate('New', {\n screen: 'ConversationNew',\n params: {\n group_id: group.id,\n source_app_name: 'Groups',\n ...route.params,\n },\n })\n }\n\n return (\n <FlashList\n data={groupsWithCreatePermission}\n keyExtractor={item => item.id.toString()}\n estimatedItemSize={65}\n contentContainerStyle={styles.contentContainer}\n ListHeaderComponent={\n <View style={styles.sectionHeader}>\n <Heading variant=\"h3\">All my groups</Heading>\n </View>\n }\n renderItem={({ item: group }: { item: GroupsGroupResource }) => {\n const groupAccessibilityLabel = `Select ${group.name} with ${pluralize(group.membershipsCount, 'member')}`\n\n return (\n <RecipientLinkRow\n key={group.id}\n imageUri={group.headerImage?.thumbnail}\n title={group.name}\n subtitle={`${group.membershipsCount} members`}\n onPress={() => handleNavigateToConversationNew(group)}\n accessibilityLabel={groupAccessibilityLabel}\n accessibilityHint={`Selects group as recipient and navigates to the final screen to finish creating the conversation`}\n />\n )\n }}\n ListFooterComponent={showGroupsDisclaimer ? <GroupsWithoutChatDisclaimerRow /> : null}\n />\n )\n}\n\nconst useStyles = () => {\n const { bottom } = useSafeAreaInsets()\n\n return StyleSheet.create({\n contentContainer: {\n paddingBottom: bottom,\n },\n sectionHeader: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n padding: 16,\n paddingBottom: 4,\n },\n })\n}\n"]}
|
package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ConversationSelectRecipientsScreenProps } from './types/screen_props';
|
|
3
|
+
export declare const ConversationSelectRecipientsScreen: ({ route, }: ConversationSelectRecipientsScreenProps) => React.JSX.Element;
|
|
4
|
+
//# sourceMappingURL=conversation_select_recipients_screen.d.ts.map
|
package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation_select_recipients_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation_select_recipients/conversation_select_recipients_screen.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,OAAO,EAAE,uCAAuC,EAAE,MAAM,sBAAsB,CAAA;AAK9E,eAAO,MAAM,kCAAkC,eAE5C,uCAAuC,sBAkFzC,CAAA"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { useNavigation } from '@react-navigation/native';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ScrollView, StyleSheet, View } from 'react-native';
|
|
4
|
+
import { Button, Heading } from '../../components';
|
|
5
|
+
import { useGroupsGroups } from '../../hooks/use_groups_groups';
|
|
6
|
+
import { pluralize } from '../../utils';
|
|
7
|
+
import { RecipientLinkRow } from './components/recipient_link_row';
|
|
8
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
9
|
+
import { ViewMoreLinkRow } from './components/view_more_link_row';
|
|
10
|
+
import { GroupsWithoutChatDisclaimerRow } from './components/groups_without_chat_disclaimer_row';
|
|
11
|
+
const MAX_VISIBLE_GROUPS = 5;
|
|
12
|
+
export const ConversationSelectRecipientsScreen = ({ route, }) => {
|
|
13
|
+
const styles = useStyles();
|
|
14
|
+
const navigation = useNavigation();
|
|
15
|
+
const { data: groups = [] } = useGroupsGroups();
|
|
16
|
+
const groupsWithCreatePermission = groups.filter(g => g.canCreateConversation);
|
|
17
|
+
const visibleGroups = groupsWithCreatePermission.slice(0, MAX_VISIBLE_GROUPS);
|
|
18
|
+
const hasMoreGroups = groupsWithCreatePermission.length > MAX_VISIBLE_GROUPS;
|
|
19
|
+
const hasGroupsWithoutChatPermission = groups.length > groupsWithCreatePermission.length;
|
|
20
|
+
const showGroupsDisclaimer = hasGroupsWithoutChatPermission && !hasMoreGroups;
|
|
21
|
+
const handleNavigateToConversationNew = (group) => {
|
|
22
|
+
navigation.navigate('New', {
|
|
23
|
+
screen: 'ConversationNew',
|
|
24
|
+
params: {
|
|
25
|
+
group_id: group.id,
|
|
26
|
+
source_app_name: 'Groups',
|
|
27
|
+
...route.params,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
const handleGroupsViewMore = () => {
|
|
32
|
+
navigation.navigate('New', {
|
|
33
|
+
screen: 'ConversationSelectGroupRecipients',
|
|
34
|
+
params: {
|
|
35
|
+
...route.params,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
return (<ScrollView contentContainerStyle={styles.contentContainer}>
|
|
40
|
+
<View style={styles.section}>
|
|
41
|
+
<View style={styles.sectionHeader}>
|
|
42
|
+
<Heading variant="h3">My groups</Heading>
|
|
43
|
+
</View>
|
|
44
|
+
<View>
|
|
45
|
+
{visibleGroups.map(group => {
|
|
46
|
+
const groupAccessibilityLabel = `Select ${group.name} with ${pluralize(group.membershipsCount, 'member')}`;
|
|
47
|
+
return (<RecipientLinkRow key={group.id} imageUri={group.headerImage?.thumbnail} title={group.name} subtitle={`${group.membershipsCount} members`} onPress={() => handleNavigateToConversationNew(group)} accessibilityLabel={groupAccessibilityLabel} accessibilityHint={`Selects group as recipient and navigates to the final screen to finish creating the conversation`}/>);
|
|
48
|
+
})}
|
|
49
|
+
{hasMoreGroups && (<ViewMoreLinkRow onPress={handleGroupsViewMore} accessibilityHint="Navigate to a full list of your groups."/>)}
|
|
50
|
+
{showGroupsDisclaimer && <GroupsWithoutChatDisclaimerRow />}
|
|
51
|
+
</View>
|
|
52
|
+
</View>
|
|
53
|
+
<View style={styles.section}>
|
|
54
|
+
<View style={styles.sectionHeader}>
|
|
55
|
+
<Heading variant="h3">Teams I lead</Heading>
|
|
56
|
+
<Button style={styles.selectTeamsButton} onPress={() => navigation.navigate('New', {
|
|
57
|
+
screen: 'ConversationFilterRecipients',
|
|
58
|
+
params: {
|
|
59
|
+
source_app_name: 'Services',
|
|
60
|
+
},
|
|
61
|
+
})} title="Select teams" variant="outline" iconNameLeft="general.search"/>
|
|
62
|
+
</View>
|
|
63
|
+
</View>
|
|
64
|
+
</ScrollView>);
|
|
65
|
+
};
|
|
66
|
+
const useStyles = () => {
|
|
67
|
+
const { bottom } = useSafeAreaInsets();
|
|
68
|
+
return StyleSheet.create({
|
|
69
|
+
contentContainer: {
|
|
70
|
+
gap: 24,
|
|
71
|
+
paddingTop: 16,
|
|
72
|
+
paddingBottom: 16 + bottom,
|
|
73
|
+
},
|
|
74
|
+
section: {
|
|
75
|
+
flex: 1,
|
|
76
|
+
},
|
|
77
|
+
sectionHeader: {
|
|
78
|
+
flexDirection: 'row',
|
|
79
|
+
justifyContent: 'space-between',
|
|
80
|
+
paddingHorizontal: 16,
|
|
81
|
+
paddingBottom: 4,
|
|
82
|
+
},
|
|
83
|
+
selectTeamsButton: {},
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
//# sourceMappingURL=conversation_select_recipients_screen.js.map
|
package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation_select_recipients_screen.js","sourceRoot":"","sources":["../../../src/screens/conversation_select_recipients/conversation_select_recipients_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAElD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAElE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AACjE,OAAO,EAAE,8BAA8B,EAAE,MAAM,iDAAiD,CAAA;AAChG,MAAM,kBAAkB,GAAG,CAAC,CAAA;AAE5B,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,EACjD,KAAK,GACmC,EAAE,EAAE;IAC5C,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,UAAU,GAAG,aAAa,EAAE,CAAA;IAClC,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,EAAE,EAAE,GAAG,eAAe,EAAE,CAAA;IAC/C,MAAM,0BAA0B,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAA;IAC9E,MAAM,aAAa,GAAG,0BAA0B,CAAC,KAAK,CAAC,CAAC,EAAE,kBAAkB,CAAC,CAAA;IAC7E,MAAM,aAAa,GAAG,0BAA0B,CAAC,MAAM,GAAG,kBAAkB,CAAA;IAC5E,MAAM,8BAA8B,GAAG,MAAM,CAAC,MAAM,GAAG,0BAA0B,CAAC,M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BAAiB,EAAE,CAAA;IAEtC,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,gBAAgB,EAAE;YAChB,GAAG,EAAE,EAAE;YACP,UAAU,EAAE,EAAE;YACd,aAAa,EAAE,EAAE,GAAG,MAAM;SAC3B;QACD,OAAO,EAAE;YACP,IAAI,EAAE,CAAC;SACR;QACD,aAAa,EAAE;YACb,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,eAAe;YAC/B,iBAAiB,EAAE,EAAE;YACrB,aAAa,EAAE,CAAC;SACjB;QACD,iBAAiB,EAAE,EAAE;KACtB,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { useNavigation } from '@react-navigation/native'\nimport React from 'react'\nimport { ScrollView, StyleSheet, View } from 'react-native'\nimport { Button, Heading } from '../../components'\nimport { GroupsGroupResource } from '../../types'\nimport { useGroupsGroups } from '../../hooks/use_groups_groups'\nimport { pluralize } from '../../utils'\nimport { RecipientLinkRow } from './components/recipient_link_row'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { ConversationSelectRecipientsScreenProps } from './types/screen_props'\nimport { ViewMoreLinkRow } from './components/view_more_link_row'\nimport { GroupsWithoutChatDisclaimerRow } from './components/groups_without_chat_disclaimer_row'\nconst MAX_VISIBLE_GROUPS = 5\n\nexport const ConversationSelectRecipientsScreen = ({\n route,\n}: ConversationSelectRecipientsScreenProps) => {\n const styles = useStyles()\n const navigation = useNavigation()\n const { data: groups = [] } = useGroupsGroups()\n const groupsWithCreatePermission = groups.filter(g => g.canCreateConversation)\n const visibleGroups = groupsWithCreatePermission.slice(0, MAX_VISIBLE_GROUPS)\n const hasMoreGroups = groupsWithCreatePermission.length > MAX_VISIBLE_GROUPS\n const hasGroupsWithoutChatPermission = groups.length > groupsWithCreatePermission.length\n const showGroupsDisclaimer = hasGroupsWithoutChatPermission && !hasMoreGroups\n\n const handleNavigateToConversationNew = (group: GroupsGroupResource) => {\n navigation.navigate('New', {\n screen: 'ConversationNew',\n params: {\n group_id: group.id,\n source_app_name: 'Groups',\n ...route.params,\n },\n })\n }\n\n const handleGroupsViewMore = () => {\n navigation.navigate('New', {\n screen: 'ConversationSelectGroupRecipients',\n params: {\n ...route.params,\n },\n })\n }\n\n return (\n <ScrollView contentContainerStyle={styles.contentContainer}>\n <View style={styles.section}>\n <View style={styles.sectionHeader}>\n <Heading variant=\"h3\">My groups</Heading>\n </View>\n <View>\n {visibleGroups.map(group => {\n const groupAccessibilityLabel = `Select ${group.name} with ${pluralize(group.membershipsCount, 'member')}`\n\n return (\n <RecipientLinkRow\n key={group.id}\n imageUri={group.headerImage?.thumbnail}\n title={group.name}\n subtitle={`${group.membershipsCount} members`}\n onPress={() => handleNavigateToConversationNew(group)}\n accessibilityLabel={groupAccessibilityLabel}\n accessibilityHint={`Selects group as recipient and navigates to the final screen to finish creating the conversation`}\n />\n )\n })}\n {hasMoreGroups && (\n <ViewMoreLinkRow\n onPress={handleGroupsViewMore}\n accessibilityHint=\"Navigate to a full list of your groups.\"\n />\n )}\n {showGroupsDisclaimer && <GroupsWithoutChatDisclaimerRow />}\n </View>\n </View>\n <View style={styles.section}>\n <View style={styles.sectionHeader}>\n <Heading variant=\"h3\">Teams I lead</Heading>\n <Button\n style={styles.selectTeamsButton}\n onPress={() =>\n navigation.navigate('New', {\n screen: 'ConversationFilterRecipients',\n params: {\n source_app_name: 'Services',\n },\n })\n }\n title=\"Select teams\"\n variant=\"outline\"\n iconNameLeft=\"general.search\"\n />\n </View>\n </View>\n </ScrollView>\n )\n}\n\nconst useStyles = () => {\n const { bottom } = useSafeAreaInsets()\n\n return StyleSheet.create({\n contentContainer: {\n gap: 24,\n paddingTop: 16,\n paddingBottom: 16 + bottom,\n },\n section: {\n flex: 1,\n },\n sectionHeader: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n paddingHorizontal: 16,\n paddingBottom: 4,\n },\n selectTeamsButton: {},\n })\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { StaticScreenProps } from '@react-navigation/native';
|
|
2
|
+
import { AppName } from '../../../types/resources/app_name';
|
|
3
|
+
import { GraphId } from '../../../types/resources/group_resource';
|
|
4
|
+
export type ConversationSelectRecipientsParams = {
|
|
5
|
+
chat_group_graph_id?: GraphId;
|
|
6
|
+
group_source_app_name?: AppName;
|
|
7
|
+
};
|
|
8
|
+
export type ConversationSelectRecipientsScreenProps = StaticScreenProps<ConversationSelectRecipientsParams>;
|
|
9
|
+
//# sourceMappingURL=screen_props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screen_props.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversation_select_recipients/types/screen_props.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAA;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAA;AAEjE,MAAM,MAAM,kCAAkC,GAAG;IAC/C,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC,CAAA;AAED,MAAM,MAAM,uCAAuC,GACjD,iBAAiB,CAAC,kCAAkC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screen_props.js","sourceRoot":"","sources":["../../../../src/screens/conversation_select_recipients/types/screen_props.tsx"],"names":[],"mappings":"","sourcesContent":["import { StaticScreenProps } from '@react-navigation/native'\nimport { AppName } from '../../../types/resources/app_name'\nimport { GraphId } from '../../../types/resources/group_resource'\n\nexport type ConversationSelectRecipientsParams = {\n chat_group_graph_id?: GraphId\n group_source_app_name?: AppName\n}\n\nexport type ConversationSelectRecipientsScreenProps =\n StaticScreenProps<ConversationSelectRecipientsParams>\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list_header_component.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversations/components/list_header_component.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"list_header_component.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversations/components/list_header_component.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+B,MAAM,OAAO,CAAA;AAgBnD,eAAO,MAAM,mBAAmB,yBAyG/B,CAAA"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { useNavigation, useRoute } from '@react-navigation/native';
|
|
2
|
-
import React, { useMemo } from 'react';
|
|
3
|
-
import { StyleSheet, View } from 'react-native';
|
|
2
|
+
import React, { useCallback, useMemo } from 'react';
|
|
3
|
+
import { Alert, StyleSheet, View } from 'react-native';
|
|
4
4
|
import { Heading, TextButton, ToggleButton } from '../../../components';
|
|
5
|
-
import { useTheme } from '../../../hooks';
|
|
5
|
+
import { useCurrentPerson, useCurrentPersonCache, useTheme } from '../../../hooks';
|
|
6
|
+
import { useMarkAllRead } from '../../../hooks/use_conversations_actions';
|
|
6
7
|
import { useCanDisplayGroups } from '../../../hooks/use_groups';
|
|
7
8
|
import { ChatGroupBadge } from './chat_group_badge';
|
|
8
9
|
var FilterTypes;
|
|
@@ -19,6 +20,9 @@ export const ListHeaderComponent = () => {
|
|
|
19
20
|
const canFilterByGroups = useCanDisplayGroups({ source_app_name: 'Groups', source_type: 'Group' });
|
|
20
21
|
const route = useRoute();
|
|
21
22
|
const { chat_group_graph_id, group_source_app_name = '' } = route.params || {};
|
|
23
|
+
const { unreadCount } = useCurrentPerson();
|
|
24
|
+
const currentPersonCache = useCurrentPersonCache();
|
|
25
|
+
const { markAllRead, isPending } = useMarkAllRead();
|
|
22
26
|
const active = useMemo(() => {
|
|
23
27
|
if (chat_group_graph_id) {
|
|
24
28
|
return FilterTypes.More;
|
|
@@ -31,13 +35,27 @@ export const ListHeaderComponent = () => {
|
|
|
31
35
|
}
|
|
32
36
|
return FilterTypes.All;
|
|
33
37
|
}, [chat_group_graph_id, group_source_app_name]);
|
|
38
|
+
const handleMarkAllRead = useCallback(() => {
|
|
39
|
+
currentPersonCache.update({ unreadCount: 0 });
|
|
40
|
+
markAllRead();
|
|
41
|
+
}, [currentPersonCache, markAllRead]);
|
|
42
|
+
const alertMarkAllRead = useCallback(() => {
|
|
43
|
+
if (active === FilterTypes.All)
|
|
44
|
+
return handleMarkAllRead();
|
|
45
|
+
Alert.alert('Mark all read', 'This includes conversations not shown by the current filter.', [
|
|
46
|
+
{ text: 'Cancel' },
|
|
47
|
+
{ text: 'OK', onPress: () => handleMarkAllRead() },
|
|
48
|
+
]);
|
|
49
|
+
}, [active, handleMarkAllRead]);
|
|
34
50
|
const showAppFilters = canFilterByGroups && canFilterByTeams;
|
|
35
51
|
return (<View style={styles.listHeader}>
|
|
36
52
|
<View style={styles.titleRow}>
|
|
37
53
|
<Heading numberOfLines={1} variant="h2">
|
|
38
54
|
Conversations
|
|
39
55
|
</Heading>
|
|
40
|
-
<TextButton
|
|
56
|
+
<TextButton onPress={alertMarkAllRead} disabled={isPending || !unreadCount}>
|
|
57
|
+
Mark all read
|
|
58
|
+
</TextButton>
|
|
41
59
|
</View>
|
|
42
60
|
<View style={styles.filterRow}>
|
|
43
61
|
{showAppFilters && (<>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list_header_component.js","sourceRoot":"","sources":["../../../../src/screens/conversations/components/list_header_component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,aAAa,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAC7E,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"list_header_component.js","sourceRoot":"","sources":["../../../../src/screens/conversations/components/list_header_component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,aAAa,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAC7E,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACnD,OAAO,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CACH,CAAC,CACD,kBAAkB,CAAC,8BAA8B,EAErD;UAAA,GAAG,CACJ,CACD;QAAA,CAAC,YAAY,CACX,KAAK,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CACpD,OAAO,CAAC,CAAC,GAAG,EAAE,CACZ,UAAU,CAAC,QAAQ,CAAC,qBAAqB,EAAE;YACzC,mBAAmB;YACnB,qBAAqB;SACtB,CACH,CAAC,CACD,MAAM,CAAC,CAAC,MAAM,KAAK,WAAW,CAAC,IAAI,CAAC,CACpC,aAAa,CAAC,qCAAqC,CACnD,kBAAkB,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,mBAAmB,CAAC,EAElF;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,cAAc,CAAC,AAAD,EACjB;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IACxB,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,UAAU,EAAE;YACV,iBAAiB,EAAE,CAAC;YACpB,iBAAiB,EAAE,KAAK,CAAC,MAAM,CAAC,uBAAuB;YACvD,iBAAiB,EAAE,EAAE;YACrB,aAAa,EAAE,EAAE;YACjB,GAAG,EAAE,EAAE;SACR;QACD,QAAQ,EAAE;YACR,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,eAAe;YAC/B,UAAU,EAAE,CAAC;SACd;QACD,SAAS,EAAE;YACT,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,YAAY;YAC5B,GAAG,EAAE,CAAC;SACP;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { RouteProp, useNavigation, useRoute } from '@react-navigation/native'\nimport React, { useCallback, useMemo } from 'react'\nimport { Alert, StyleSheet, View } from 'react-native'\nimport { Heading, TextButton, ToggleButton } from '../../../components'\nimport { useCurrentPerson, useCurrentPersonCache, useTheme } from '../../../hooks'\nimport { useMarkAllRead } from '../../../hooks/use_conversations_actions'\nimport { useCanDisplayGroups } from '../../../hooks/use_groups'\nimport { ConversationScreenProps } from '../conversations_screen'\nimport { ChatGroupBadge } from './chat_group_badge'\n\nenum FilterTypes {\n All = 'All',\n Groups = 'Groups',\n Teams = 'Teams',\n More = 'More',\n}\n\nexport const ListHeaderComponent = () => {\n const styles = useStyles()\n const navigation = useNavigation()\n const canFilterByTeams = useCanDisplayGroups({ source_app_name: 'Services', source_type: 'Team' })\n const canFilterByGroups = useCanDisplayGroups({ source_app_name: 'Groups', source_type: 'Group' })\n const route = useRoute<RouteProp<ConversationScreenProps['route']>>()\n const { chat_group_graph_id, group_source_app_name = '' } = route.params || {}\n\n const { unreadCount } = useCurrentPerson()\n const currentPersonCache = useCurrentPersonCache()\n const { markAllRead, isPending } = useMarkAllRead()\n\n const active: FilterTypes = useMemo(() => {\n if (chat_group_graph_id) {\n return FilterTypes.More\n } else if (/groups/i.test(group_source_app_name)) {\n return FilterTypes.Groups\n } else if (/services/i.test(group_source_app_name)) {\n return FilterTypes.Teams\n }\n\n return FilterTypes.All\n }, [chat_group_graph_id, group_source_app_name])\n\n const handleMarkAllRead = useCallback(() => {\n currentPersonCache.update({ unreadCount: 0 })\n markAllRead()\n }, [currentPersonCache, markAllRead])\n\n const alertMarkAllRead = useCallback(() => {\n if (active === FilterTypes.All) return handleMarkAllRead()\n\n Alert.alert('Mark all read', 'This includes conversations not shown by the current filter.', [\n { text: 'Cancel' },\n { text: 'OK', onPress: () => handleMarkAllRead() },\n ])\n }, [active, handleMarkAllRead])\n\n const showAppFilters = canFilterByGroups && canFilterByTeams\n\n return (\n <View style={styles.listHeader}>\n <View style={styles.titleRow}>\n <Heading numberOfLines={1} variant=\"h2\">\n Conversations\n </Heading>\n <TextButton onPress={alertMarkAllRead} disabled={isPending || !unreadCount}>\n Mark all read\n </TextButton>\n </View>\n <View style={styles.filterRow}>\n {showAppFilters && (\n <>\n <ToggleButton\n title={FilterTypes.All}\n active={active === FilterTypes.All}\n onPress={() =>\n navigation.setParams({\n chat_group_graph_id: undefined,\n group_source_app_name: undefined,\n })\n }\n accessibilityLabel=\"Show all conversations\"\n />\n <ToggleButton\n title={FilterTypes.Groups}\n active={active === FilterTypes.Groups}\n onPress={() =>\n navigation.setParams({\n chat_group_graph_id: undefined,\n group_source_app_name: 'Groups',\n })\n }\n accessibilityLabel=\"Filter to group conversations\"\n />\n\n <ToggleButton\n title={FilterTypes.Teams}\n active={active === FilterTypes.Teams}\n onPress={() =>\n navigation.setParams({\n chat_group_graph_id: undefined,\n group_source_app_name: 'Services',\n })\n }\n accessibilityLabel=\"Filter to team conversations\"\n />\n </>\n )}\n <ToggleButton\n title={showAppFilters ? FilterTypes.More : 'Filter'}\n onPress={() =>\n navigation.navigate('ConversationFilters', {\n chat_group_graph_id,\n group_source_app_name,\n })\n }\n active={active === FilterTypes.More}\n iconNameRight=\"general.threeReducingHorizontalBars\"\n accessibilityLabel={showAppFilters ? 'View all filters' : 'View more filters'}\n />\n </View>\n <ChatGroupBadge />\n </View>\n )\n}\n\nconst useStyles = () => {\n const theme = useTheme()\n return StyleSheet.create({\n listHeader: {\n borderBottomWidth: 1,\n borderBottomColor: theme.colors.fillColorNeutral050Base,\n paddingHorizontal: 16,\n paddingBottom: 16,\n gap: 12,\n },\n titleRow: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n paddingTop: 8,\n },\n filterRow: {\n flexDirection: 'row',\n justifyContent: 'flex-start',\n gap: 8,\n },\n })\n}\n"]}
|