@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/navigation/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAE7D,OAAO,EACL,0BAA0B,GAE3B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAA;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAA;AACnF,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAA;AACvF,OAAO,EACL,0CAA0C,EAC1C,kCAAkC,GACnC,MAAM,yDAAyD,CAAA;AAChE,OAAO,EAAE,kCAAkC,EAAE,MAAM,yDAAyD,CAAA;AAC5G,OAAO,EACL,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EACL,yBAAyB,EACzB,gCAAgC,GACjC,MAAM,wCAAwC,CAAA;AAG/C,MAAM,CAAC,MAAM,uBAAuB,GAAG,0BAA0B,CAAC;IAChE,gBAAgB,EAAE,8BAA8B;IAChD,aAAa,EAAE;QACb,2BAA2B,EAAE,SAAS;KACvC;IACD,YAAY,EAAE,YAAY;IAC1B,OAAO,EAAE;QACP,4BAA4B,EAAE;YAC5B,MAAM,EAAE,kCAAkC;Y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ACD,SAAS,EAAE;YACT,MAAM,EAAE,eAAe;YACvB,OAAO,EAAE,sBAAsB;SAChC;QACD,QAAQ,EAAE;YACR,MAAM,EAAE,QAAQ;YAChB,OAAO,EAAE;gBACP,KAAK,EAAE,KAAK;aACb;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,GAAG;aACV;SACF;KACF;CACF,CAAC,CAAA","sourcesContent":["import { HeaderBackButton } from '@react-navigation/elements'\nimport { StaticParamList } from '@react-navigation/native'\nimport {\n createNativeStackNavigator,\n NativeStackHeaderRightProps,\n} from '@react-navigation/native-stack'\nimport React from 'react'\nimport { Icon } from '../components'\nimport { ConversationDetailsScreen } from '../screens/conversation_details_screen'\nimport { ConversationScreen } from '../screens/conversation_screen'\nimport { ConversationsScreen } from '../screens/conversations/conversations_screen'\nimport { ConversationCreateScreen } from '../screens/create/conversation_create_screen'\nimport {\n ConversationFilterReceipientsScreenOptions,\n ConversationFilterRecipientsScreen,\n} from '../screens/create/conversation_filter_recipients_screen'\nimport { ConversationSelectRecipientsScreen } from '../screens/create/conversation_select_recipients_screen'\nimport {\n MessageActionsScreen,\n MessageActionsScreenOptions,\n} from '../screens/message_actions_screen'\nimport { NotFound } from '../screens/not_found'\nimport { ReactionsScreen, ReactionsScreenOptions } from '../screens/reactions_screen'\nimport { HeaderRightButton } from './header'\nimport { ScreenLayout } from './screenLayout'\nimport {\n ConversationFiltersScreen,\n ConversationFiltersScreenOptions,\n} from '../screens/conversation_filters_screen'\nimport { ConversationFiltersParams } from '../screens/conversation_filters/screen_props'\n\nexport const CreateConversationStack = createNativeStackNavigator({\n initialRouteName: 'ConversationSelectRecipients',\n screenOptions: {\n headerBackButtonDisplayMode: 'minimal',\n },\n screenLayout: ScreenLayout,\n screens: {\n ConversationSelectRecipients: {\n screen: ConversationSelectRecipientsScreen,\n options: ({ navigation }) => ({\n title: 'New conversation',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton {...props} onPress={navigation.goBack}>\n Cancel\n </HeaderRightButton>\n ),\n }),\n },\n ConversationFilterRecipients: {\n screen: ConversationFilterRecipientsScreen,\n options: ConversationFilterReceipientsScreenOptions,\n },\n ConversationCreate: {\n screen: ConversationCreateScreen,\n options: {\n title: 'New conversation',\n headerLeft: () => null,\n },\n },\n },\n})\n\nexport const ChatStack = createNativeStackNavigator({\n screenOptions: {\n headerBackButtonDisplayMode: 'minimal',\n },\n screenLayout: ScreenLayout,\n screens: {\n Conversations: {\n screen: ConversationsScreen,\n options: ({ route, navigation }) => ({\n headerTitle: (route.params as { title?: string })?.title ?? 'Chat',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderBackButton\n backImage={() => <Icon name=\"general.x\" size={18} color={props.tintColor} />}\n onPress={navigation.goBack}\n {...props}\n />\n ),\n }),\n },\n ConversationFilters: {\n screen: ConversationFiltersScreen,\n options: ConversationFiltersScreenOptions,\n },\n Conversation: {\n screen: ConversationScreen,\n options: ({ route, navigation }) => ({\n headerTitle: (route.params as { title?: string })?.title ?? 'Chat',\n headerLeft: props => (\n <HeaderBackButton\n displayMode=\"minimal\"\n onPress={() => {\n if ((route.params as ConversationFiltersParams)?.chat_group_graph_id) {\n // Ensure that conversations with a graph id pass them back to the conversation list\n navigation.popTo('Conversations', route.params)\n } else {\n navigation.goBack()\n }\n }}\n {...props}\n />\n ),\n }),\n },\n ConversationDetails: {\n screen: ConversationDetailsScreen,\n options: ({ navigation }) => ({\n presentation: 'modal',\n title: 'Conversation details',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton {...props} onPress={navigation.goBack}>\n Done\n </HeaderRightButton>\n ),\n }),\n },\n Create: {\n screen: CreateConversationStack,\n options: {\n headerShown: false,\n presentation: 'modal',\n },\n },\n MessageActions: {\n screen: MessageActionsScreen,\n // Something about sheetAllowedDetents declared inline breaks TS\n options: MessageActionsScreenOptions,\n },\n Reactions: {\n screen: ReactionsScreen,\n options: ReactionsScreenOptions,\n },\n NotFound: {\n screen: NotFound,\n options: {\n title: '404',\n },\n linking: {\n path: '*',\n },\n },\n },\n})\n\ntype ChatStackParamList = StaticParamList<typeof ChatStack>\n\ndeclare global {\n namespace ReactNavigation {\n interface RootParamList extends ChatStackParamList {}\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/navigation/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAE7D,OAAO,EACL,0BAA0B,GAE3B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAA;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAA;AACnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAA;AAC3F,OAAO,EACL,0CAA0C,EAC1C,kCAAkC,GACnC,MAAM,iFAAiF,CAAA;AACxF,OAAO,EAAE,kCAAkC,EAAE,MAAM,iFAAiF,CAAA;AACpI,OAAO,EACL,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EACL,yBAAyB,EACzB,gCAAgC,GACjC,MAAM,wCAAwC,CAAA;AAE/C,OAAO,EAAE,uCAAuC,EAAE,MAAM,uFAAuF,CAAA;AAE/I,MAAM,CA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F;KACF;CACF,CAAC,CAAA","sourcesContent":["import { HeaderBackButton } from '@react-navigation/elements'\nimport { StaticParamList } from '@react-navigation/native'\nimport {\n createNativeStackNavigator,\n NativeStackHeaderRightProps,\n} from '@react-navigation/native-stack'\nimport React from 'react'\nimport { Icon } from '../components'\nimport { ConversationDetailsScreen } from '../screens/conversation_details_screen'\nimport { ConversationScreen } from '../screens/conversation_screen'\nimport { ConversationsScreen } from '../screens/conversations/conversations_screen'\nimport { ConversationNewScreen } from '../screens/conversation_new/conversation_new_screen'\nimport {\n ConversationFilterReceipientsScreenOptions,\n ConversationFilterRecipientsScreen,\n} from '../screens/conversation_filter_recipients/conversation_filter_recipients_screen'\nimport { ConversationSelectRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_recipients_screen'\nimport {\n MessageActionsScreen,\n MessageActionsScreenOptions,\n} from '../screens/message_actions_screen'\nimport { SendGiphyScreen, SendGiphyScreenOptions } from '../screens/send_giphy_screen'\nimport { NotFound } from '../screens/not_found'\nimport { ReactionsScreen, ReactionsScreenOptions } from '../screens/reactions_screen'\nimport { HeaderRightButton } from './header'\nimport { ScreenLayout } from './screenLayout'\nimport {\n ConversationFiltersScreen,\n ConversationFiltersScreenOptions,\n} from '../screens/conversation_filters_screen'\nimport { ConversationFiltersParams } from '../screens/conversation_filters/screen_props'\nimport { ConversationSelectGroupRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_group_recipients_screen'\n\nexport const NewConversationStack = createNativeStackNavigator({\n initialRouteName: 'ConversationSelectRecipients',\n screenOptions: {\n headerBackButtonDisplayMode: 'minimal',\n },\n screenLayout: ScreenLayout,\n screens: {\n ConversationSelectRecipients: {\n screen: ConversationSelectRecipientsScreen,\n options: ({ navigation }) => ({\n title: 'New conversation',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton {...props} onPress={navigation.goBack}>\n Cancel\n </HeaderRightButton>\n ),\n headerBackVisible: false,\n }),\n },\n ConversationSelectGroupRecipients: {\n screen: ConversationSelectGroupRecipientsScreen,\n options: ({ navigation, route }) => ({\n title: 'New conversation',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton\n {...props}\n onPress={() => navigation.popTo('Conversations', route.params)}\n >\n Cancel\n </HeaderRightButton>\n ),\n }),\n },\n ConversationFilterRecipients: {\n screen: ConversationFilterRecipientsScreen,\n options: ConversationFilterReceipientsScreenOptions,\n },\n ConversationNew: {\n screen: ConversationNewScreen,\n options: ({ navigation, route }) => ({\n title: 'New conversation',\n headerLeft: () => null,\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton\n {...props}\n onPress={() => navigation.popTo('Conversations', route.params)}\n >\n Cancel\n </HeaderRightButton>\n ),\n }),\n },\n },\n})\n\nexport const ChatStack = createNativeStackNavigator({\n screenOptions: {\n headerBackButtonDisplayMode: 'minimal',\n },\n screenLayout: ScreenLayout,\n screens: {\n Conversations: {\n screen: ConversationsScreen,\n options: ({ route, navigation }) => ({\n headerTitle: (route.params as { title?: string })?.title ?? 'Chat',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderBackButton\n backImage={() => <Icon name=\"general.x\" size={18} color={props.tintColor} />}\n onPress={navigation.goBack}\n {...props}\n />\n ),\n }),\n },\n ConversationFilters: {\n screen: ConversationFiltersScreen,\n options: ConversationFiltersScreenOptions,\n },\n Conversation: {\n screen: ConversationScreen,\n options: ({ route, navigation }) => ({\n headerTitle: (route.params as { title?: string })?.title ?? 'Chat',\n headerLeft: props => (\n <HeaderBackButton\n displayMode=\"minimal\"\n onPress={() => {\n if ((route.params as ConversationFiltersParams)?.chat_group_graph_id) {\n // Ensure that conversations with a graph id pass them back to the conversation list\n navigation.popTo('Conversations', route.params)\n } else {\n navigation.goBack()\n }\n }}\n {...props}\n />\n ),\n }),\n },\n ConversationDetails: {\n screen: ConversationDetailsScreen,\n options: ({ navigation }) => ({\n presentation: 'modal',\n title: 'Conversation details',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton {...props} onPress={navigation.goBack}>\n Done\n </HeaderRightButton>\n ),\n }),\n },\n New: {\n screen: NewConversationStack,\n options: {\n headerShown: false,\n presentation: 'modal',\n },\n },\n SendGiphy: {\n screen: SendGiphyScreen,\n options: SendGiphyScreenOptions,\n },\n MessageActions: {\n screen: MessageActionsScreen,\n // Something about sheetAllowedDetents declared inline breaks TS\n options: MessageActionsScreenOptions,\n },\n Reactions: {\n screen: ReactionsScreen,\n options: ReactionsScreenOptions,\n },\n NotFound: {\n screen: NotFound,\n options: {\n title: '404',\n },\n linking: {\n path: '*',\n },\n },\n },\n})\n\ntype ChatStackParamList = StaticParamList<typeof ChatStack>\n\ndeclare global {\n namespace ReactNavigation {\n interface RootParamList extends ChatStackParamList {}\n }\n}\n"]}
|
|
@@ -267,14 +267,14 @@ const useStyles = ({ isStart, isEnd } = {}) => {
|
|
|
267
267
|
return StyleSheet.create({
|
|
268
268
|
listContainer: {
|
|
269
269
|
flex: 1,
|
|
270
|
-
backgroundColor: colors.
|
|
270
|
+
backgroundColor: colors.surfaceColor080,
|
|
271
271
|
},
|
|
272
272
|
contentContainer: {
|
|
273
273
|
padding: space(2),
|
|
274
274
|
},
|
|
275
275
|
sectionOuterBase: {
|
|
276
276
|
paddingLeft: space(2),
|
|
277
|
-
backgroundColor: colors.
|
|
277
|
+
backgroundColor: colors.surfaceColor100,
|
|
278
278
|
borderTopLeftRadius: isStart ? space(1) : 0,
|
|
279
279
|
borderTopRightRadius: isStart ? space(1) : 0,
|
|
280
280
|
borderBottomLeftRadius: isEnd ? space(1) : 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_details_screen.js","sourceRoot":"","sources":["../../src/screens/conversation_details_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACzF,OAAO,KAAK,EAAE,EACZ,WAAW,EACX,SAAS,EACT,QAAQ,EAIR,MAAM,GACP,MAAM,OAAO,C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,OAAO,EAAE,QAAQ,EAAE,CAAC;YACxE,SAAS,EAAE,CAAC;SACb;QACD,oBAAoB,EAAE;YACpB,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;SAC1E;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { StackActions, StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React, {\n useCallback,\n useEffect,\n useState,\n type SetStateAction,\n type Dispatch,\n type ReactNode,\n useRef,\n} from 'react'\nimport {\n StyleSheet,\n TextInput,\n View,\n type TextStyle,\n type ViewStyle,\n type ViewProps,\n Pressable,\n Alert,\n Platform,\n} from 'react-native'\nimport { HeaderTitle as ElementsHeaderTitle, HeaderTitleProps } from '@react-navigation/elements'\nimport { Badge, ChildNotice, Heading, Icon, Person, Switch, Text, TextButton } from '../components'\nimport { useSuspenseGet, useTheme } from '../hooks'\nimport {\n useConversation,\n useConversationDelete,\n useConversationDisableReplies,\n useConversationMute,\n useConversationUpdate,\n} from '../hooks/use_conversation'\nimport { MemberResource, isDefined } from '../types'\nimport { HeaderRightButton } from '../navigation/header'\nimport { FlashList } from '@shopify/flash-list'\nimport { space } from '../utils'\nimport { tokens } from '../vendor/tapestry/tokens'\nimport { ButtonAppearanceUnion } from '../components/display/utils/button_colors'\nimport { GroupResource } from '../types/resources/group_resource'\n\n// =========================================\n// ====== Factory Constants & Types ========\n// =========================================\n\nenum SectionTypes {\n header,\n hidden,\n members,\n setting,\n view,\n}\n\ntype SectionListData = Array<\n | DataItem<{ title: string }, SectionTypes.header>\n | DataItem<MemberResource, SectionTypes.members>\n | DataItem<ViewProps, SectionTypes.view>\n | DataItem<SettingRowProps, SectionTypes.setting>\n | DataItem<any, SectionTypes.hidden>\n>\n\ninterface DataItem<T, TName extends SectionTypes> {\n type: TName\n data: T\n sectionOuterStyle?: ViewStyle\n sectionInnerStyle?: ViewStyle\n showBottomBorder?: boolean\n}\n\n// =================================\n// ====== Components ===============\n// =================================\n\nexport type ConversationDetailsScreenProps = StaticScreenProps<{\n conversation_id: number\n}>\n\nexport function ConversationDetailsScreen({ route }: ConversationDetailsScreenProps) {\n const navigation = useNavigation()\n const styles = useStyles()\n\n const { data: conversation } = useConversation(route.params)\n const [title, setTitle] = useState(conversation.title)\n const { muted, setMuted } = useConversationMute(route.params)\n const { repliesDisabled, setRepliesDisabled } = useConversationDisableReplies(route.params)\n const { mutate: saveTitle } = useConversationUpdate(route.params)\n const { mutate: deleteConversation } = useConversationDelete(route.params)\n\n const trimmedTitle = title.trim()\n const emptyTitle = trimmedTitle === '' || title === null\n\n const canUpdate = conversation.memberAbility?.canUpdate || false\n const canDelete = conversation.memberAbility?.canDelete || false\n const isLeader = conversation.memberAbility?.leader || false\n\n const { data: members } = useSuspenseGet<MemberResource[]>({\n url: `/me/conversations/${route.params.conversation_id}/members`,\n data: {\n include: ['person'],\n fields: {\n Member: ['avatar', 'name', 'first_name', 'last_name', 'child', 'badges'],\n },\n },\n })\n\n const memberSectionStyleMap = {\n first: styles.sectionInnerFirstMember,\n middle: styles.sectionInnerMiddleMiddle,\n last: styles.sectionInnerLastMember,\n }\n\n const memberItems = members.map((data, index) => {\n const isFirst = index === 0\n const isLast = index === members.length - 1\n const memberPosition = isFirst ? 'first' : isLast ? 'last' : 'middle'\n const memberSectionStyle = memberSectionStyleMap[memberPosition]\n\n return {\n type: data.child ? SectionTypes.hidden : SectionTypes.members,\n data,\n sectionInnerStyle: memberSectionStyle,\n }\n })\n\n const childMembers = members.filter(member => member.child)\n const hasChildren = childMembers.length > 0\n\n const teamsGroup =\n conversation.groups\n ?.filter(g => g.sourceAppName === 'Services')\n ?.filter(g => ['Team', 'PlanTeam'].includes(g.sourceType))\n ?.filter(g => g.name !== null) || []\n const hasTeams = teamsGroup.length > 0\n\n const badge = conversation.badges?.[0]\n const resourceType = badge?.pcoResourceType || ''\n const productName = badge?.appName\n const name = badge?.text || undefined\n\n const handleDelete = useCallback(() => {\n Alert.alert(\n 'Delete conversation',\n `All messages in ${title} will be deleted for everyone. This action cannot be undone.`,\n [\n {\n text: 'Cancel',\n style: 'cancel',\n },\n {\n text: 'Delete',\n style: 'destructive',\n onPress: () => {\n deleteConversation()\n navigation.dispatch(StackActions.popToTop())\n },\n },\n ]\n )\n }, [deleteConversation, navigation, title])\n\n const HeaderTitle = useCallback(\n (props: HeaderTitleProps) => {\n return (\n <View style={styles.headerTitleContainer}>\n <ElementsHeaderTitle {...props} />\n <Badge\n variant=\"metaSubtle\"\n label={resourceType}\n metaLabel={name}\n style={styles.headerTitleBadge}\n productLogoName={productName}\n />\n </View>\n )\n },\n [name, productName, resourceType, styles.headerTitleBadge, styles.headerTitleContainer]\n )\n\n const HeaderRight = useCallback(() => {\n return (\n <HeaderRightButton\n onPress={() => {\n saveTitle({ title: trimmedTitle || conversation.title })\n navigation.goBack()\n }}\n >\n Done\n </HeaderRightButton>\n )\n }, [conversation.title, navigation, saveTitle, trimmedTitle])\n\n useEffect(() => {\n navigation.setOptions({\n headerRight: HeaderRight,\n headerTitle: HeaderTitle,\n })\n }, [HeaderRight, HeaderTitle, navigation])\n\n const listData = [\n {\n type: SectionTypes.view,\n data: {\n children: (\n <TitleInput\n canUpdate={canUpdate}\n title={title}\n setTitle={setTitle}\n isEmpty={emptyTitle}\n />\n ),\n },\n sectionInnerStyle: styles.sectionInnerTitleInput,\n },\n {\n type: SectionTypes.header,\n data: { title: 'Settings' },\n showBottomBorder: true,\n sectionInnerStyle: styles.sectionInnerHeaderWithBottomBorder,\n },\n {\n type: SectionTypes.setting,\n data: {\n title: 'Mute',\n rightItem: <Switch value={muted} onChange={() => setMuted(!muted)} />,\n },\n showBottomBorder: true,\n },\n {\n type: canUpdate ? SectionTypes.setting : SectionTypes.hidden,\n data: {\n title: 'Freeze converation',\n subtitle: 'Disables replies for everyone except leaders.',\n rightItem: (\n <Switch value={repliesDisabled} onChange={() => setRepliesDisabled(!repliesDisabled)} />\n ),\n },\n showBottomBorder: true,\n },\n {\n type: canDelete ? SectionTypes.setting : SectionTypes.hidden,\n data: {\n title: 'Delete conversation…',\n buttonTextStyle: styles.deleteButtonText,\n appearance: 'danger',\n onPress: handleDelete,\n },\n },\n {\n type: hasTeams ? SectionTypes.header : SectionTypes.hidden,\n data: { title: 'Teams' },\n sectionInnerStyle: styles.sectionInnerHeader,\n },\n {\n type: hasTeams ? SectionTypes.view : SectionTypes.hidden,\n data: {\n children: <TeamsGroup teams={teamsGroup} />,\n },\n },\n {\n type: SectionTypes.header,\n data: { title: 'People' },\n sectionInnerStyle: styles.sectionInnerHeader,\n },\n {\n type: hasChildren && isLeader ? SectionTypes.view : SectionTypes.hidden,\n data: {\n children: <ChildNotice childMembers={childMembers} />,\n },\n sectionInnerStyle: styles.sectionInnerChildNotice,\n },\n ...memberItems,\n ].filter(item => item.type !== SectionTypes.hidden)\n\n const headerIndices = listData\n .map(({ type }, index) => (type === SectionTypes.header ? index : undefined))\n .filter(isDefined)\n\n return (\n <View style={styles.listContainer}>\n <FlashList\n data={listData as SectionListData}\n estimatedItemSize={52}\n contentContainerStyle={styles.contentContainer}\n renderItem={({ item, index }) => {\n const [isStart, isEnd] = [\n index === 0 || headerIndices.includes(index),\n index === listData.length - 1 || headerIndices.includes(index + 1),\n ]\n\n switch (item.type) {\n case SectionTypes.header:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <Heading variant=\"h3\">{item.data.title}</Heading>\n </ListSection>\n )\n case SectionTypes.members:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <Person person={{ ...item.data }} />\n </ListSection>\n )\n case SectionTypes.setting:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <SettingRow {...item.data} />\n </ListSection>\n )\n case SectionTypes.view:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <View {...item.data} style={item.data.style} />\n </ListSection>\n )\n default:\n return null\n }\n }}\n />\n </View>\n )\n}\n\ninterface ListSectionProps {\n isStart?: boolean\n isEnd?: boolean\n showBottomBorder?: boolean\n outerStyle?: ViewStyle\n innerStyle?: ViewStyle\n children: ReactNode\n}\n\nfunction ListSection({\n isStart,\n isEnd,\n showBottomBorder,\n outerStyle,\n innerStyle,\n children,\n}: ListSectionProps) {\n const styles = useStyles({ isStart, isEnd })\n const bottomBorder = showBottomBorder ? styles.sectionInnerBottomBorder : {}\n\n return (\n <View style={[styles.sectionOuterBase, outerStyle]}>\n <View style={[styles.sectionInnerBase, bottomBorder, innerStyle]}>{children}</View>\n </View>\n )\n}\n\ninterface InputProps {\n canUpdate: boolean\n title: string\n setTitle: Dispatch<SetStateAction<string>>\n style?: ViewStyle\n isEmpty: boolean\n}\n\nfunction TitleInput({ canUpdate, title, setTitle, style, isEmpty }: InputProps) {\n const styles = useStyles()\n const textRef = useRef<TextInput>(null)\n\n const handleFocus = () => {\n if (textRef.current) {\n textRef.current.focus()\n }\n }\n\n return (\n <Pressable style={[styles.titleContainer, style]} onPress={() => handleFocus()}>\n <View style={styles.titleLabelContainer}>\n <Text variant=\"tertiary\" style={styles.titleLabel}>\n Title\n </Text>\n {!canUpdate && <Icon name=\"general.lock\" style={styles.titleDisabledIcon} />}\n </View>\n <TextInput\n ref={textRef}\n editable={canUpdate}\n onChangeText={setTitle}\n style={[styles.titleInput, !canUpdate && styles.titleInputDisabled]}\n value={title}\n multiline\n maxLength={255} // Matches Chat Web\n enterKeyHint=\"done\"\n submitBehavior=\"blurAndSubmit\"\n />\n {isEmpty && (\n <Text variant=\"footnote\" style={styles.inputValidationText}>\n A title is required for your conversation.\n </Text>\n )}\n </Pressable>\n )\n}\n\ninterface SettingRowProps {\n title: string\n style?: ViewStyle\n rightItem?: ReactNode\n titleStyle?: TextStyle\n buttonTextStyle?: TextStyle\n subtitle?: string\n rightItemStyle?: ViewStyle\n appearance?: ButtonAppearanceUnion\n onPress?: () => void\n}\n\nfunction SettingRow({\n title,\n style,\n titleStyle = {},\n buttonTextStyle = {},\n subtitle,\n rightItem,\n rightItemStyle = {},\n appearance,\n onPress,\n}: SettingRowProps) {\n const styles = useStyles()\n\n if (onPress) {\n return (\n <TextButton\n style={[styles.settingRow, style]}\n textStyle={buttonTextStyle}\n appearance={appearance}\n onPress={onPress}\n >\n {title}\n </TextButton>\n )\n }\n\n return (\n <View style={[styles.settingRow, style]}>\n <View style={styles.settingRowContent}>\n <Text variant=\"plain\" style={[styles.settingRowText, titleStyle]}>\n {title}\n </Text>\n {Boolean(subtitle) && <Text variant=\"footnote\">{subtitle}</Text>}\n </View>\n {Boolean(rightItem) && <View style={rightItemStyle}>{rightItem}</View>}\n </View>\n )\n}\n\nfunction TeamsGroup({ teams }: { teams: GroupResource[] }) {\n const styles = useStyles()\n\n if (teams.length === 0) return null\n\n return (\n <View style={styles.teamGroup}>\n {teams.map((team, index) => (\n <Badge key={index} label={team.name as string} />\n ))}\n </View>\n )\n}\n\n// =================================\n// ====== Styles ===================\n// =================================\n\nconst useStyles = ({ isStart, isEnd }: { isStart?: boolean; isEnd?: boolean } = {}) => {\n const { colors } = useTheme()\n const headerBottomPadding = space(0.5)\n\n return StyleSheet.create({\n listContainer: {\n flex: 1,\n backgroundColor: colors.fillColorNeutral080,\n },\n contentContainer: {\n padding: space(2),\n },\n sectionOuterBase: {\n paddingLeft: space(2),\n backgroundColor: colors.fillColorNeutral100Inverted,\n borderTopLeftRadius: isStart ? space(1) : 0,\n borderTopRightRadius: isStart ? space(1) : 0,\n borderBottomLeftRadius: isEnd ? space(1) : 0,\n borderBottomRightRadius: isEnd ? space(1) : 0,\n marginBottom: isEnd ? space(2) : 0,\n },\n sectionInnerBase: {\n paddingRight: space(2),\n paddingTop: isStart ? space(2) : space(1.5),\n paddingBottom: isEnd ? space(2) : space(1.5),\n },\n sectionInnerHeader: {\n paddingBottom: headerBottomPadding,\n },\n sectionInnerHeaderWithBottomBorder: {\n paddingBottom: space(2),\n },\n sectionInnerBottomBorder: {\n borderBottomColor: colors.borderColorDefaultBase,\n borderBottomWidth: isEnd ? 0 : 1,\n },\n sectionInnerTitleInput: {\n paddingTop: space(1.5), // paddingVertical doesn't override the sectionInner padding\n paddingBottom: space(1.5),\n },\n sectionInnerChildNotice: {\n paddingBottom: headerBottomPadding,\n },\n sectionInnerMiddleMiddle: {\n paddingTop: 0,\n paddingBottom: space(1.5),\n },\n sectionInnerFirstMember: {\n paddingTop: space(1.5),\n paddingBottom: space(1.5),\n },\n sectionInnerLastMember: {\n paddingTop: 0,\n paddingBottom: space(2),\n },\n titleContainer: {\n gap: 4,\n },\n titleLabelContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 4,\n },\n titleLabel: {\n color: colors.textColorDefaultSecondary,\n },\n titleDisabledIcon: {\n color: colors.iconColorDefaultSecondary,\n },\n titleInput: {\n color: colors.textColorDefaultPrimary,\n fontSize: tokens.fontSizeMd,\n },\n titleInputDisabled: {\n color: colors.textColorDefaultSecondary,\n },\n inputValidationText: {\n color: colors.statusErrorText,\n paddingTop: 8,\n borderTopWidth: 1,\n borderColor: colors.borderColorStatusError,\n },\n settingRow: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n gap: space(1),\n },\n settingRowContent: {\n flex: 1,\n },\n deleteButtonText: {\n fontWeight: 'normal',\n },\n settingRowText: {\n lineHeight: 20,\n },\n teamGroup: {\n flexDirection: 'row',\n gap: 4,\n flexWrap: 'wrap',\n },\n headerTitleBadge: {\n alignSelf: Platform.select({ android: 'flex-start', default: 'center' }),\n marginTop: 2,\n },\n headerTitleContainer: {\n alignItems: Platform.select({ android: 'flex-start', default: 'center' }),\n },\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"conversation_details_screen.js","sourceRoot":"","sources":["../../src/screens/conversation_details_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACzF,OAAO,KAAK,EAAE,EACZ,WAAW,EACX,SAAS,EACT,QAAQ,EAIR,MAAM,GACP,MAAM,OAAO,CAAA;AACd,OAAO,EACL,UAAU,EACV,SAAS,EACT,IAAI,EAIJ,SAAS,EACT,KAAK,EACL,QAAQ,GACT,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,WAAW,IAAI,mBAAmB,EAAoB,MAAM,4BAA4B,CAAA;AACjG,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AACnG,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,6BAA6B,EAC7B,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAkB,SAAS,EAAE,MAAM,UAAU,CAAA;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAIlD,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,IAAK,YAMJ;AAND,WAAK,YAAY;IACf,mDAAM,CAAA;IACN,mDAAM,CAAA;IACN,qDAAO,CAAA;IACP,qDAAO,CAAA;IACP,+CAAI,CAAA;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,iBAAiB,EAAE;YACjB,IAAI,EAAE,CAAC;SACR;QACD,gBAAgB,EAAE;YAChB,UAAU,EAAE,QAAQ;SACrB;QACD,cAAc,EAAE;YACd,UAAU,EAAE,EAAE;SACf;QACD,SAAS,EAAE;YACT,aAAa,EAAE,KAAK;YACpB,GAAG,EAAE,CAAC;YACN,QAAQ,EAAE,MAAM;SACjB;QACD,gBAAgB,EAAE;YAChB,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;YACxE,SAAS,EAAE,CAAC;SACb;QACD,oBAAoB,EAAE;YACpB,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;SAC1E;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { StackActions, StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React, {\n useCallback,\n useEffect,\n useState,\n type SetStateAction,\n type Dispatch,\n type ReactNode,\n useRef,\n} from 'react'\nimport {\n StyleSheet,\n TextInput,\n View,\n type TextStyle,\n type ViewStyle,\n type ViewProps,\n Pressable,\n Alert,\n Platform,\n} from 'react-native'\nimport { HeaderTitle as ElementsHeaderTitle, HeaderTitleProps } from '@react-navigation/elements'\nimport { Badge, ChildNotice, Heading, Icon, Person, Switch, Text, TextButton } from '../components'\nimport { useSuspenseGet, useTheme } from '../hooks'\nimport {\n useConversation,\n useConversationDelete,\n useConversationDisableReplies,\n useConversationMute,\n useConversationUpdate,\n} from '../hooks/use_conversation'\nimport { MemberResource, isDefined } from '../types'\nimport { HeaderRightButton } from '../navigation/header'\nimport { FlashList } from '@shopify/flash-list'\nimport { space } from '../utils'\nimport { tokens } from '../vendor/tapestry/tokens'\nimport { ButtonAppearanceUnion } from '../components/display/utils/button_colors'\nimport { GroupResource } from '../types/resources/group_resource'\n\n// =========================================\n// ====== Factory Constants & Types ========\n// =========================================\n\nenum SectionTypes {\n header,\n hidden,\n members,\n setting,\n view,\n}\n\ntype SectionListData = Array<\n | DataItem<{ title: string }, SectionTypes.header>\n | DataItem<MemberResource, SectionTypes.members>\n | DataItem<ViewProps, SectionTypes.view>\n | DataItem<SettingRowProps, SectionTypes.setting>\n | DataItem<any, SectionTypes.hidden>\n>\n\ninterface DataItem<T, TName extends SectionTypes> {\n type: TName\n data: T\n sectionOuterStyle?: ViewStyle\n sectionInnerStyle?: ViewStyle\n showBottomBorder?: boolean\n}\n\n// =================================\n// ====== Components ===============\n// =================================\n\nexport type ConversationDetailsScreenProps = StaticScreenProps<{\n conversation_id: number\n}>\n\nexport function ConversationDetailsScreen({ route }: ConversationDetailsScreenProps) {\n const navigation = useNavigation()\n const styles = useStyles()\n\n const { data: conversation } = useConversation(route.params)\n const [title, setTitle] = useState(conversation.title)\n const { muted, setMuted } = useConversationMute(route.params)\n const { repliesDisabled, setRepliesDisabled } = useConversationDisableReplies(route.params)\n const { mutate: saveTitle } = useConversationUpdate(route.params)\n const { mutate: deleteConversation } = useConversationDelete(route.params)\n\n const trimmedTitle = title.trim()\n const emptyTitle = trimmedTitle === '' || title === null\n\n const canUpdate = conversation.memberAbility?.canUpdate || false\n const canDelete = conversation.memberAbility?.canDelete || false\n const isLeader = conversation.memberAbility?.leader || false\n\n const { data: members } = useSuspenseGet<MemberResource[]>({\n url: `/me/conversations/${route.params.conversation_id}/members`,\n data: {\n include: ['person'],\n fields: {\n Member: ['avatar', 'name', 'first_name', 'last_name', 'child', 'badges'],\n },\n },\n })\n\n const memberSectionStyleMap = {\n first: styles.sectionInnerFirstMember,\n middle: styles.sectionInnerMiddleMiddle,\n last: styles.sectionInnerLastMember,\n }\n\n const memberItems = members.map((data, index) => {\n const isFirst = index === 0\n const isLast = index === members.length - 1\n const memberPosition = isFirst ? 'first' : isLast ? 'last' : 'middle'\n const memberSectionStyle = memberSectionStyleMap[memberPosition]\n\n return {\n type: data.child ? SectionTypes.hidden : SectionTypes.members,\n data,\n sectionInnerStyle: memberSectionStyle,\n }\n })\n\n const childMembers = members.filter(member => member.child)\n const hasChildren = childMembers.length > 0\n\n const teamsGroup =\n conversation.groups\n ?.filter(g => g.sourceAppName === 'Services')\n ?.filter(g => ['Team', 'PlanTeam'].includes(g.sourceType))\n ?.filter(g => g.name !== null) || []\n const hasTeams = teamsGroup.length > 0\n\n const badge = conversation.badges?.[0]\n const resourceType = badge?.pcoResourceType || ''\n const productName = badge?.appName\n const name = badge?.text || undefined\n\n const handleDelete = useCallback(() => {\n Alert.alert(\n 'Delete conversation',\n `All messages in ${title} will be deleted for everyone. This action cannot be undone.`,\n [\n {\n text: 'Cancel',\n style: 'cancel',\n },\n {\n text: 'Delete',\n style: 'destructive',\n onPress: () => {\n deleteConversation()\n navigation.dispatch(StackActions.popToTop())\n },\n },\n ]\n )\n }, [deleteConversation, navigation, title])\n\n const HeaderTitle = useCallback(\n (props: HeaderTitleProps) => {\n return (\n <View style={styles.headerTitleContainer}>\n <ElementsHeaderTitle {...props} />\n <Badge\n variant=\"metaSubtle\"\n label={resourceType}\n metaLabel={name}\n style={styles.headerTitleBadge}\n productLogoName={productName}\n />\n </View>\n )\n },\n [name, productName, resourceType, styles.headerTitleBadge, styles.headerTitleContainer]\n )\n\n const HeaderRight = useCallback(() => {\n return (\n <HeaderRightButton\n onPress={() => {\n saveTitle({ title: trimmedTitle || conversation.title })\n navigation.goBack()\n }}\n >\n Done\n </HeaderRightButton>\n )\n }, [conversation.title, navigation, saveTitle, trimmedTitle])\n\n useEffect(() => {\n navigation.setOptions({\n headerRight: HeaderRight,\n headerTitle: HeaderTitle,\n })\n }, [HeaderRight, HeaderTitle, navigation])\n\n const listData = [\n {\n type: SectionTypes.view,\n data: {\n children: (\n <TitleInput\n canUpdate={canUpdate}\n title={title}\n setTitle={setTitle}\n isEmpty={emptyTitle}\n />\n ),\n },\n sectionInnerStyle: styles.sectionInnerTitleInput,\n },\n {\n type: SectionTypes.header,\n data: { title: 'Settings' },\n showBottomBorder: true,\n sectionInnerStyle: styles.sectionInnerHeaderWithBottomBorder,\n },\n {\n type: SectionTypes.setting,\n data: {\n title: 'Mute',\n rightItem: <Switch value={muted} onChange={() => setMuted(!muted)} />,\n },\n showBottomBorder: true,\n },\n {\n type: canUpdate ? SectionTypes.setting : SectionTypes.hidden,\n data: {\n title: 'Freeze converation',\n subtitle: 'Disables replies for everyone except leaders.',\n rightItem: (\n <Switch value={repliesDisabled} onChange={() => setRepliesDisabled(!repliesDisabled)} />\n ),\n },\n showBottomBorder: true,\n },\n {\n type: canDelete ? SectionTypes.setting : SectionTypes.hidden,\n data: {\n title: 'Delete conversation…',\n buttonTextStyle: styles.deleteButtonText,\n appearance: 'danger',\n onPress: handleDelete,\n },\n },\n {\n type: hasTeams ? SectionTypes.header : SectionTypes.hidden,\n data: { title: 'Teams' },\n sectionInnerStyle: styles.sectionInnerHeader,\n },\n {\n type: hasTeams ? SectionTypes.view : SectionTypes.hidden,\n data: {\n children: <TeamsGroup teams={teamsGroup} />,\n },\n },\n {\n type: SectionTypes.header,\n data: { title: 'People' },\n sectionInnerStyle: styles.sectionInnerHeader,\n },\n {\n type: hasChildren && isLeader ? SectionTypes.view : SectionTypes.hidden,\n data: {\n children: <ChildNotice childMembers={childMembers} />,\n },\n sectionInnerStyle: styles.sectionInnerChildNotice,\n },\n ...memberItems,\n ].filter(item => item.type !== SectionTypes.hidden)\n\n const headerIndices = listData\n .map(({ type }, index) => (type === SectionTypes.header ? index : undefined))\n .filter(isDefined)\n\n return (\n <View style={styles.listContainer}>\n <FlashList\n data={listData as SectionListData}\n estimatedItemSize={52}\n contentContainerStyle={styles.contentContainer}\n renderItem={({ item, index }) => {\n const [isStart, isEnd] = [\n index === 0 || headerIndices.includes(index),\n index === listData.length - 1 || headerIndices.includes(index + 1),\n ]\n\n switch (item.type) {\n case SectionTypes.header:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <Heading variant=\"h3\">{item.data.title}</Heading>\n </ListSection>\n )\n case SectionTypes.members:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <Person person={{ ...item.data }} />\n </ListSection>\n )\n case SectionTypes.setting:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <SettingRow {...item.data} />\n </ListSection>\n )\n case SectionTypes.view:\n return (\n <ListSection\n isStart={isStart}\n isEnd={isEnd}\n showBottomBorder={item?.showBottomBorder}\n outerStyle={item?.sectionOuterStyle}\n innerStyle={item?.sectionInnerStyle}\n >\n <View {...item.data} style={item.data.style} />\n </ListSection>\n )\n default:\n return null\n }\n }}\n />\n </View>\n )\n}\n\ninterface ListSectionProps {\n isStart?: boolean\n isEnd?: boolean\n showBottomBorder?: boolean\n outerStyle?: ViewStyle\n innerStyle?: ViewStyle\n children: ReactNode\n}\n\nfunction ListSection({\n isStart,\n isEnd,\n showBottomBorder,\n outerStyle,\n innerStyle,\n children,\n}: ListSectionProps) {\n const styles = useStyles({ isStart, isEnd })\n const bottomBorder = showBottomBorder ? styles.sectionInnerBottomBorder : {}\n\n return (\n <View style={[styles.sectionOuterBase, outerStyle]}>\n <View style={[styles.sectionInnerBase, bottomBorder, innerStyle]}>{children}</View>\n </View>\n )\n}\n\ninterface InputProps {\n canUpdate: boolean\n title: string\n setTitle: Dispatch<SetStateAction<string>>\n style?: ViewStyle\n isEmpty: boolean\n}\n\nfunction TitleInput({ canUpdate, title, setTitle, style, isEmpty }: InputProps) {\n const styles = useStyles()\n const textRef = useRef<TextInput>(null)\n\n const handleFocus = () => {\n if (textRef.current) {\n textRef.current.focus()\n }\n }\n\n return (\n <Pressable style={[styles.titleContainer, style]} onPress={() => handleFocus()}>\n <View style={styles.titleLabelContainer}>\n <Text variant=\"tertiary\" style={styles.titleLabel}>\n Title\n </Text>\n {!canUpdate && <Icon name=\"general.lock\" style={styles.titleDisabledIcon} />}\n </View>\n <TextInput\n ref={textRef}\n editable={canUpdate}\n onChangeText={setTitle}\n style={[styles.titleInput, !canUpdate && styles.titleInputDisabled]}\n value={title}\n multiline\n maxLength={255} // Matches Chat Web\n enterKeyHint=\"done\"\n submitBehavior=\"blurAndSubmit\"\n />\n {isEmpty && (\n <Text variant=\"footnote\" style={styles.inputValidationText}>\n A title is required for your conversation.\n </Text>\n )}\n </Pressable>\n )\n}\n\ninterface SettingRowProps {\n title: string\n style?: ViewStyle\n rightItem?: ReactNode\n titleStyle?: TextStyle\n buttonTextStyle?: TextStyle\n subtitle?: string\n rightItemStyle?: ViewStyle\n appearance?: ButtonAppearanceUnion\n onPress?: () => void\n}\n\nfunction SettingRow({\n title,\n style,\n titleStyle = {},\n buttonTextStyle = {},\n subtitle,\n rightItem,\n rightItemStyle = {},\n appearance,\n onPress,\n}: SettingRowProps) {\n const styles = useStyles()\n\n if (onPress) {\n return (\n <TextButton\n style={[styles.settingRow, style]}\n textStyle={buttonTextStyle}\n appearance={appearance}\n onPress={onPress}\n >\n {title}\n </TextButton>\n )\n }\n\n return (\n <View style={[styles.settingRow, style]}>\n <View style={styles.settingRowContent}>\n <Text variant=\"plain\" style={[styles.settingRowText, titleStyle]}>\n {title}\n </Text>\n {Boolean(subtitle) && <Text variant=\"footnote\">{subtitle}</Text>}\n </View>\n {Boolean(rightItem) && <View style={rightItemStyle}>{rightItem}</View>}\n </View>\n )\n}\n\nfunction TeamsGroup({ teams }: { teams: GroupResource[] }) {\n const styles = useStyles()\n\n if (teams.length === 0) return null\n\n return (\n <View style={styles.teamGroup}>\n {teams.map((team, index) => (\n <Badge key={index} label={team.name as string} />\n ))}\n </View>\n )\n}\n\n// =================================\n// ====== Styles ===================\n// =================================\n\nconst useStyles = ({ isStart, isEnd }: { isStart?: boolean; isEnd?: boolean } = {}) => {\n const { colors } = useTheme()\n const headerBottomPadding = space(0.5)\n\n return StyleSheet.create({\n listContainer: {\n flex: 1,\n backgroundColor: colors.surfaceColor080,\n },\n contentContainer: {\n padding: space(2),\n },\n sectionOuterBase: {\n paddingLeft: space(2),\n backgroundColor: colors.surfaceColor100,\n borderTopLeftRadius: isStart ? space(1) : 0,\n borderTopRightRadius: isStart ? space(1) : 0,\n borderBottomLeftRadius: isEnd ? space(1) : 0,\n borderBottomRightRadius: isEnd ? space(1) : 0,\n marginBottom: isEnd ? space(2) : 0,\n },\n sectionInnerBase: {\n paddingRight: space(2),\n paddingTop: isStart ? space(2) : space(1.5),\n paddingBottom: isEnd ? space(2) : space(1.5),\n },\n sectionInnerHeader: {\n paddingBottom: headerBottomPadding,\n },\n sectionInnerHeaderWithBottomBorder: {\n paddingBottom: space(2),\n },\n sectionInnerBottomBorder: {\n borderBottomColor: colors.borderColorDefaultBase,\n borderBottomWidth: isEnd ? 0 : 1,\n },\n sectionInnerTitleInput: {\n paddingTop: space(1.5), // paddingVertical doesn't override the sectionInner padding\n paddingBottom: space(1.5),\n },\n sectionInnerChildNotice: {\n paddingBottom: headerBottomPadding,\n },\n sectionInnerMiddleMiddle: {\n paddingTop: 0,\n paddingBottom: space(1.5),\n },\n sectionInnerFirstMember: {\n paddingTop: space(1.5),\n paddingBottom: space(1.5),\n },\n sectionInnerLastMember: {\n paddingTop: 0,\n paddingBottom: space(2),\n },\n titleContainer: {\n gap: 4,\n },\n titleLabelContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 4,\n },\n titleLabel: {\n color: colors.textColorDefaultSecondary,\n },\n titleDisabledIcon: {\n color: colors.iconColorDefaultSecondary,\n },\n titleInput: {\n color: colors.textColorDefaultPrimary,\n fontSize: tokens.fontSizeMd,\n },\n titleInputDisabled: {\n color: colors.textColorDefaultSecondary,\n },\n inputValidationText: {\n color: colors.statusErrorText,\n paddingTop: 8,\n borderTopWidth: 1,\n borderColor: colors.borderColorStatusError,\n },\n settingRow: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n gap: space(1),\n },\n settingRowContent: {\n flex: 1,\n },\n deleteButtonText: {\n fontWeight: 'normal',\n },\n settingRowText: {\n lineHeight: 20,\n },\n teamGroup: {\n flexDirection: 'row',\n gap: 4,\n flexWrap: 'wrap',\n },\n headerTitleBadge: {\n alignSelf: Platform.select({ android: 'flex-start', default: 'center' }),\n marginTop: 2,\n },\n headerTitleContainer: {\n alignItems: Platform.select({ android: 'flex-start', default: 'center' }),\n },\n })\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ViewStyle } from 'react-native';
|
|
2
|
+
import { TeamProps } from '../types';
|
|
3
|
+
interface TeamRowProps {
|
|
4
|
+
data: TeamProps;
|
|
5
|
+
style?: ViewStyle;
|
|
6
|
+
accessibilityLabelledBy: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const CheckboxRow: ({ data, style, accessibilityLabelledBy }: TeamRowProps) => import("react").JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=checkbox_row.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox_row.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversation_filter_recipients/components/checkbox_row.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AAI1E,OAAO,EAA2C,SAAS,EAAE,MAAM,UAAU,CAAA;AAI7E,UAAU,YAAY;IACpB,IAAI,EAAE,SAAS,CAAA;IACf,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,uBAAuB,EAAE,MAAM,CAAA;CAChC;AAED,eAAO,MAAM,WAAW,6CAA8C,YAAY,gCAiCjF,CAAA"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Pressable, View, StyleSheet } from 'react-native';
|
|
2
|
+
import { useTheme } from '../../../hooks';
|
|
3
|
+
import { Icon, Text } from '../../../components';
|
|
4
|
+
import { tokens } from '../../../vendor/tapestry/tokens';
|
|
5
|
+
import { useRoute } from '@react-navigation/native';
|
|
6
|
+
import { useFilterRecipientsContext } from '../context/conversation_filter_recipients_context';
|
|
7
|
+
export const CheckboxRow = ({ data, style, accessibilityLabelledBy }) => {
|
|
8
|
+
const styles = useStyles();
|
|
9
|
+
const route = useRoute();
|
|
10
|
+
const { setTeamFilters } = useFilterRecipientsContext();
|
|
11
|
+
const { teamId, teamName } = data;
|
|
12
|
+
const { team_ids: currentTeamIds } = route.params;
|
|
13
|
+
const checked = currentTeamIds?.includes(teamId) ?? false;
|
|
14
|
+
const newTeamIdAdded = [...(currentTeamIds ?? []), teamId];
|
|
15
|
+
const newTeamIdRemoved = (currentTeamIds ?? []).filter(currentId => currentId !== teamId);
|
|
16
|
+
const handlePress = () => {
|
|
17
|
+
setTeamFilters({
|
|
18
|
+
team_ids: checked ? newTeamIdRemoved : newTeamIdAdded,
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
return (<Pressable style={({ pressed }) => [styles.checkboxRow, pressed && styles.checkboxRowPressed, style]} onPress={handlePress} accessibilityRole="checkbox" accessibilityState={{ checked }} accessibilityLabelledBy={accessibilityLabelledBy} accessibilityLabel={`${teamName} team`}>
|
|
22
|
+
<CheckboxIcon checked={checked}/>
|
|
23
|
+
<Text style={styles.label} numberOfLines={2}>
|
|
24
|
+
{teamName}
|
|
25
|
+
</Text>
|
|
26
|
+
</Pressable>);
|
|
27
|
+
};
|
|
28
|
+
function CheckboxIcon({ checked }) {
|
|
29
|
+
const styles = useStyles();
|
|
30
|
+
const checkedStyle = checked ? styles.checkedContainer : styles.uncheckedContainer;
|
|
31
|
+
return (<View style={checkedStyle}>
|
|
32
|
+
{checked && <Icon name="general.thickCheckmark" style={styles.checkedIcon}/>}
|
|
33
|
+
</View>);
|
|
34
|
+
}
|
|
35
|
+
const useStyles = () => {
|
|
36
|
+
const { colors } = useTheme();
|
|
37
|
+
const baseCheckboxStyles = {
|
|
38
|
+
width: 20,
|
|
39
|
+
height: 20,
|
|
40
|
+
borderRadius: 40,
|
|
41
|
+
alignItems: 'center',
|
|
42
|
+
justifyContent: 'center',
|
|
43
|
+
};
|
|
44
|
+
return StyleSheet.create({
|
|
45
|
+
checkboxRow: {
|
|
46
|
+
flexDirection: 'row',
|
|
47
|
+
alignItems: 'center',
|
|
48
|
+
gap: 12,
|
|
49
|
+
padding: 16,
|
|
50
|
+
borderTopWidth: 1,
|
|
51
|
+
borderTopColor: colors.borderColorDefaultDim,
|
|
52
|
+
backgroundColor: colors.surfaceColor100,
|
|
53
|
+
},
|
|
54
|
+
checkboxRowPressed: {
|
|
55
|
+
opacity: 0.5,
|
|
56
|
+
},
|
|
57
|
+
label: {
|
|
58
|
+
flex: 1,
|
|
59
|
+
},
|
|
60
|
+
checkedContainer: {
|
|
61
|
+
...baseCheckboxStyles,
|
|
62
|
+
backgroundColor: colors.statusSuccessIcon,
|
|
63
|
+
},
|
|
64
|
+
uncheckedContainer: {
|
|
65
|
+
...baseCheckboxStyles,
|
|
66
|
+
borderWidth: 2,
|
|
67
|
+
borderColor: colors.borderColorDefaultDarker,
|
|
68
|
+
},
|
|
69
|
+
checkedIcon: {
|
|
70
|
+
color: tokens.colorNeutral100White,
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=checkbox_row.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox_row.js","sourceRoot":"","sources":["../../../../src/screens/conversation_filter_recipients/components/checkbox_row.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAA;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,qBAAq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AQ;YACpB,GAAG,EAAE,EAAE;YACP,OAAO,EAAE,EAAE;YACX,cAAc,EAAE,CAAC;YACjB,cAAc,EAAE,MAAM,CAAC,qBAAqB;YAC5C,eAAe,EAAE,MAAM,CAAC,eAAe;SACxC;QACD,kBAAkB,EAAE;YAClB,OAAO,EAAE,GAAG;SACb;QACD,KAAK,EAAE;YACL,IAAI,EAAE,CAAC;SACR;QACD,gBAAgB,EAAE;YAChB,GAAG,kBAAkB;YACrB,eAAe,EAAE,MAAM,CAAC,iBAAiB;SAC1C;QACD,kBAAkB,EAAE;YAClB,GAAG,kBAAkB;YACrB,WAAW,EAAE,CAAC;YACd,WAAW,EAAE,MAAM,CAAC,wBAAwB;SAC7C;QACD,WAAW,EAAE;YACX,KAAK,EAAE,MAAM,CAAC,oBAAoB;SACnC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { Pressable, View, StyleSheet, type ViewStyle } from 'react-native'\nimport { useTheme } from '../../../hooks'\nimport { Icon, Text } from '../../../components'\nimport { tokens } from '../../../vendor/tapestry/tokens'\nimport { ConversationFilterRecipientsScreenProps, TeamProps } from '../types'\nimport { type RouteProp, useRoute } from '@react-navigation/native'\nimport { useFilterRecipientsContext } from '../context/conversation_filter_recipients_context'\n\ninterface TeamRowProps {\n data: TeamProps\n style?: ViewStyle\n accessibilityLabelledBy: string\n}\n\nexport const CheckboxRow = ({ data, style, accessibilityLabelledBy }: TeamRowProps) => {\n const styles = useStyles()\n const route = useRoute<RouteProp<ConversationFilterRecipientsScreenProps['route']>>()\n const { setTeamFilters } = useFilterRecipientsContext()\n\n const { teamId, teamName } = data\n const { team_ids: currentTeamIds } = route.params\n\n const checked = currentTeamIds?.includes(teamId) ?? false\n const newTeamIdAdded = [...(currentTeamIds ?? []), teamId]\n const newTeamIdRemoved = (currentTeamIds ?? []).filter(currentId => currentId !== teamId)\n\n const handlePress = () => {\n setTeamFilters({\n team_ids: checked ? newTeamIdRemoved : newTeamIdAdded,\n })\n }\n\n return (\n <Pressable\n style={({ pressed }) => [styles.checkboxRow, pressed && styles.checkboxRowPressed, style]}\n onPress={handlePress}\n accessibilityRole=\"checkbox\"\n accessibilityState={{ checked }}\n accessibilityLabelledBy={accessibilityLabelledBy}\n accessibilityLabel={`${teamName} team`}\n >\n <CheckboxIcon checked={checked} />\n <Text style={styles.label} numberOfLines={2}>\n {teamName}\n </Text>\n </Pressable>\n )\n}\n\nfunction CheckboxIcon({ checked }: { checked: boolean }) {\n const styles = useStyles()\n const checkedStyle = checked ? styles.checkedContainer : styles.uncheckedContainer\n\n return (\n <View style={checkedStyle}>\n {checked && <Icon name=\"general.thickCheckmark\" style={styles.checkedIcon} />}\n </View>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n\n const baseCheckboxStyles: ViewStyle = {\n width: 20,\n height: 20,\n borderRadius: 40,\n alignItems: 'center',\n justifyContent: 'center',\n }\n\n return StyleSheet.create({\n checkboxRow: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 12,\n padding: 16,\n borderTopWidth: 1,\n borderTopColor: colors.borderColorDefaultDim,\n backgroundColor: colors.surfaceColor100,\n },\n checkboxRowPressed: {\n opacity: 0.5,\n },\n label: {\n flex: 1,\n },\n checkedContainer: {\n ...baseCheckboxStyles,\n backgroundColor: colors.statusSuccessIcon,\n },\n uncheckedContainer: {\n ...baseCheckboxStyles,\n borderWidth: 2,\n borderColor: colors.borderColorDefaultDarker,\n },\n checkedIcon: {\n color: tokens.colorNeutral100White,\n },\n })\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ViewStyle } from 'react-native';
|
|
2
|
+
import type { ServiceTypeProps } from '../types';
|
|
3
|
+
interface HeaderRowProps {
|
|
4
|
+
data: ServiceTypeProps;
|
|
5
|
+
nativeID: string;
|
|
6
|
+
style?: ViewStyle;
|
|
7
|
+
}
|
|
8
|
+
export declare const HeaderRow: ({ data, nativeID, style }: HeaderRowProps) => import("react").JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=header_row.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header_row.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversation_filter_recipients/components/header_row.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AAG/D,OAAO,KAAK,EAA2C,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAQzF,UAAU,cAAc;IACtB,IAAI,EAAE,gBAAgB,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,SAAS,CAAA;CAClB;AAED,eAAO,MAAM,SAAS,8BAA+B,cAAc,gCAkDlE,CAAA"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { View, StyleSheet } from 'react-native';
|
|
2
|
+
import { useTheme } from '../../../hooks';
|
|
3
|
+
import { Icon, Heading, TextButton } from '../../../components';
|
|
4
|
+
import { tokens } from '../../../vendor/tapestry/tokens';
|
|
5
|
+
import { pluralize } from '../../../utils';
|
|
6
|
+
import { useRoute } from '@react-navigation/native';
|
|
7
|
+
import { useFilterRecipientsContext } from '../context/conversation_filter_recipients_context';
|
|
8
|
+
const BULK_SELECT_LIMIT = 10;
|
|
9
|
+
export const HeaderRow = ({ data, nativeID, style }) => {
|
|
10
|
+
const styles = useStyles();
|
|
11
|
+
const { setTeamFilters } = useFilterRecipientsContext();
|
|
12
|
+
const route = useRoute();
|
|
13
|
+
const { serviceTypeName, teamIdsForServiceType } = data;
|
|
14
|
+
const { team_ids: currentTeamIds = [] } = route.params;
|
|
15
|
+
const newTeamIdsAdded = [...new Set([...currentTeamIds, ...teamIdsForServiceType])];
|
|
16
|
+
const newTeamIdsRemoved = currentTeamIds.filter(id => !teamIdsForServiceType.includes(id));
|
|
17
|
+
const allTeamsSelected = teamIdsForServiceType.every(id => currentTeamIds.includes(id));
|
|
18
|
+
const showSelectAll = teamIdsForServiceType.length <= BULK_SELECT_LIMIT;
|
|
19
|
+
const selectLabel = allTeamsSelected ? 'Deselect' : 'Select';
|
|
20
|
+
const headingAccessibilityHint = `${pluralize(teamIdsForServiceType.length, 'team')} available to select`;
|
|
21
|
+
const selectAllAccessibilityLabel = `${selectLabel} ${pluralize(teamIdsForServiceType.length, 'team')} for ${serviceTypeName}`;
|
|
22
|
+
const handleSelectAll = () => {
|
|
23
|
+
setTeamFilters({
|
|
24
|
+
team_ids: allTeamsSelected ? newTeamIdsRemoved : newTeamIdsAdded,
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
return (<View style={[styles.headerRow, style]}>
|
|
28
|
+
<View style={styles.headerContent}>
|
|
29
|
+
<Icon name="services.folderClosed" style={styles.headerIcon}/>
|
|
30
|
+
<Heading variant="h3" style={styles.headerText} numberOfLines={2} nativeID={nativeID} accessibilityHint={headingAccessibilityHint}>
|
|
31
|
+
{serviceTypeName}
|
|
32
|
+
</Heading>
|
|
33
|
+
</View>
|
|
34
|
+
|
|
35
|
+
{showSelectAll && (<TextButton variant="tertiary" onPress={handleSelectAll} accessibilityLabel={selectAllAccessibilityLabel}>
|
|
36
|
+
{selectLabel} all
|
|
37
|
+
</TextButton>)}
|
|
38
|
+
</View>);
|
|
39
|
+
};
|
|
40
|
+
const useStyles = () => {
|
|
41
|
+
const { colors } = useTheme();
|
|
42
|
+
return StyleSheet.create({
|
|
43
|
+
headerRow: {
|
|
44
|
+
flexDirection: 'row',
|
|
45
|
+
justifyContent: 'space-between',
|
|
46
|
+
alignItems: 'center',
|
|
47
|
+
padding: 16,
|
|
48
|
+
gap: 12,
|
|
49
|
+
backgroundColor: colors.surfaceColor100,
|
|
50
|
+
},
|
|
51
|
+
headerText: {
|
|
52
|
+
fontWeight: 'normal',
|
|
53
|
+
flex: 1,
|
|
54
|
+
color: colors.textColorDefaultPrimary,
|
|
55
|
+
fontSize: tokens.fontSizeSm,
|
|
56
|
+
},
|
|
57
|
+
headerContent: {
|
|
58
|
+
flexDirection: 'row',
|
|
59
|
+
alignItems: 'center',
|
|
60
|
+
gap: 12,
|
|
61
|
+
flex: 1,
|
|
62
|
+
},
|
|
63
|
+
headerIcon: {
|
|
64
|
+
color: colors.interaction,
|
|
65
|
+
fontSize: tokens.fontSizeMd,
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=header_row.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header_row.js","sourceRoot":"","sources":["../../../../src/screens/conversation_filter_recipients/components/header_row.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAA;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAE/D,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,QAAQ,EAAkB,MAAM,0BAA0B,CAAA;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,mDAAmD,CAAA;AAE9F,MAAM,iBAAiB,GAAG,EAAE,CAAA;AAQ5B,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAkB,EAAE,EAAE;IACrE,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,EAAE,cAAc,EAAE,GAAG,0BAA0B,EAAE,CAAA;IACvD,MAAM,KAAK,GAAG,QAAQ,EAA+D,CAAA;IAErF,MAAM,EAAE,eAAe,EAAE,qBAAqB,EAAE,GAAG,IAAI,CAAA;IACvD,MAAM,EAAE,QAAQ,EAAE,cAAc,GAAG,EAAE,EAAE,GAAG,KAAK,CAAC,MAAM,CAAA;IAEtD,MAAM,eAAe,GAAG,CAAC,GA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../../hooks'\nimport { Icon, Heading, TextButton } from '../../../components'\nimport type { ConversationFilterRecipientsScreenProps, ServiceTypeProps } from '../types'\nimport { tokens } from '../../../vendor/tapestry/tokens'\nimport { pluralize } from '../../../utils'\nimport { useRoute, type RouteProp } from '@react-navigation/native'\nimport { useFilterRecipientsContext } from '../context/conversation_filter_recipients_context'\n\nconst BULK_SELECT_LIMIT = 10\n\ninterface HeaderRowProps {\n data: ServiceTypeProps\n nativeID: string\n style?: ViewStyle\n}\n\nexport const HeaderRow = ({ data, nativeID, style }: HeaderRowProps) => {\n const styles = useStyles()\n const { setTeamFilters } = useFilterRecipientsContext()\n const route = useRoute<RouteProp<ConversationFilterRecipientsScreenProps['route']>>()\n\n const { serviceTypeName, teamIdsForServiceType } = data\n const { team_ids: currentTeamIds = [] } = route.params\n\n const newTeamIdsAdded = [...new Set([...currentTeamIds, ...teamIdsForServiceType])]\n const newTeamIdsRemoved = currentTeamIds.filter(id => !teamIdsForServiceType.includes(id))\n\n const allTeamsSelected = teamIdsForServiceType.every(id => currentTeamIds.includes(id))\n const showSelectAll = teamIdsForServiceType.length <= BULK_SELECT_LIMIT\n const selectLabel = allTeamsSelected ? 'Deselect' : 'Select'\n\n const headingAccessibilityHint = `${pluralize(teamIdsForServiceType.length, 'team')} available to select`\n const selectAllAccessibilityLabel = `${selectLabel} ${pluralize(teamIdsForServiceType.length, 'team')} for ${serviceTypeName}`\n\n const handleSelectAll = () => {\n setTeamFilters({\n team_ids: allTeamsSelected ? newTeamIdsRemoved : newTeamIdsAdded,\n })\n }\n\n return (\n <View style={[styles.headerRow, style]}>\n <View style={styles.headerContent}>\n <Icon name=\"services.folderClosed\" style={styles.headerIcon} />\n <Heading\n variant=\"h3\"\n style={styles.headerText}\n numberOfLines={2}\n nativeID={nativeID}\n accessibilityHint={headingAccessibilityHint}\n >\n {serviceTypeName}\n </Heading>\n </View>\n\n {showSelectAll && (\n <TextButton\n variant=\"tertiary\"\n onPress={handleSelectAll}\n accessibilityLabel={selectAllAccessibilityLabel}\n >\n {selectLabel} all\n </TextButton>\n )}\n </View>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n\n return StyleSheet.create({\n headerRow: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: 16,\n gap: 12,\n backgroundColor: colors.surfaceColor100,\n },\n headerText: {\n fontWeight: 'normal',\n flex: 1,\n color: colors.textColorDefaultPrimary,\n fontSize: tokens.fontSizeSm,\n },\n headerContent: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 12,\n flex: 1,\n },\n headerIcon: {\n color: colors.interaction,\n fontSize: tokens.fontSizeMd,\n },\n })\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { HeaderTitleProps } from '@react-navigation/elements';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const FilterHeaderTitle: ({ tintColor }: HeaderTitleProps) => React.JSX.Element;
|
|
4
|
+
export declare const HeaderRightWithContext: () => React.JSX.Element;
|
|
5
|
+
//# sourceMappingURL=navigation_header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation_header.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversation_filter_recipients/components/navigation_header.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAC1E,OAAO,KAAK,MAAM,OAAO,CAAA;AAWzB,eAAO,MAAM,iBAAiB,kBAAmB,gBAAgB,sBAIhE,CAAA;AA+BD,eAAO,MAAM,sBAAsB,yBAMlC,CAAA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { HeaderTitle } from '@react-navigation/elements';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { StyleSheet, View } from 'react-native';
|
|
4
|
+
import { Button, TextButton } from '../../../components';
|
|
5
|
+
import { useRoute } from '@react-navigation/native';
|
|
6
|
+
import { tokens } from '../../../vendor/tapestry/tokens';
|
|
7
|
+
import { FilterRecipientsProvider, useFilterRecipientsContext, } from '../context/conversation_filter_recipients_context';
|
|
8
|
+
export const FilterHeaderTitle = ({ tintColor }) => {
|
|
9
|
+
const styles = useStyles();
|
|
10
|
+
return <HeaderTitle style={[styles.headerTitle, { color: tintColor }]}>Teams I lead</HeaderTitle>;
|
|
11
|
+
};
|
|
12
|
+
const HeaderRight = () => {
|
|
13
|
+
const styles = useStyles();
|
|
14
|
+
const route = useRoute();
|
|
15
|
+
const { resetTeamFilters, applyTeamFilters } = useFilterRecipientsContext();
|
|
16
|
+
const { team_ids } = route.params;
|
|
17
|
+
const noTeamsSelected = team_ids?.length === 0 || !team_ids;
|
|
18
|
+
const applyButtonAccessibilityHint = noTeamsSelected
|
|
19
|
+
? 'Select at least one team to navigate to the final step in creating your conversation.'
|
|
20
|
+
: 'Saves selected teams and navigates to the final step to create your conversation.';
|
|
21
|
+
return (<View style={styles.headerRight}>
|
|
22
|
+
<TextButton onPress={resetTeamFilters} accessibilityHint="Cancels any selected teams and closes this modal.">
|
|
23
|
+
Reset
|
|
24
|
+
</TextButton>
|
|
25
|
+
<Button title="Apply" accessibilityHint={applyButtonAccessibilityHint} onPress={() => applyTeamFilters(route.params)} disabled={noTeamsSelected}/>
|
|
26
|
+
</View>);
|
|
27
|
+
};
|
|
28
|
+
export const HeaderRightWithContext = () => {
|
|
29
|
+
return (<FilterRecipientsProvider>
|
|
30
|
+
<HeaderRight />
|
|
31
|
+
</FilterRecipientsProvider>);
|
|
32
|
+
};
|
|
33
|
+
const useStyles = () => {
|
|
34
|
+
return StyleSheet.create({
|
|
35
|
+
headerTitle: {
|
|
36
|
+
fontSize: tokens.fontSizeLg,
|
|
37
|
+
flex: 1,
|
|
38
|
+
},
|
|
39
|
+
headerRight: {
|
|
40
|
+
flexDirection: 'row',
|
|
41
|
+
gap: 16,
|
|
42
|
+
alignItems: 'center',
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=navigation_header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation_header.js","sourceRoot":"","sources":["../../../../src/screens/conversation_filter_recipients/components/navigation_header.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAoB,MAAM,4BAA4B,CAAA;AAC1E,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAa,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AACxD,OAAO,EACL,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,mDAAmD,CAAA;AAG1D,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAE,SAAS,EAAoB,EAAE,EAAE;IACnE,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAE1B,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;AACnG,CAAC,CAAA;AAED,MAAM,WAAW,GAAG,GAAG,EAAE;IACvB,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,KAAK,GAAG,QAAQ,EAA+D,CAAA;IACrF,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,GAAG,0BAA0B,EAAE,CAAA;IAE3E,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC,MAAM,CAAA;IACjC,MAAM,eAAe,GAAG,QAAQ,EAAE,MAAM,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAA;IAC3D,MAAM,4BAA4B,GAAG,eAAe;QAClD,CAAC,CAAC,uFAAuF;QACzF,CAAC,CAAC,mFAAmF,CAAA;IAEvF,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAC9B;MAAA,CAAC,UAAU,CACT,OAAO,CAAC,CAAC,gBAAgB,CAAC,CAC1B,iBAAiB,CAAC,mDAAmD,CAErE;;MACF,EAAE,UAAU,CACZ;MAAA,CAAC,MAAM,CACL,KAAK,CAAC,OAAO,CACb,iBAAiB,CAAC,CAAC,4BAA4B,CAAC,CAChD,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAC9C,QAAQ,CAAC,CAAC,eAAe,CAAC,EAE9B;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,EAAE;IACzC,OAAO,CACL,CAAC,wBAAwB,CACvB;MAAA,CAAC,WAAW,CAAC,AAAD,EACd;IAAA,EAAE,wBAAwB,CAAC,CAC5B,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,WAAW,EAAE;YACX,QAAQ,EAAE,MAAM,CAAC,UAAU;YAC3B,IAAI,EAAE,CAAC;SACR;QACD,WAAW,EAAE;YACX,aAAa,EAAE,KAAK;YACpB,GAAG,EAAE,EAAE;YACP,UAAU,EAAE,QAAQ;SACrB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { HeaderTitle, HeaderTitleProps } from '@react-navigation/elements'\nimport React from 'react'\nimport { StyleSheet, View } from 'react-native'\nimport { Button, TextButton } from '../../../components'\nimport { RouteProp, useRoute } from '@react-navigation/native'\nimport { tokens } from '../../../vendor/tapestry/tokens'\nimport {\n FilterRecipientsProvider,\n useFilterRecipientsContext,\n} from '../context/conversation_filter_recipients_context'\nimport { ConversationFilterRecipientsScreenProps } from '../types'\n\nexport const FilterHeaderTitle = ({ tintColor }: HeaderTitleProps) => {\n const styles = useStyles()\n\n return <HeaderTitle style={[styles.headerTitle, { color: tintColor }]}>Teams I lead</HeaderTitle>\n}\n\nconst HeaderRight = () => {\n const styles = useStyles()\n const route = useRoute<RouteProp<ConversationFilterRecipientsScreenProps['route']>>()\n const { resetTeamFilters, applyTeamFilters } = useFilterRecipientsContext()\n\n const { team_ids } = route.params\n const noTeamsSelected = team_ids?.length === 0 || !team_ids\n const applyButtonAccessibilityHint = noTeamsSelected\n ? 'Select at least one team to navigate to the final step in creating your conversation.'\n : 'Saves selected teams and navigates to the final step to create your conversation.'\n\n return (\n <View style={styles.headerRight}>\n <TextButton\n onPress={resetTeamFilters}\n accessibilityHint=\"Cancels any selected teams and closes this modal.\"\n >\n Reset\n </TextButton>\n <Button\n title=\"Apply\"\n accessibilityHint={applyButtonAccessibilityHint}\n onPress={() => applyTeamFilters(route.params)}\n disabled={noTeamsSelected}\n />\n </View>\n )\n}\n\nexport const HeaderRightWithContext = () => {\n return (\n <FilterRecipientsProvider>\n <HeaderRight />\n </FilterRecipientsProvider>\n )\n}\n\nconst useStyles = () => {\n return StyleSheet.create({\n headerTitle: {\n fontSize: tokens.fontSizeLg,\n flex: 1,\n },\n headerRight: {\n flexDirection: 'row',\n gap: 16,\n alignItems: 'center',\n },\n })\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
import { ConversationFilterRecipientsParams } from '../types';
|
|
4
|
+
export declare const FilterRecipientsContext: React.Context<{
|
|
5
|
+
params: ConversationFilterRecipientsParams;
|
|
6
|
+
resetTeamFilters: () => void;
|
|
7
|
+
setTeamFilters: (params: ConversationFilterRecipientsParams) => void;
|
|
8
|
+
applyTeamFilters: (params: ConversationFilterRecipientsParams) => void;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const FilterRecipientsProvider: ({ children }: PropsWithChildren) => React.JSX.Element;
|
|
11
|
+
export declare const useFilterRecipientsContext: () => {
|
|
12
|
+
params: ConversationFilterRecipientsParams;
|
|
13
|
+
resetTeamFilters: () => void;
|
|
14
|
+
setTeamFilters: (params: ConversationFilterRecipientsParams) => void;
|
|
15
|
+
applyTeamFilters: (params: ConversationFilterRecipientsParams) => void;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=conversation_filter_recipients_context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation_filter_recipients_context.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAiB,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAExD,OAAO,EACL,kCAAkC,EAEnC,MAAM,UAAU,CAAA;AAGjB,eAAO,MAAM,uBAAuB;YAC1B,kCAAkC;sBACxB,MAAM,IAAI;oBACZ,CAAC,MAAM,EAAE,kCAAkC,KAAK,IAAI;sBAClD,CAAC,MAAM,EAAE,kCAAkC,KAAK,IAAI;EAStE,CAAA;AAEF,eAAO,MAAM,wBAAwB,iBAAkB,iBAAiB,sBAwBvE,CAAA;AAED,eAAO,MAAM,0BAA0B;YAxC7B,kCAAkC;sBACxB,MAAM,IAAI;oBACZ,CAAC,MAAM,EAAE,kCAAkC,KAAK,IAAI;sBAClD,CAAC,MAAM,EAAE,kCAAkC,KAAK,IAAI;CAuCvE,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { createContext } from 'react';
|
|
3
|
+
import { StackActions, useNavigation, useRoute } from '@react-navigation/native';
|
|
4
|
+
export const FilterRecipientsContext = createContext({
|
|
5
|
+
params: {
|
|
6
|
+
source_app_name: undefined,
|
|
7
|
+
team_ids: [],
|
|
8
|
+
},
|
|
9
|
+
resetTeamFilters: () => { },
|
|
10
|
+
setTeamFilters: () => { },
|
|
11
|
+
applyTeamFilters: () => { },
|
|
12
|
+
});
|
|
13
|
+
export const FilterRecipientsProvider = ({ children }) => {
|
|
14
|
+
const navigation = useNavigation();
|
|
15
|
+
const route = useRoute();
|
|
16
|
+
const filterContextValue = {
|
|
17
|
+
params: route.params,
|
|
18
|
+
resetTeamFilters: () => {
|
|
19
|
+
navigation.goBack();
|
|
20
|
+
},
|
|
21
|
+
setTeamFilters: (params) => {
|
|
22
|
+
navigation.setParams({
|
|
23
|
+
team_ids: params.team_ids,
|
|
24
|
+
});
|
|
25
|
+
},
|
|
26
|
+
applyTeamFilters: (params) => {
|
|
27
|
+
navigation.dispatch(StackActions.popTo('ConversationNew', params));
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
return (<FilterRecipientsContext.Provider value={filterContextValue}>
|
|
31
|
+
{children}
|
|
32
|
+
</FilterRecipientsContext.Provider>);
|
|
33
|
+
};
|
|
34
|
+
export const useFilterRecipientsContext = () => {
|
|
35
|
+
return React.useContext(FilterRecipientsContext);
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=conversation_filter_recipients_context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation_filter_recipients_context.js","sourceRoot":"","sources":["../../../../src/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,aAAa,EAAqB,MAAM,OAAO,CAAA;AACxD,OAAO,EAAa,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAO3F,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAKjD;IACD,MAAM,EAAE;QACN,eAAe,EAAE,SAAS;QAC1B,QAAQ,EAAE,EAAE;KACb;IACD,gBAAgB,EAAE,GAAG,EAAE,GAAE,CAAC;IAC1B,cAAc,EAAE,GAAG,EAAE,GAAE,CAAC;IACxB,gBAAgB,EAAE,GAAG,EAAE,GAAE,CAAC;CAC3B,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,EAAE,QAAQ,EAAqB,EAAE,EAAE;IAC1E,MAAM,UAAU,GACd,aAAa,EAAsE,CAAA;IACrF,MAAM,KAAK,GAAG,QAAQ,EAA+D,CAAA;IACrF,MAAM,kBAAkB,GAAG;QACzB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,gBAAgB,EAAE,GAAG,EAAE;YACrB,UAAU,CAAC,MAAM,EAAE,CAAA;QACrB,CAAC;QACD,cAAc,EAAE,CAAC,MAAmE,EAAE,EAAE;YACtF,UAAU,CAAC,SAAS,CAAC;gBACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ;aAC1B,CAAC,CAAA;QACJ,CAAC;QACD,gBAAgB,EAAE,CAAC,MAA0C,EAAE,EAAE;YAC/D,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC,CAAA;QACpE,CAAC;KACF,CAAA;IAED,OAAO,CACL,CAAC,uBAAuB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,kBAAkB,CAAC,CAC1D;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,uBAAuB,CAAC,QAAQ,CAAC,CACpC,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,EAAE;IAC7C,OAAO,KAAK,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAA;AAClD,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { createContext, PropsWithChildren } from 'react'\nimport { RouteProp, StackActions, useNavigation, useRoute } from '@react-navigation/native'\nimport {\n ConversationFilterRecipientsParams,\n ConversationFilterRecipientsScreenProps,\n} from '../types'\nimport { NativeStackNavigationProp } from '@react-navigation/native-stack'\n\nexport const FilterRecipientsContext = createContext<{\n params: ConversationFilterRecipientsParams\n resetTeamFilters: () => void\n setTeamFilters: (params: ConversationFilterRecipientsParams) => void\n applyTeamFilters: (params: ConversationFilterRecipientsParams) => void\n}>({\n params: {\n source_app_name: undefined,\n team_ids: [],\n },\n resetTeamFilters: () => {},\n setTeamFilters: () => {},\n applyTeamFilters: () => {},\n})\n\nexport const FilterRecipientsProvider = ({ children }: PropsWithChildren) => {\n const navigation =\n useNavigation<NativeStackNavigationProp<ConversationFilterRecipientsScreenProps>>()\n const route = useRoute<RouteProp<ConversationFilterRecipientsScreenProps['route']>>()\n const filterContextValue = {\n params: route.params,\n resetTeamFilters: () => {\n navigation.goBack()\n },\n setTeamFilters: (params: Omit<ConversationFilterRecipientsParams, 'source_app_name'>) => {\n navigation.setParams({\n team_ids: params.team_ids,\n })\n },\n applyTeamFilters: (params: ConversationFilterRecipientsParams) => {\n navigation.dispatch(StackActions.popTo('ConversationNew', params))\n },\n }\n\n return (\n <FilterRecipientsContext.Provider value={filterContextValue}>\n {children}\n </FilterRecipientsContext.Provider>\n )\n}\n\nexport const useFilterRecipientsContext = () => {\n return React.useContext(FilterRecipientsContext)\n}\n"]}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { StaticScreenProps } from '@react-navigation/native';
|
|
2
1
|
import { NativeStackNavigationOptions } from '@react-navigation/native-stack';
|
|
3
2
|
import React from 'react';
|
|
3
|
+
import { ConversationFilterRecipientsScreenProps } from './types';
|
|
4
4
|
export declare const ConversationFilterReceipientsScreenOptions: NativeStackNavigationOptions;
|
|
5
|
-
type ConversationFilterRecipientsScreenProps = StaticScreenProps<{}>;
|
|
6
5
|
export declare const ConversationFilterRecipientsScreen: ({}: ConversationFilterRecipientsScreenProps) => React.JSX.Element;
|
|
7
|
-
export {};
|
|
8
6
|
//# sourceMappingURL=conversation_filter_recipients_screen.d.ts.map
|
package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation_filter_recipients_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation_filter_recipients/conversation_filter_recipients_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA;AAC7E,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,OAAO,EAAE,uCAAuC,EAAgB,MAAM,SAAS,CAAA;AAW/E,eAAO,MAAM,0CAA0C,EAAE,4BAWxD,CAAA;AAED,eAAO,MAAM,kCAAkC,OAAQ,uCAAuC,sBAmD7F,CAAA"}
|