@planningcenter/chat-react-native 3.42.3-qa-staging.0 → 3.42.3-qa-staging.2
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/attachments/attachment_card.d.ts +3 -3
- package/build/components/conversation/attachments/attachment_card.d.ts.map +1 -1
- package/build/components/conversation/attachments/attachment_card.js +3 -7
- package/build/components/conversation/attachments/attachment_card.js.map +1 -1
- package/build/components/conversation/attachments/attachment_deleting_overlay.d.ts +1 -2
- package/build/components/conversation/attachments/attachment_deleting_overlay.d.ts.map +1 -1
- package/build/components/conversation/attachments/attachment_deleting_overlay.js +12 -7
- package/build/components/conversation/attachments/attachment_deleting_overlay.js.map +1 -1
- package/build/components/conversation/attachments/audio_attachment.d.ts +1 -2
- package/build/components/conversation/attachments/audio_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/audio_attachment.js +6 -23
- package/build/components/conversation/attachments/audio_attachment.js.map +1 -1
- package/build/components/conversation/attachments/expanded_link.d.ts +1 -2
- package/build/components/conversation/attachments/expanded_link.d.ts.map +1 -1
- package/build/components/conversation/attachments/expanded_link.js +2 -8
- package/build/components/conversation/attachments/expanded_link.js.map +1 -1
- package/build/components/conversation/attachments/generic_file_attachment.d.ts +1 -2
- package/build/components/conversation/attachments/generic_file_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/generic_file_attachment.js +2 -12
- package/build/components/conversation/attachments/generic_file_attachment.js.map +1 -1
- package/build/components/conversation/attachments/giphy_attachment.d.ts +1 -2
- package/build/components/conversation/attachments/giphy_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/giphy_attachment.js +2 -7
- package/build/components/conversation/attachments/giphy_attachment.js.map +1 -1
- package/build/components/conversation/attachments/image_attachment.d.ts +1 -2
- package/build/components/conversation/attachments/image_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/image_attachment.js +16 -53
- package/build/components/conversation/attachments/image_attachment.js.map +1 -1
- package/build/components/conversation/attachments/video_attachment.d.ts +1 -2
- package/build/components/conversation/attachments/video_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/video_attachment.js +3 -13
- package/build/components/conversation/attachments/video_attachment.js.map +1 -1
- package/build/components/conversation/conversation_start_banner.d.ts +1 -2
- package/build/components/conversation/conversation_start_banner.d.ts.map +1 -1
- package/build/components/conversation/conversation_start_banner.js +2 -14
- package/build/components/conversation/conversation_start_banner.js.map +1 -1
- package/build/components/conversation/empty_conversation_blank_state.d.ts +1 -1
- package/build/components/conversation/empty_conversation_blank_state.d.ts.map +1 -1
- package/build/components/conversation/empty_conversation_blank_state.js +2 -9
- package/build/components/conversation/empty_conversation_blank_state.js.map +1 -1
- package/build/components/conversation/jump_to_bottom_button.d.ts +1 -1
- package/build/components/conversation/jump_to_bottom_button.d.ts.map +1 -1
- package/build/components/conversation/jump_to_bottom_button.js +2 -10
- package/build/components/conversation/jump_to_bottom_button.js.map +1 -1
- package/build/components/conversation/message.d.ts +1 -2
- package/build/components/conversation/message.d.ts.map +1 -1
- package/build/components/conversation/message.js +2 -53
- package/build/components/conversation/message.js.map +1 -1
- package/build/components/conversation/message_attachments.d.ts +1 -2
- package/build/components/conversation/message_attachments.d.ts.map +1 -1
- package/build/components/conversation/message_attachments.js +17 -21
- package/build/components/conversation/message_attachments.js.map +1 -1
- package/build/components/conversation/message_form/message_form_attachment_file.d.ts +1 -2
- package/build/components/conversation/message_form/message_form_attachment_file.d.ts.map +1 -1
- package/build/components/conversation/message_form/message_form_attachment_file.js +2 -2
- package/build/components/conversation/message_form/message_form_attachment_file.js.map +1 -1
- package/build/components/conversation/message_form/message_form_attachment_image.d.ts +1 -2
- package/build/components/conversation/message_form/message_form_attachment_image.d.ts.map +1 -1
- package/build/components/conversation/message_form/message_form_attachment_image.js +2 -2
- package/build/components/conversation/message_form/message_form_attachment_image.js.map +1 -1
- package/build/components/conversation/message_form/message_form_attachment_video.d.ts +1 -2
- package/build/components/conversation/message_form/message_form_attachment_video.d.ts.map +1 -1
- package/build/components/conversation/message_form/message_form_attachment_video.js +2 -2
- package/build/components/conversation/message_form/message_form_attachment_video.js.map +1 -1
- package/build/components/conversation/message_form.d.ts +5 -6
- package/build/components/conversation/message_form.d.ts.map +1 -1
- package/build/components/conversation/message_form.js +20 -82
- package/build/components/conversation/message_form.js.map +1 -1
- package/build/components/conversation/message_markdown.d.ts +1 -2
- package/build/components/conversation/message_markdown.d.ts.map +1 -1
- package/build/components/conversation/message_markdown.js +8 -16
- package/build/components/conversation/message_markdown.js.map +1 -1
- package/build/components/conversation/message_reaction.d.ts +1 -2
- package/build/components/conversation/message_reaction.d.ts.map +1 -1
- package/build/components/conversation/message_reaction.js +3 -5
- package/build/components/conversation/message_reaction.js.map +1 -1
- package/build/components/conversation/message_read_receipts.d.ts +1 -2
- package/build/components/conversation/message_read_receipts.d.ts.map +1 -1
- package/build/components/conversation/message_read_receipts.js +3 -13
- package/build/components/conversation/message_read_receipts.js.map +1 -1
- package/build/components/conversation/messages_disabled_banners.d.ts +7 -3
- package/build/components/conversation/messages_disabled_banners.d.ts.map +1 -1
- package/build/components/conversation/messages_disabled_banners.js +11 -11
- package/build/components/conversation/messages_disabled_banners.js.map +1 -1
- package/build/components/conversation/reply_connectors.d.ts +2 -2
- package/build/components/conversation/reply_connectors.d.ts.map +1 -1
- package/build/components/conversation/reply_connectors.js +18 -50
- package/build/components/conversation/reply_connectors.js.map +1 -1
- package/build/components/conversation/reply_shadow_message.d.ts +1 -2
- package/build/components/conversation/reply_shadow_message.d.ts.map +1 -1
- package/build/components/conversation/reply_shadow_message.js +16 -46
- package/build/components/conversation/reply_shadow_message.js.map +1 -1
- package/build/components/conversation/system_message.d.ts +1 -2
- package/build/components/conversation/system_message.d.ts.map +1 -1
- package/build/components/conversation/system_message.js +3 -12
- package/build/components/conversation/system_message.js.map +1 -1
- package/build/components/conversation/typing_indicator.d.ts +1 -2
- package/build/components/conversation/typing_indicator.d.ts.map +1 -1
- package/build/components/conversation/typing_indicator.js +3 -13
- package/build/components/conversation/typing_indicator.js.map +1 -1
- package/build/components/conversations/conversation_actions.d.ts +2 -2
- package/build/components/conversations/conversation_actions.d.ts.map +1 -1
- package/build/components/conversations/conversation_actions.js +4 -10
- package/build/components/conversations/conversation_actions.js.map +1 -1
- package/build/components/conversations/conversation_preview.d.ts +2 -3
- package/build/components/conversations/conversation_preview.d.ts.map +1 -1
- package/build/components/conversations/conversation_preview.js +7 -37
- package/build/components/conversations/conversation_preview.js.map +1 -1
- package/build/components/conversations/conversations.d.ts +1 -1
- package/build/components/conversations/conversations.d.ts.map +1 -1
- package/build/components/conversations/conversations.js +16 -17
- package/build/components/conversations/conversations.js.map +1 -1
- package/build/components/conversations/conversations_blank_state.d.ts +1 -2
- package/build/components/conversations/conversations_blank_state.d.ts.map +1 -1
- package/build/components/conversations/conversations_blank_state.js +2 -12
- package/build/components/conversations/conversations_blank_state.js.map +1 -1
- package/build/components/conversations/mute_indicator.d.ts +1 -2
- package/build/components/conversations/mute_indicator.d.ts.map +1 -1
- package/build/components/conversations/mute_indicator.js +2 -2
- package/build/components/conversations/mute_indicator.js.map +1 -1
- package/build/components/conversations/swipeable_toggle_button.d.ts +1 -2
- package/build/components/conversations/swipeable_toggle_button.d.ts.map +1 -1
- package/build/components/conversations/swipeable_toggle_button.js +3 -10
- package/build/components/conversations/swipeable_toggle_button.js.map +1 -1
- package/build/components/conversations/unread_count_badge.d.ts +1 -2
- package/build/components/conversations/unread_count_badge.d.ts.map +1 -1
- package/build/components/conversations/unread_count_badge.js +3 -7
- package/build/components/conversations/unread_count_badge.js.map +1 -1
- package/build/components/display/action_button.d.ts +1 -1
- package/build/components/display/action_button.d.ts.map +1 -1
- package/build/components/display/action_button.js +3 -13
- package/build/components/display/action_button.js.map +1 -1
- package/build/components/display/adult_requirement_notice.d.ts +1 -2
- package/build/components/display/adult_requirement_notice.d.ts.map +1 -1
- package/build/components/display/adult_requirement_notice.js +2 -4
- package/build/components/display/adult_requirement_notice.js.map +1 -1
- package/build/components/display/avatar.d.ts +1 -2
- package/build/components/display/avatar.d.ts.map +1 -1
- package/build/components/display/avatar.js +2 -7
- package/build/components/display/avatar.js.map +1 -1
- package/build/components/display/avatar_group.d.ts +1 -2
- package/build/components/display/avatar_group.d.ts.map +1 -1
- package/build/components/display/avatar_group.js +2 -9
- package/build/components/display/avatar_group.js.map +1 -1
- package/build/components/display/badge.d.ts +1 -2
- package/build/components/display/badge.d.ts.map +1 -1
- package/build/components/display/badge.js +6 -37
- package/build/components/display/badge.js.map +1 -1
- package/build/components/display/banner.d.ts +3 -3
- package/build/components/display/banner.d.ts.map +1 -1
- package/build/components/display/banner.js +4 -11
- package/build/components/display/banner.js.map +1 -1
- package/build/components/display/banner_collapsible.d.ts +2 -2
- package/build/components/display/banner_collapsible.d.ts.map +1 -1
- package/build/components/display/banner_collapsible.js +2 -10
- package/build/components/display/banner_collapsible.js.map +1 -1
- package/build/components/display/button.d.ts +1 -2
- package/build/components/display/button.d.ts.map +1 -1
- package/build/components/display/button.js +3 -14
- package/build/components/display/button.js.map +1 -1
- package/build/components/display/child_notice.d.ts +1 -2
- package/build/components/display/child_notice.d.ts.map +1 -1
- package/build/components/display/child_notice.js +3 -15
- package/build/components/display/child_notice.js.map +1 -1
- package/build/components/display/conversation_avatar.d.ts +1 -2
- package/build/components/display/conversation_avatar.d.ts.map +1 -1
- package/build/components/display/conversation_avatar.js +5 -9
- package/build/components/display/conversation_avatar.js.map +1 -1
- package/build/components/display/emoji_avatar.d.ts +1 -2
- package/build/components/display/emoji_avatar.d.ts.map +1 -1
- package/build/components/display/emoji_avatar.js +2 -12
- package/build/components/display/emoji_avatar.js.map +1 -1
- package/build/components/display/file_attachment_preview.d.ts +1 -1
- package/build/components/display/file_attachment_preview.d.ts.map +1 -1
- package/build/components/display/file_attachment_preview.js +3 -17
- package/build/components/display/file_attachment_preview.js.map +1 -1
- package/build/components/display/heading.d.ts +1 -2
- package/build/components/display/heading.d.ts.map +1 -1
- package/build/components/display/heading.js +2 -4
- package/build/components/display/heading.js.map +1 -1
- package/build/components/display/icon.d.ts +1 -2
- package/build/components/display/icon.d.ts.map +1 -1
- package/build/components/display/icon.js +4 -4
- package/build/components/display/icon.js.map +1 -1
- package/build/components/display/icon_avatar.d.ts +1 -2
- package/build/components/display/icon_avatar.d.ts.map +1 -1
- package/build/components/display/icon_avatar.js +2 -12
- package/build/components/display/icon_avatar.js.map +1 -1
- package/build/components/display/icon_button.d.ts +1 -2
- package/build/components/display/icon_button.d.ts.map +1 -1
- package/build/components/display/icon_button.js +3 -5
- package/build/components/display/icon_button.js.map +1 -1
- package/build/components/display/image.d.ts +1 -2
- package/build/components/display/image.d.ts.map +1 -1
- package/build/components/display/image.js +3 -7
- package/build/components/display/image.js.map +1 -1
- package/build/components/display/image_attachment_preview.d.ts +1 -1
- package/build/components/display/image_attachment_preview.d.ts.map +1 -1
- package/build/components/display/image_attachment_preview.js +2 -7
- package/build/components/display/image_attachment_preview.js.map +1 -1
- package/build/components/display/keyboard_view.d.ts +1 -2
- package/build/components/display/keyboard_view.d.ts.map +1 -1
- package/build/components/display/keyboard_view.js +4 -9
- package/build/components/display/keyboard_view.js.map +1 -1
- package/build/components/display/person.d.ts +1 -2
- package/build/components/display/person.d.ts.map +1 -1
- package/build/components/display/person.js +2 -12
- package/build/components/display/person.js.map +1 -1
- package/build/components/display/platform_modal_header_buttons.d.ts +3 -3
- package/build/components/display/platform_modal_header_buttons.d.ts.map +1 -1
- package/build/components/display/platform_modal_header_buttons.js +5 -10
- package/build/components/display/platform_modal_header_buttons.js.map +1 -1
- package/build/components/display/pressable_row.d.ts +1 -1
- package/build/components/display/pressable_row.d.ts.map +1 -1
- package/build/components/display/pressable_row.js +2 -7
- package/build/components/display/pressable_row.js.map +1 -1
- package/build/components/display/spinner.d.ts +1 -2
- package/build/components/display/spinner.d.ts.map +1 -1
- package/build/components/display/spinner.js +3 -9
- package/build/components/display/spinner.js.map +1 -1
- package/build/components/display/switch.d.ts +1 -2
- package/build/components/display/switch.d.ts.map +1 -1
- package/build/components/display/switch.js +2 -2
- package/build/components/display/switch.js.map +1 -1
- package/build/components/display/tabs.d.ts +1 -1
- package/build/components/display/tabs.d.ts.map +1 -1
- package/build/components/display/tabs.js +21 -31
- package/build/components/display/tabs.js.map +1 -1
- package/build/components/display/text.d.ts +1 -2
- package/build/components/display/text.d.ts.map +1 -1
- package/build/components/display/text.js +2 -4
- package/build/components/display/text.js.map +1 -1
- package/build/components/display/text_button.d.ts +1 -2
- package/build/components/display/text_button.d.ts.map +1 -1
- package/build/components/display/text_button.js +3 -8
- package/build/components/display/text_button.js.map +1 -1
- package/build/components/display/text_inline_button.d.ts +1 -2
- package/build/components/display/text_inline_button.d.ts.map +1 -1
- package/build/components/display/text_inline_button.js +4 -5
- package/build/components/display/text_inline_button.js.map +1 -1
- package/build/components/display/text_input.d.ts +1 -1
- package/build/components/display/text_input.d.ts.map +1 -1
- package/build/components/display/text_input.js +2 -1
- package/build/components/display/text_input.js.map +1 -1
- package/build/components/display/toggle_button.d.ts +1 -2
- package/build/components/display/toggle_button.d.ts.map +1 -1
- package/build/components/display/toggle_button.js +3 -9
- package/build/components/display/toggle_button.js.map +1 -1
- package/build/components/display/video_attachment_preview.d.ts +1 -1
- package/build/components/display/video_attachment_preview.d.ts.map +1 -1
- package/build/components/display/video_attachment_preview.js +3 -20
- package/build/components/display/video_attachment_preview.js.map +1 -1
- package/build/components/group_conversation_list.d.ts +1 -1
- package/build/components/group_conversation_list.d.ts.map +1 -1
- package/build/components/group_conversation_list.js +4 -14
- package/build/components/group_conversation_list.js.map +1 -1
- package/build/components/page/component_error_boundary.d.ts +2 -2
- package/build/components/page/component_error_boundary.d.ts.map +1 -1
- package/build/components/page/component_error_boundary.js +2 -4
- package/build/components/page/component_error_boundary.js.map +1 -1
- package/build/components/page/loading.d.ts +1 -2
- package/build/components/page/loading.d.ts.map +1 -1
- package/build/components/page/loading.js +2 -4
- package/build/components/page/loading.js.map +1 -1
- package/build/components/page/page_error_boundary.d.ts +2 -2
- package/build/components/page/page_error_boundary.d.ts.map +1 -1
- package/build/components/page/page_error_boundary.js +11 -32
- package/build/components/page/page_error_boundary.js.map +1 -1
- package/build/components/primitive/avatar_primitive.js +14 -41
- package/build/components/primitive/avatar_primitive.js.map +1 -1
- package/build/components/primitive/banner_primitive.js +10 -18
- package/build/components/primitive/banner_primitive.js.map +1 -1
- package/build/components/primitive/blank_state_primitive.js +8 -12
- package/build/components/primitive/blank_state_primitive.js.map +1 -1
- package/build/components/primitive/form_sheet.d.ts +1 -1
- package/build/components/primitive/form_sheet.d.ts.map +1 -1
- package/build/components/primitive/form_sheet.js +9 -22
- package/build/components/primitive/form_sheet.js.map +1 -1
- package/build/components/safe_area_modal.d.ts +1 -1
- package/build/components/safe_area_modal.d.ts.map +1 -1
- package/build/components/safe_area_modal.js +2 -3
- package/build/components/safe_area_modal.js.map +1 -1
- package/build/contexts/api_provider.d.ts +1 -2
- package/build/contexts/api_provider.d.ts.map +1 -1
- package/build/contexts/api_provider.js +3 -5
- package/build/contexts/api_provider.js.map +1 -1
- package/build/contexts/chat_context.d.ts +2 -1
- package/build/contexts/chat_context.d.ts.map +1 -1
- package/build/contexts/chat_context.js +9 -2
- package/build/contexts/chat_context.js.map +1 -1
- package/build/contexts/conversation_context.d.ts +2 -2
- package/build/contexts/conversation_context.d.ts.map +1 -1
- package/build/contexts/conversation_context.js +3 -2
- package/build/contexts/conversation_context.js.map +1 -1
- package/build/contexts/conversations_context.d.ts +2 -2
- package/build/contexts/conversations_context.d.ts.map +1 -1
- package/build/contexts/conversations_context.js +3 -2
- package/build/contexts/conversations_context.js.map +1 -1
- package/build/contexts/session_context.d.ts +1 -1
- package/build/contexts/session_context.d.ts.map +1 -1
- package/build/contexts/session_context.js +3 -2
- package/build/contexts/session_context.js.map +1 -1
- package/build/hooks/direct_messages/find_direct_message_conversation.d.ts +14 -0
- package/build/hooks/direct_messages/find_direct_message_conversation.d.ts.map +1 -0
- package/build/hooks/direct_messages/find_direct_message_conversation.js +10 -0
- package/build/hooks/direct_messages/find_direct_message_conversation.js.map +1 -0
- package/build/hooks/direct_messages/resolve_message_available_members_link.d.ts +16 -0
- package/build/hooks/direct_messages/resolve_message_available_members_link.d.ts.map +1 -0
- package/build/hooks/direct_messages/resolve_message_available_members_link.js +24 -0
- package/build/hooks/direct_messages/resolve_message_available_members_link.js.map +1 -0
- package/build/hooks/direct_messages/use_find_or_create_direct_message_conversation.d.ts.map +1 -1
- package/build/hooks/direct_messages/use_find_or_create_direct_message_conversation.js +1 -8
- package/build/hooks/direct_messages/use_find_or_create_direct_message_conversation.js.map +1 -1
- package/build/hooks/direct_messages/use_message_available_members.d.ts +6 -0
- package/build/hooks/direct_messages/use_message_available_members.d.ts.map +1 -0
- package/build/hooks/direct_messages/use_message_available_members.js +40 -0
- package/build/hooks/direct_messages/use_message_available_members.js.map +1 -0
- package/build/hooks/direct_messages/use_message_available_members_action.d.ts +6 -0
- package/build/hooks/direct_messages/use_message_available_members_action.d.ts.map +1 -0
- package/build/hooks/direct_messages/use_message_available_members_action.js +30 -0
- package/build/hooks/direct_messages/use_message_available_members_action.js.map +1 -0
- package/build/hooks/index.d.ts +1 -1
- package/build/hooks/index.d.ts.map +1 -1
- package/build/hooks/index.js +1 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/use_animated_message_background_color.d.ts +2 -2
- package/build/hooks/use_conversation.d.ts +1 -1
- package/build/hooks/use_conversation.d.ts.map +1 -1
- package/build/hooks/use_conversation.js +1 -0
- package/build/hooks/use_conversation.js.map +1 -1
- package/build/hooks/use_conversation_membership.d.ts +1 -1
- package/build/hooks/use_conversation_membership.d.ts.map +1 -1
- package/build/hooks/use_conversations_actions.d.ts +36 -36
- package/build/hooks/use_current_person.d.ts.map +1 -1
- package/build/hooks/use_current_person.js +1 -0
- package/build/hooks/use_current_person.js.map +1 -1
- package/build/hooks/use_direct_messages_eligible.d.ts +2 -0
- package/build/hooks/use_direct_messages_eligible.d.ts.map +1 -0
- package/build/hooks/use_direct_messages_eligible.js +9 -0
- package/build/hooks/use_direct_messages_eligible.js.map +1 -0
- package/build/hooks/use_features.d.ts +0 -1
- package/build/hooks/use_features.d.ts.map +1 -1
- package/build/hooks/use_features.js +0 -1
- package/build/hooks/use_features.js.map +1 -1
- package/build/hooks/use_person_settings.d.ts +1 -1
- package/build/index.d.ts +2 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js.map +1 -1
- package/build/navigation/chat_access_gate.d.ts +2 -2
- package/build/navigation/chat_access_gate.d.ts.map +1 -1
- package/build/navigation/chat_access_gate.js +6 -5
- package/build/navigation/chat_access_gate.js.map +1 -1
- package/build/navigation/index.d.ts +37 -39
- package/build/navigation/index.d.ts.map +1 -1
- package/build/navigation/index.js +21 -23
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/screenLayout.d.ts +2 -2
- package/build/navigation/screenLayout.d.ts.map +1 -1
- package/build/navigation/screenLayout.js +3 -9
- package/build/navigation/screenLayout.js.map +1 -1
- package/build/polyfills/events/EventTarget.d.ts +1 -1
- package/build/polyfills/events/EventTarget.d.ts.map +1 -1
- package/build/polyfills/events/EventTarget.js.map +1 -1
- package/build/screens/age_check/age_check_required_screen.d.ts +1 -2
- package/build/screens/age_check/age_check_required_screen.d.ts.map +1 -1
- package/build/screens/age_check/age_check_required_screen.js +3 -46
- package/build/screens/age_check/age_check_required_screen.js.map +1 -1
- package/build/screens/age_check/age_check_underage_screen.d.ts +1 -2
- package/build/screens/age_check/age_check_underage_screen.d.ts.map +1 -1
- package/build/screens/age_check/age_check_underage_screen.js +2 -25
- package/build/screens/age_check/age_check_underage_screen.js.map +1 -1
- package/build/screens/age_check/components/age_check_select_birthdate_modal.d.ts +1 -2
- package/build/screens/age_check/components/age_check_select_birthdate_modal.d.ts.map +1 -1
- package/build/screens/age_check/components/age_check_select_birthdate_modal.js +6 -25
- package/build/screens/age_check/components/age_check_select_birthdate_modal.js.map +1 -1
- package/build/screens/attachment_actions/attachment_actions_screen.d.ts +1 -2
- package/build/screens/attachment_actions/attachment_actions_screen.d.ts.map +1 -1
- package/build/screens/attachment_actions/attachment_actions_screen.js +3 -5
- package/build/screens/attachment_actions/attachment_actions_screen.js.map +1 -1
- package/build/screens/avatar_picker/avatar_picker_screen.d.ts +1 -2
- package/build/screens/avatar_picker/avatar_picker_screen.d.ts.map +1 -1
- package/build/screens/avatar_picker/avatar_picker_screen.js +9 -36
- package/build/screens/avatar_picker/avatar_picker_screen.js.map +1 -1
- package/build/screens/avatar_picker/avatar_preview.d.ts +1 -1
- package/build/screens/avatar_picker/avatar_preview.d.ts.map +1 -1
- package/build/screens/avatar_picker/avatar_preview.js +5 -9
- package/build/screens/avatar_picker/avatar_preview.js.map +1 -1
- package/build/screens/avatar_picker/color_picker.d.ts +1 -2
- package/build/screens/avatar_picker/color_picker.d.ts.map +1 -1
- package/build/screens/avatar_picker/color_picker.js +4 -5
- package/build/screens/avatar_picker/color_picker.js.map +1 -1
- package/build/screens/avatar_picker/emoji_tab.d.ts +1 -2
- package/build/screens/avatar_picker/emoji_tab.d.ts.map +1 -1
- package/build/screens/avatar_picker/emoji_tab.js +12 -13
- package/build/screens/avatar_picker/emoji_tab.js.map +1 -1
- package/build/screens/avatar_picker/icon_grid.d.ts +1 -2
- package/build/screens/avatar_picker/icon_grid.d.ts.map +1 -1
- package/build/screens/avatar_picker/icon_grid.js +4 -5
- package/build/screens/avatar_picker/icon_grid.js.map +1 -1
- package/build/screens/avatar_picker/upload_tab.d.ts +1 -2
- package/build/screens/avatar_picker/upload_tab.d.ts.map +1 -1
- package/build/screens/avatar_picker/upload_tab.js +3 -4
- package/build/screens/avatar_picker/upload_tab.js.map +1 -1
- package/build/screens/bug_report_screen.d.ts +1 -2
- package/build/screens/bug_report_screen.d.ts.map +1 -1
- package/build/screens/bug_report_screen.js +11 -117
- package/build/screens/bug_report_screen.js.map +1 -1
- package/build/screens/conversation/message_read_receipts_screen.d.ts +1 -2
- package/build/screens/conversation/message_read_receipts_screen.d.ts.map +1 -1
- package/build/screens/conversation/message_read_receipts_screen.js +4 -20
- package/build/screens/conversation/message_read_receipts_screen.js.map +1 -1
- package/build/screens/conversation_details_screen.d.ts +1 -2
- package/build/screens/conversation_details_screen.d.ts.map +1 -1
- package/build/screens/conversation_details_screen.js +43 -106
- package/build/screens/conversation_details_screen.js.map +1 -1
- package/build/screens/conversation_filter_recipients/components/checkbox_row.d.ts +1 -1
- package/build/screens/conversation_filter_recipients/components/checkbox_row.d.ts.map +1 -1
- package/build/screens/conversation_filter_recipients/components/checkbox_row.js +3 -9
- package/build/screens/conversation_filter_recipients/components/checkbox_row.js.map +1 -1
- package/build/screens/conversation_filter_recipients/components/header_row.d.ts +1 -1
- package/build/screens/conversation_filter_recipients/components/header_row.d.ts.map +1 -1
- package/build/screens/conversation_filter_recipients/components/header_row.js +2 -12
- package/build/screens/conversation_filter_recipients/components/header_row.js.map +1 -1
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts +1 -2
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts.map +1 -1
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js +20 -44
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js.map +1 -1
- package/build/screens/conversation_filters/components/conversation_filters.d.ts +1 -2
- package/build/screens/conversation_filters/components/conversation_filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/components/conversation_filters.js +13 -14
- package/build/screens/conversation_filters/components/conversation_filters.js.map +1 -1
- package/build/screens/conversation_filters/components/rows.d.ts +6 -6
- package/build/screens/conversation_filters/components/rows.d.ts.map +1 -1
- package/build/screens/conversation_filters/components/rows.js +7 -34
- package/build/screens/conversation_filters/components/rows.js.map +1 -1
- package/build/screens/conversation_filters/context/conversation_filter_context.d.ts +1 -1
- package/build/screens/conversation_filters/context/conversation_filter_context.d.ts.map +1 -1
- package/build/screens/conversation_filters/context/conversation_filter_context.js +2 -1
- package/build/screens/conversation_filters/context/conversation_filter_context.js.map +1 -1
- package/build/screens/conversation_filters/group_filters.d.ts +1 -2
- package/build/screens/conversation_filters/group_filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/group_filters.js +2 -2
- package/build/screens/conversation_filters/group_filters.js.map +1 -1
- package/build/screens/conversation_filters/team_filters.d.ts +1 -2
- package/build/screens/conversation_filters/team_filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/team_filters.js +2 -2
- package/build/screens/conversation_filters/team_filters.js.map +1 -1
- package/build/screens/conversation_filters_screen.d.ts +1 -2
- package/build/screens/conversation_filters_screen.d.ts.map +1 -1
- package/build/screens/conversation_filters_screen.js +4 -16
- package/build/screens/conversation_filters_screen.js.map +1 -1
- package/build/screens/conversation_new/components/avatar_selection_row.d.ts +2 -3
- package/build/screens/conversation_new/components/avatar_selection_row.d.ts.map +1 -1
- package/build/screens/conversation_new/components/avatar_selection_row.js +6 -16
- package/build/screens/conversation_new/components/avatar_selection_row.js.map +1 -1
- package/build/screens/conversation_new/components/filter_by_plan.d.ts +3 -4
- package/build/screens/conversation_new/components/filter_by_plan.d.ts.map +1 -1
- package/build/screens/conversation_new/components/filter_by_plan.js +22 -46
- package/build/screens/conversation_new/components/filter_by_plan.js.map +1 -1
- package/build/screens/conversation_new/components/form_list.d.ts +2 -3
- package/build/screens/conversation_new/components/form_list.d.ts.map +1 -1
- package/build/screens/conversation_new/components/form_list.js +4 -6
- package/build/screens/conversation_new/components/form_list.js.map +1 -1
- package/build/screens/conversation_new/components/gender_filter_toggle.d.ts +1 -2
- package/build/screens/conversation_new/components/gender_filter_toggle.d.ts.map +1 -1
- package/build/screens/conversation_new/components/gender_filter_toggle.js +4 -20
- package/build/screens/conversation_new/components/gender_filter_toggle.js.map +1 -1
- package/build/screens/conversation_new/components/groups_form.d.ts +1 -2
- package/build/screens/conversation_new/components/groups_form.d.ts.map +1 -1
- package/build/screens/conversation_new/components/groups_form.js +4 -30
- package/build/screens/conversation_new/components/groups_form.js.map +1 -1
- package/build/screens/conversation_new/components/services_form.d.ts +1 -2
- package/build/screens/conversation_new/components/services_form.d.ts.map +1 -1
- package/build/screens/conversation_new/components/services_form.js +27 -61
- package/build/screens/conversation_new/components/services_form.js.map +1 -1
- package/build/screens/conversation_new/components/source_app_error_card.d.ts +1 -1
- package/build/screens/conversation_new/components/source_app_error_card.d.ts.map +1 -1
- package/build/screens/conversation_new/components/source_app_error_card.js +2 -3
- package/build/screens/conversation_new/components/source_app_error_card.js.map +1 -1
- package/build/screens/conversation_new/conversation_new_screen.d.ts +1 -2
- package/build/screens/conversation_new/conversation_new_screen.d.ts.map +1 -1
- package/build/screens/conversation_new/conversation_new_screen.js +4 -4
- package/build/screens/conversation_new/conversation_new_screen.js.map +1 -1
- package/build/screens/conversation_notification_level_select_screen.d.ts +1 -2
- package/build/screens/conversation_notification_level_select_screen.d.ts.map +1 -1
- package/build/screens/conversation_notification_level_select_screen.js +4 -6
- package/build/screens/conversation_notification_level_select_screen.js.map +1 -1
- package/build/screens/conversation_screen.d.ts +2 -3
- package/build/screens/conversation_screen.d.ts.map +1 -1
- package/build/screens/conversation_screen.js +26 -65
- package/build/screens/conversation_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/components/groups_recipient_row.d.ts +1 -1
- package/build/screens/conversation_select_recipients/components/groups_recipient_row.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/components/groups_recipient_row.js +2 -1
- package/build/screens/conversation_select_recipients/components/groups_recipient_row.js.map +1 -1
- package/build/screens/conversation_select_recipients/components/recipient_link_row.d.ts +1 -2
- package/build/screens/conversation_select_recipients/components/recipient_link_row.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/components/recipient_link_row.js +2 -15
- package/build/screens/conversation_select_recipients/components/recipient_link_row.js.map +1 -1
- package/build/screens/conversation_select_recipients/components/restricted_group_row.d.ts +1 -2
- package/build/screens/conversation_select_recipients/components/restricted_group_row.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/components/restricted_group_row.js +2 -14
- package/build/screens/conversation_select_recipients/components/restricted_group_row.js.map +1 -1
- package/build/screens/conversation_select_recipients/components/team_recipient_row.d.ts +1 -1
- package/build/screens/conversation_select_recipients/components/team_recipient_row.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/components/team_recipient_row.js +2 -1
- package/build/screens/conversation_select_recipients/components/team_recipient_row.js.map +1 -1
- package/build/screens/conversation_select_recipients/components/view_more_link_row.d.ts +1 -1
- package/build/screens/conversation_select_recipients/components/view_more_link_row.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/components/view_more_link_row.js +2 -5
- package/build/screens/conversation_select_recipients/components/view_more_link_row.js.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_new_entry_screen.d.ts +1 -2
- package/build/screens/conversation_select_recipients/conversation_new_entry_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_new_entry_screen.js +4 -11
- package/build/screens/conversation_select_recipients/conversation_new_entry_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.d.ts +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.js +24 -85
- package/build/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.d.ts +1 -2
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.js +7 -14
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.d.ts +1 -2
- package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.js +15 -18
- package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/types/screen_props.d.ts +2 -0
- package/build/screens/conversation_select_recipients/types/screen_props.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/types/screen_props.js.map +1 -1
- package/build/screens/conversation_select_type_screen.d.ts +1 -2
- package/build/screens/conversation_select_type_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_type_screen.js +7 -17
- package/build/screens/conversation_select_type_screen.js.map +1 -1
- package/build/screens/conversations/components/chat_group_badge.d.ts +1 -2
- package/build/screens/conversations/components/chat_group_badge.d.ts.map +1 -1
- package/build/screens/conversations/components/chat_group_badge.js +3 -4
- package/build/screens/conversations/components/chat_group_badge.js.map +1 -1
- package/build/screens/conversations/components/list_header_action_button.d.ts +1 -2
- package/build/screens/conversations/components/list_header_action_button.d.ts.map +1 -1
- package/build/screens/conversations/components/list_header_action_button.js +3 -5
- package/build/screens/conversations/components/list_header_action_button.js.map +1 -1
- package/build/screens/conversations/components/list_header_component.d.ts +1 -2
- package/build/screens/conversations/components/list_header_component.d.ts.map +1 -1
- package/build/screens/conversations/components/list_header_component.js +22 -45
- package/build/screens/conversations/components/list_header_component.js.map +1 -1
- package/build/screens/conversations/conversations_screen.d.ts +1 -2
- package/build/screens/conversations/conversations_screen.d.ts.map +1 -1
- package/build/screens/conversations/conversations_screen.js +2 -6
- package/build/screens/conversations/conversations_screen.js.map +1 -1
- package/build/screens/design_system_screen.d.ts +1 -2
- package/build/screens/design_system_screen.d.ts.map +1 -1
- package/build/screens/design_system_screen.js +35 -558
- package/build/screens/design_system_screen.js.map +1 -1
- package/build/screens/get_help_screen.d.ts +1 -1
- package/build/screens/get_help_screen.d.ts.map +1 -1
- package/build/screens/get_help_screen.js +4 -25
- package/build/screens/get_help_screen.js.map +1 -1
- package/build/screens/group_notification_level_select_screen.d.ts +1 -2
- package/build/screens/group_notification_level_select_screen.d.ts.map +1 -1
- package/build/screens/group_notification_level_select_screen.js +2 -4
- package/build/screens/group_notification_level_select_screen.js.map +1 -1
- package/build/screens/group_notification_settings_screen.d.ts +1 -2
- package/build/screens/group_notification_settings_screen.d.ts.map +1 -1
- package/build/screens/group_notification_settings_screen.js +3 -25
- package/build/screens/group_notification_settings_screen.js.map +1 -1
- package/build/screens/message_actions_screen.d.ts +1 -2
- package/build/screens/message_actions_screen.d.ts.map +1 -1
- package/build/screens/message_actions_screen.js +12 -28
- package/build/screens/message_actions_screen.js.map +1 -1
- package/build/screens/message_report/components/message_preview.d.ts +1 -2
- package/build/screens/message_report/components/message_preview.d.ts.map +1 -1
- package/build/screens/message_report/components/message_preview.js +2 -22
- package/build/screens/message_report/components/message_preview.js.map +1 -1
- package/build/screens/message_report/components/report_reason_list.d.ts +1 -2
- package/build/screens/message_report/components/report_reason_list.d.ts.map +1 -1
- package/build/screens/message_report/components/report_reason_list.js +4 -13
- package/build/screens/message_report/components/report_reason_list.js.map +1 -1
- package/build/screens/message_report_screen.d.ts +1 -2
- package/build/screens/message_report_screen.d.ts.map +1 -1
- package/build/screens/message_report_screen.js +9 -61
- package/build/screens/message_report_screen.js.map +1 -1
- package/build/screens/not_found.d.ts +1 -2
- package/build/screens/not_found.d.ts.map +1 -1
- package/build/screens/not_found.js +2 -5
- package/build/screens/not_found.js.map +1 -1
- package/build/screens/notification_settings/hooks/groups.d.ts +1 -1
- package/build/screens/notification_settings/hooks/groups.d.ts.map +1 -1
- package/build/screens/notification_settings_screen.d.ts +1 -2
- package/build/screens/notification_settings_screen.d.ts.map +1 -1
- package/build/screens/notification_settings_screen.js +28 -66
- package/build/screens/notification_settings_screen.js.map +1 -1
- package/build/screens/preferred_app_selection_screen.d.ts +1 -2
- package/build/screens/preferred_app_selection_screen.d.ts.map +1 -1
- package/build/screens/preferred_app_selection_screen.js +3 -21
- package/build/screens/preferred_app_selection_screen.js.map +1 -1
- package/build/screens/reactions_screen.d.ts +1 -2
- package/build/screens/reactions_screen.d.ts.map +1 -1
- package/build/screens/reactions_screen.js +7 -19
- package/build/screens/reactions_screen.js.map +1 -1
- package/build/screens/send_giphy_screen.d.ts +1 -2
- package/build/screens/send_giphy_screen.d.ts.map +1 -1
- package/build/screens/send_giphy_screen.js +5 -31
- package/build/screens/send_giphy_screen.js.map +1 -1
- package/build/screens/settings_screen.d.ts +1 -2
- package/build/screens/settings_screen.d.ts.map +1 -1
- package/build/screens/settings_screen.js +6 -28
- package/build/screens/settings_screen.js.map +1 -1
- package/build/screens/system_message_people_screen.d.ts +1 -2
- package/build/screens/system_message_people_screen.d.ts.map +1 -1
- package/build/screens/system_message_people_screen.js +4 -10
- package/build/screens/system_message_people_screen.js.map +1 -1
- package/build/screens/team_conversation_screen.d.ts +1 -1
- package/build/screens/team_conversation_screen.d.ts.map +1 -1
- package/build/screens/team_conversation_screen.js +4 -12
- package/build/screens/team_conversation_screen.js.map +1 -1
- package/build/types/resources/direct_message_candidate.d.ts +1 -0
- package/build/types/resources/direct_message_candidate.d.ts.map +1 -1
- package/build/types/resources/direct_message_candidate.js.map +1 -1
- package/build/types/resources/member.d.ts +1 -0
- package/build/types/resources/member.d.ts.map +1 -1
- package/build/types/resources/member.js.map +1 -1
- package/build/types/resources/member_ability.d.ts +1 -0
- package/build/types/resources/member_ability.d.ts.map +1 -1
- package/build/types/resources/member_ability.js.map +1 -1
- package/build/types/resources/person.d.ts +1 -0
- package/build/types/resources/person.d.ts.map +1 -1
- package/build/types/resources/person.js.map +1 -1
- 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/liquid_glass.d.ts +3 -0
- package/build/utils/liquid_glass.d.ts.map +1 -0
- package/build/utils/liquid_glass.js +9 -0
- package/build/utils/liquid_glass.js.map +1 -0
- package/build/utils/sha_256.js.map +1 -1
- package/build/utils/system_messages.d.ts +1 -1
- package/build/utils/system_messages.d.ts.map +1 -1
- package/build/utils/system_messages.js.map +1 -1
- package/build/utils/theme.d.ts +2 -2
- package/build/utils/theme.d.ts.map +1 -1
- package/build/utils/theme.js +1 -1
- package/build/utils/theme.js.map +1 -1
- package/package.json +12 -12
- package/src/__tests__/hooks/resolve_message_available_members_link.test.ts +72 -0
- package/src/__tests__/hooks/use_attachment_uploader.test.tsx +1 -0
- package/src/__tests__/hooks/use_direct_messages_eligible.test.tsx +77 -0
- package/src/__tests__/hooks/use_font_scale.test.ts +7 -3
- package/src/__tests__/utils/liquid_glass.ts +40 -0
- package/src/__tests__/utils/native_adapters/configuration.ts +1 -1
- package/src/__tests__/utils/system_messages.ts +1 -1
- package/src/__tests__/utils/uri.ts +8 -50
- package/src/__utils__/handlers.ts +5 -6
- package/src/components/conversation/attachments/attachment_deleting_overlay.tsx +10 -3
- package/src/components/conversation/messages_disabled_banners.tsx +31 -4
- package/src/components/page/__tests__/component_error_boundary.test.tsx +1 -1
- package/src/components/page/__tests__/error_boundary.test.tsx +6 -2
- package/src/components/page/__tests__/page_error_boundary.test.tsx +1 -1
- package/src/contexts/chat_context.tsx +8 -0
- package/src/hooks/direct_messages/find_direct_message_conversation.ts +16 -0
- package/src/hooks/direct_messages/resolve_message_available_members_link.ts +42 -0
- package/src/hooks/direct_messages/use_find_or_create_direct_message_conversation.ts +2 -11
- package/src/hooks/direct_messages/use_message_available_members.ts +65 -0
- package/src/hooks/direct_messages/use_message_available_members_action.ts +34 -0
- package/src/hooks/index.ts +1 -1
- package/src/hooks/use_conversation.ts +1 -0
- package/src/hooks/use_current_person.ts +1 -0
- package/src/hooks/use_direct_messages_eligible.ts +11 -0
- package/src/hooks/use_features.ts +0 -1
- package/src/index.tsx +2 -1
- package/src/navigation/index.tsx +2 -2
- package/src/polyfills/events/EventTarget.ts +1 -1
- package/src/screens/conversation_filters/components/conversation_filters.tsx +3 -3
- package/src/screens/conversation_screen.tsx +9 -1
- package/src/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.tsx +18 -4
- package/src/screens/conversation_select_recipients/types/screen_props.tsx +2 -0
- package/src/screens/conversation_select_type_screen.tsx +4 -7
- package/src/screens/conversations/components/list_header_component.tsx +3 -3
- package/src/screens/settings_screen.tsx +3 -3
- package/src/types/resources/direct_message_candidate.ts +5 -0
- package/src/types/resources/member.ts +1 -0
- package/src/types/resources/member_ability.ts +1 -0
- package/src/types/resources/person.ts +1 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/liquid_glass.ts +12 -0
- package/src/utils/sha_256.ts +24 -24
- package/src/utils/system_messages.ts +1 -1
- package/src/utils/theme.ts +3 -8
- package/build/hooks/use_direct_messages_enabled.d.ts +0 -2
- package/build/hooks/use_direct_messages_enabled.d.ts.map +0 -1
- package/build/hooks/use_direct_messages_enabled.js +0 -16
- package/build/hooks/use_direct_messages_enabled.js.map +0 -1
- package/src/hooks/use_direct_messages_enabled.ts +0 -23
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useContext, useMemo } from 'react';
|
|
2
3
|
import { StyleSheet, View } from 'react-native';
|
|
3
4
|
import { FlatList } from 'react-native-gesture-handler';
|
|
4
5
|
import { Heading } from '../../../components';
|
|
5
|
-
import { useAtFontScaleBreakpoint,
|
|
6
|
+
import { useAtFontScaleBreakpoint, useDirectMessagesEligible, useHasDirectMessages, useTheme, } from '../../../hooks';
|
|
6
7
|
import { FilterContext, useFilterContext } from '../context/conversation_filter_context';
|
|
7
8
|
import { FilterTypes } from '../filter_types';
|
|
8
9
|
import { useGroupsToFilter, useTeamsToFilter } from '../hooks/filters';
|
|
@@ -26,9 +27,9 @@ export const ConversationFilters = () => {
|
|
|
26
27
|
const styles = useStyles();
|
|
27
28
|
const { setScrollOffset, params } = useContext(FilterContext);
|
|
28
29
|
const { chat_group_graph_id, group_source_app_name = '', show_direct_messages } = params;
|
|
29
|
-
const
|
|
30
|
+
const directMessagesEligible = useDirectMessagesEligible();
|
|
30
31
|
const hasDirectMessages = useHasDirectMessages();
|
|
31
|
-
const canFilterByDMs =
|
|
32
|
+
const canFilterByDMs = directMessagesEligible && hasDirectMessages;
|
|
32
33
|
const activeFilter = useMemo(() => {
|
|
33
34
|
if (chat_group_graph_id) {
|
|
34
35
|
return FilterTypes.More;
|
|
@@ -118,22 +119,22 @@ export const ConversationFilters = () => {
|
|
|
118
119
|
data: { routeName: 'TeamFilters' },
|
|
119
120
|
},
|
|
120
121
|
];
|
|
121
|
-
return (
|
|
122
|
+
return (_jsx(FlatList, { data: listData, contentContainerStyle: styles.flatlistContainer, nestedScrollEnabled: true, onScroll: e => setScrollOffset(e.nativeEvent.contentOffset.y), renderItem: ({ item }) => {
|
|
122
123
|
switch (item.type) {
|
|
123
124
|
case SectionTypes.header:
|
|
124
|
-
return
|
|
125
|
+
return _jsx(Header, { ...item.data });
|
|
125
126
|
case SectionTypes.filter:
|
|
126
|
-
return
|
|
127
|
+
return _jsx(FilterRow, { ...item.data });
|
|
127
128
|
case SectionTypes.groups:
|
|
128
|
-
return
|
|
129
|
+
return _jsx(GroupRow, { ...item.data });
|
|
129
130
|
case SectionTypes.teams:
|
|
130
|
-
return
|
|
131
|
+
return _jsx(TeamRow, { ...item.data });
|
|
131
132
|
case SectionTypes.more:
|
|
132
|
-
return
|
|
133
|
+
return _jsx(ViewMore, { ...item.data });
|
|
133
134
|
default:
|
|
134
135
|
return null;
|
|
135
136
|
}
|
|
136
|
-
}}
|
|
137
|
+
} }));
|
|
137
138
|
};
|
|
138
139
|
const useStyles = () => {
|
|
139
140
|
const { platformListPaddingBottom } = useFilterContext();
|
|
@@ -175,9 +176,7 @@ const useStyles = () => {
|
|
|
175
176
|
};
|
|
176
177
|
const Header = ({ title, style = {} }) => {
|
|
177
178
|
const styles = useStyles();
|
|
178
|
-
return (
|
|
179
|
-
<Heading variant="h3">{title}</Heading>
|
|
180
|
-
</View>);
|
|
179
|
+
return (_jsx(View, { style: [styles.sectionHeader, style], children: _jsx(Heading, { variant: "h3", children: title }) }));
|
|
181
180
|
};
|
|
182
181
|
const selectActiveWithFirst = (number) => (groups) => {
|
|
183
182
|
const activeGroupIndex = groups.findIndex(group => group.data.isActive);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_filters.js","sourceRoot":"","sources":["../../../../src/screens/conversation_filters/components/conversation_filters.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,IAAI,EAAa,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,oBAAoB,EACpB,QAAQ,GACT,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAA;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACtE,OAAO,EAEL,SAAS,EACT,QAAQ,EAER,OAAO,EAEP,QAAQ,GAET,MAAM,QAAQ,CAAA;AAEf,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,IAAK,YAOJ;AAPD,WAAK,YAAY;IACf,mDAAM,CAAA;IACN,mDAAM,CAAA;IACN,mDAAM,CAAA;IACN,mDAAM,CAAA;IACN,+CAAI,CAAA;IACJ,iDAAK,CAAA;AACP,CAAC,EAPI,YAAY,KAAZ,YAAY,QAOhB;AAiBD,oCAAoC;AACpC,oCAAoC;AACpC,oCAAoC;AAEpC,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,aAAa,CAAC,CAAA;IAC7D,MAAM,EAAE,mBAAmB,EAAE,qBAAqB,GAA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MAAM,gBAAgB,GAAG,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACvE,MAAM,WAAW,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAA;IAE5C,IAAI,CAAC,WAAW,IAAI,gBAAgB,IAAI,MAAM,EAAE,CAAC;QAC/C,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;IAChC,CAAC;IAED,OAAO,CAAC,WAAW,EAAE,GAAG,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;AAClD,CAAC,CAAA","sourcesContent":["import React, { useContext, useMemo } from 'react'\nimport { StyleSheet, View, ViewStyle } from 'react-native'\nimport { FlatList } from 'react-native-gesture-handler'\nimport { Heading } from '../../../components'\nimport {\n useAtFontScaleBreakpoint,\n useDirectMessagesEnabled,\n useHasDirectMessages,\n useTheme,\n} from '../../../hooks'\nimport { FilterContext, useFilterContext } from '../context/conversation_filter_context'\nimport { FilterTypes } from '../filter_types'\nimport { useGroupsToFilter, useTeamsToFilter } from '../hooks/filters'\nimport {\n FilterProps,\n FilterRow,\n GroupRow,\n GroupRowProps,\n TeamRow,\n TeamRowProps,\n ViewMore,\n ViewMoreRowProps,\n} from './rows'\n\n// =========================================\n// ====== Factory Constants & Types ========\n// =========================================\n\nenum SectionTypes {\n filter,\n groups,\n header,\n hidden,\n more,\n teams,\n}\n\ntype SectionListData = Array<\n | DataItem<FilterProps, SectionTypes.filter>\n | DataItem<GroupRowProps, SectionTypes.groups>\n | DataItem<HeaderProps, SectionTypes.header>\n | DataItem<any, SectionTypes.hidden>\n | DataItem<ViewMoreRowProps, SectionTypes.more>\n | DataItem<TeamRowProps, SectionTypes.teams>\n>\n\ninterface DataItem<T, TName extends SectionTypes> {\n type: TName\n data: T\n sectionStyle?: ViewStyle\n}\n\n// =================================\n// ====== Components ===============\n// =================================\n\nexport const ConversationFilters = () => {\n const styles = useStyles()\n const { setScrollOffset, params } = useContext(FilterContext)\n const { chat_group_graph_id, group_source_app_name = '', show_direct_messages } = params\n\n const directMessagesEnabled = useDirectMessagesEnabled()\n const hasDirectMessages = useHasDirectMessages()\n const canFilterByDMs = directMessagesEnabled && hasDirectMessages\n\n const activeFilter: FilterTypes = useMemo(() => {\n if (chat_group_graph_id) {\n return FilterTypes.More\n } else if (/groups/i.test(group_source_app_name)) {\n return FilterTypes.Groups\n } else if (/services/i.test(group_source_app_name)) {\n return FilterTypes.Teams\n } else if (show_direct_messages) {\n return FilterTypes.DirectMessages\n }\n\n return FilterTypes.All\n }, [chat_group_graph_id, group_source_app_name, show_direct_messages])\n\n const { groups = [] } = useGroupsToFilter()\n const { teams = [] } = useTeamsToFilter()\n\n const activeGroupId = chat_group_graph_id\n const isExactGroupFilter = activeFilter === FilterTypes.More\n\n const teamItems: DataItem<TeamRowProps, SectionTypes.teams>[] = teams.map(team => ({\n type: SectionTypes.teams,\n data: {\n team,\n isActive: isExactGroupFilter && team.id.toString() === activeGroupId,\n },\n }))\n\n const groupItems: DataItem<GroupRowProps, SectionTypes.groups>[] = groups.map(group => ({\n type: SectionTypes.groups,\n data: {\n group,\n isActive: isExactGroupFilter && group?.id.toString() === activeGroupId,\n },\n }))\n const groupItemData = selectActiveWithFirst(5)(groupItems)\n const teamItemData = selectActiveWithFirst(5)(teamItems)\n\n const hideAppFilters = groupItems.length < 1 || teamItems.length < 1\n const showGeneralFilters = !hideAppFilters || canFilterByDMs\n\n const listData: SectionListData = [\n {\n type: showGeneralFilters ? SectionTypes.header : SectionTypes.hidden,\n data: { title: 'General Filters' },\n },\n {\n type: showGeneralFilters ? SectionTypes.filter : SectionTypes.hidden,\n data: { filter: FilterTypes.All, isActive: activeFilter === FilterTypes.All },\n },\n {\n type: hideAppFilters ? SectionTypes.hidden : SectionTypes.filter,\n data: {\n filter: FilterTypes.Groups,\n group_source_app_name: 'groups',\n isActive: activeFilter === FilterTypes.Groups,\n },\n },\n {\n type: hideAppFilters ? SectionTypes.hidden : SectionTypes.filter,\n data: {\n filter: FilterTypes.Teams,\n group_source_app_name: 'services',\n isActive: activeFilter === FilterTypes.Teams,\n },\n },\n {\n type: canFilterByDMs ? SectionTypes.filter : SectionTypes.hidden,\n data: {\n filter: FilterTypes.DirectMessages,\n show_direct_messages: true,\n isActive: activeFilter === FilterTypes.DirectMessages,\n },\n },\n {\n type: groupItems.length ? SectionTypes.header : SectionTypes.hidden,\n data: { title: 'Groups', style: styles.extraHeaderScalableSpace },\n },\n ...groupItemData,\n {\n type: groupItems.length > 5 ? SectionTypes.more : SectionTypes.hidden,\n data: { routeName: 'GroupFilters' },\n },\n {\n type: teamItems.length ? SectionTypes.header : SectionTypes.hidden,\n data: { title: 'Teams', style: styles.extraHeaderScalableSpace },\n },\n ...teamItemData,\n {\n type: teamItems.length > 5 ? SectionTypes.more : SectionTypes.hidden,\n data: { routeName: 'TeamFilters' },\n },\n ]\n\n return (\n <FlatList\n data={listData}\n contentContainerStyle={styles.flatlistContainer}\n nestedScrollEnabled={true}\n onScroll={e => setScrollOffset(e.nativeEvent.contentOffset.y)}\n renderItem={({ item }) => {\n switch (item.type) {\n case SectionTypes.header:\n return <Header {...item.data} />\n case SectionTypes.filter:\n return <FilterRow {...item.data} />\n case SectionTypes.groups:\n return <GroupRow {...item.data} />\n case SectionTypes.teams:\n return <TeamRow {...item.data} />\n case SectionTypes.more:\n return <ViewMore {...item.data} />\n default:\n return null\n }\n }}\n />\n )\n}\n\nconst useStyles = () => {\n const { platformListPaddingBottom } = useFilterContext()\n const theme = useTheme()\n const atFontScaleBreakpoint = useAtFontScaleBreakpoint()\n\n return StyleSheet.create({\n flatlistContainer: {\n paddingBottom: platformListPaddingBottom,\n },\n sectionHeader: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n paddingTop: 24,\n paddingBottom: 8,\n paddingHorizontal: 16,\n },\n extraHeaderScalableSpace: {\n marginTop: atFontScaleBreakpoint ? 24 : 0,\n },\n filterBar: {\n backgroundColor: theme.colors.fillColorNeutral100Inverted,\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n paddingHorizontal: 16,\n paddingVertical: 16,\n gap: 8,\n },\n filterBarScroll: {\n elevation: 4,\n boxShadow: '0px 4px 4px rgba(0, 0, 0, 0.1)',\n },\n filterBarActions: {\n flexDirection: 'row',\n gap: 8,\n alignItems: 'center',\n },\n })\n}\n\ntype HeaderProps = {\n title: string\n style?: ViewStyle\n}\n\nconst Header = ({ title, style = {} }: HeaderProps) => {\n const styles = useStyles()\n\n return (\n <View style={[styles.sectionHeader, style]}>\n <Heading variant=\"h3\">{title}</Heading>\n </View>\n )\n}\n\ntype GroupSectionType =\n | DataItem<TeamRowProps, SectionTypes.teams>\n | DataItem<GroupRowProps, SectionTypes.groups>\n\nconst selectActiveWithFirst =\n (number: number) =>\n <T extends GroupSectionType>(groups: T[]): T[] => {\n const activeGroupIndex = groups.findIndex(group => group.data.isActive)\n const activeGroup = groups[activeGroupIndex]\n\n if (!activeGroup || activeGroupIndex <= number) {\n return groups.slice(0, number)\n }\n\n return [activeGroup, ...groups].slice(0, number)\n }\n"]}
|
|
1
|
+
{"version":3,"file":"conversation_filters.js","sourceRoot":"","sources":["../../../../src/screens/conversation_filters/components/conversation_filters.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,IAAI,EAAa,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,oBAAoB,EACpB,QAAQ,GACT,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAA;AACxF,OAAO,EAAE,WAAW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EAAE,KAAK;YACpB,GAAG,EAAE,CAAC;YACN,UAAU,EAAE,QAAQ;SACrB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA;AAOD,MAAM,MAAM,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,GAAG,EAAE,EAAe,EAAE,EAAE;IACpD,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAE1B,OAAO,CACL,KAAC,IAAI,IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,aAAa,EAAE,KAAK,CAAC,YACxC,KAAC,OAAO,IAAC,OAAO,EAAC,IAAI,YAAE,KAAK,GAAW,GAClC,CACR,CAAA;AACH,CAAC,CAAA;AAMD,MAAM,qBAAqB,GACzB,CAAC,MAAc,EAAE,EAAE,CACnB,CAA6B,MAAW,EAAO,EAAE;IAC/C,MAAM,gBAAgB,GAAG,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACvE,MAAM,WAAW,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAA;IAE5C,IAAI,CAAC,WAAW,IAAI,gBAAgB,IAAI,MAAM,EAAE,CAAC;QAC/C,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;IAChC,CAAC;IAED,OAAO,CAAC,WAAW,EAAE,GAAG,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;AAClD,CAAC,CAAA","sourcesContent":["import React, { useContext, useMemo } from 'react'\nimport { StyleSheet, View, ViewStyle } from 'react-native'\nimport { FlatList } from 'react-native-gesture-handler'\nimport { Heading } from '../../../components'\nimport {\n useAtFontScaleBreakpoint,\n useDirectMessagesEligible,\n useHasDirectMessages,\n useTheme,\n} from '../../../hooks'\nimport { FilterContext, useFilterContext } from '../context/conversation_filter_context'\nimport { FilterTypes } from '../filter_types'\nimport { useGroupsToFilter, useTeamsToFilter } from '../hooks/filters'\nimport {\n FilterProps,\n FilterRow,\n GroupRow,\n GroupRowProps,\n TeamRow,\n TeamRowProps,\n ViewMore,\n ViewMoreRowProps,\n} from './rows'\n\n// =========================================\n// ====== Factory Constants & Types ========\n// =========================================\n\nenum SectionTypes {\n filter,\n groups,\n header,\n hidden,\n more,\n teams,\n}\n\ntype SectionListData = Array<\n | DataItem<FilterProps, SectionTypes.filter>\n | DataItem<GroupRowProps, SectionTypes.groups>\n | DataItem<HeaderProps, SectionTypes.header>\n | DataItem<any, SectionTypes.hidden>\n | DataItem<ViewMoreRowProps, SectionTypes.more>\n | DataItem<TeamRowProps, SectionTypes.teams>\n>\n\ninterface DataItem<T, TName extends SectionTypes> {\n type: TName\n data: T\n sectionStyle?: ViewStyle\n}\n\n// =================================\n// ====== Components ===============\n// =================================\n\nexport const ConversationFilters = () => {\n const styles = useStyles()\n const { setScrollOffset, params } = useContext(FilterContext)\n const { chat_group_graph_id, group_source_app_name = '', show_direct_messages } = params\n\n const directMessagesEligible = useDirectMessagesEligible()\n const hasDirectMessages = useHasDirectMessages()\n const canFilterByDMs = directMessagesEligible && hasDirectMessages\n\n const activeFilter: FilterTypes = useMemo(() => {\n if (chat_group_graph_id) {\n return FilterTypes.More\n } else if (/groups/i.test(group_source_app_name)) {\n return FilterTypes.Groups\n } else if (/services/i.test(group_source_app_name)) {\n return FilterTypes.Teams\n } else if (show_direct_messages) {\n return FilterTypes.DirectMessages\n }\n\n return FilterTypes.All\n }, [chat_group_graph_id, group_source_app_name, show_direct_messages])\n\n const { groups = [] } = useGroupsToFilter()\n const { teams = [] } = useTeamsToFilter()\n\n const activeGroupId = chat_group_graph_id\n const isExactGroupFilter = activeFilter === FilterTypes.More\n\n const teamItems: DataItem<TeamRowProps, SectionTypes.teams>[] = teams.map(team => ({\n type: SectionTypes.teams,\n data: {\n team,\n isActive: isExactGroupFilter && team.id.toString() === activeGroupId,\n },\n }))\n\n const groupItems: DataItem<GroupRowProps, SectionTypes.groups>[] = groups.map(group => ({\n type: SectionTypes.groups,\n data: {\n group,\n isActive: isExactGroupFilter && group?.id.toString() === activeGroupId,\n },\n }))\n const groupItemData = selectActiveWithFirst(5)(groupItems)\n const teamItemData = selectActiveWithFirst(5)(teamItems)\n\n const hideAppFilters = groupItems.length < 1 || teamItems.length < 1\n const showGeneralFilters = !hideAppFilters || canFilterByDMs\n\n const listData: SectionListData = [\n {\n type: showGeneralFilters ? SectionTypes.header : SectionTypes.hidden,\n data: { title: 'General Filters' },\n },\n {\n type: showGeneralFilters ? SectionTypes.filter : SectionTypes.hidden,\n data: { filter: FilterTypes.All, isActive: activeFilter === FilterTypes.All },\n },\n {\n type: hideAppFilters ? SectionTypes.hidden : SectionTypes.filter,\n data: {\n filter: FilterTypes.Groups,\n group_source_app_name: 'groups',\n isActive: activeFilter === FilterTypes.Groups,\n },\n },\n {\n type: hideAppFilters ? SectionTypes.hidden : SectionTypes.filter,\n data: {\n filter: FilterTypes.Teams,\n group_source_app_name: 'services',\n isActive: activeFilter === FilterTypes.Teams,\n },\n },\n {\n type: canFilterByDMs ? SectionTypes.filter : SectionTypes.hidden,\n data: {\n filter: FilterTypes.DirectMessages,\n show_direct_messages: true,\n isActive: activeFilter === FilterTypes.DirectMessages,\n },\n },\n {\n type: groupItems.length ? SectionTypes.header : SectionTypes.hidden,\n data: { title: 'Groups', style: styles.extraHeaderScalableSpace },\n },\n ...groupItemData,\n {\n type: groupItems.length > 5 ? SectionTypes.more : SectionTypes.hidden,\n data: { routeName: 'GroupFilters' },\n },\n {\n type: teamItems.length ? SectionTypes.header : SectionTypes.hidden,\n data: { title: 'Teams', style: styles.extraHeaderScalableSpace },\n },\n ...teamItemData,\n {\n type: teamItems.length > 5 ? SectionTypes.more : SectionTypes.hidden,\n data: { routeName: 'TeamFilters' },\n },\n ]\n\n return (\n <FlatList\n data={listData}\n contentContainerStyle={styles.flatlistContainer}\n nestedScrollEnabled={true}\n onScroll={e => setScrollOffset(e.nativeEvent.contentOffset.y)}\n renderItem={({ item }) => {\n switch (item.type) {\n case SectionTypes.header:\n return <Header {...item.data} />\n case SectionTypes.filter:\n return <FilterRow {...item.data} />\n case SectionTypes.groups:\n return <GroupRow {...item.data} />\n case SectionTypes.teams:\n return <TeamRow {...item.data} />\n case SectionTypes.more:\n return <ViewMore {...item.data} />\n default:\n return null\n }\n }}\n />\n )\n}\n\nconst useStyles = () => {\n const { platformListPaddingBottom } = useFilterContext()\n const theme = useTheme()\n const atFontScaleBreakpoint = useAtFontScaleBreakpoint()\n\n return StyleSheet.create({\n flatlistContainer: {\n paddingBottom: platformListPaddingBottom,\n },\n sectionHeader: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n paddingTop: 24,\n paddingBottom: 8,\n paddingHorizontal: 16,\n },\n extraHeaderScalableSpace: {\n marginTop: atFontScaleBreakpoint ? 24 : 0,\n },\n filterBar: {\n backgroundColor: theme.colors.fillColorNeutral100Inverted,\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n paddingHorizontal: 16,\n paddingVertical: 16,\n gap: 8,\n },\n filterBarScroll: {\n elevation: 4,\n boxShadow: '0px 4px 4px rgba(0, 0, 0, 0.1)',\n },\n filterBarActions: {\n flexDirection: 'row',\n gap: 8,\n alignItems: 'center',\n },\n })\n}\n\ntype HeaderProps = {\n title: string\n style?: ViewStyle\n}\n\nconst Header = ({ title, style = {} }: HeaderProps) => {\n const styles = useStyles()\n\n return (\n <View style={[styles.sectionHeader, style]}>\n <Heading variant=\"h3\">{title}</Heading>\n </View>\n )\n}\n\ntype GroupSectionType =\n | DataItem<TeamRowProps, SectionTypes.teams>\n | DataItem<GroupRowProps, SectionTypes.groups>\n\nconst selectActiveWithFirst =\n (number: number) =>\n <T extends GroupSectionType>(groups: T[]): T[] => {\n const activeGroupIndex = groups.findIndex(group => group.data.isActive)\n const activeGroup = groups[activeGroupIndex]\n\n if (!activeGroup || activeGroupIndex <= number) {\n return groups.slice(0, number)\n }\n\n return [activeGroup, ...groups].slice(0, number)\n }\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { ViewStyle } from 'react-native';
|
|
3
3
|
import { GroupResource } from '../../../types/resources/group_resource';
|
|
4
4
|
import { FilterTypes } from '../filter_types';
|
|
@@ -10,24 +10,24 @@ export type FilterProps = {
|
|
|
10
10
|
isActive: boolean;
|
|
11
11
|
filter: FilterTypes;
|
|
12
12
|
};
|
|
13
|
-
export declare const FilterRow: ({ group_source_app_name, show_direct_messages, isActive, filter, }: FilterProps) =>
|
|
13
|
+
export declare const FilterRow: ({ group_source_app_name, show_direct_messages, isActive, filter, }: FilterProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export type GroupRowProps = {
|
|
15
15
|
group: FilteredGroup;
|
|
16
16
|
isActive: boolean;
|
|
17
17
|
};
|
|
18
|
-
export declare const GroupRow: ({ group, isActive }: GroupRowProps) =>
|
|
18
|
+
export declare const GroupRow: ({ group, isActive }: GroupRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
19
|
export type TeamRowProps = {
|
|
20
20
|
team: GroupResource;
|
|
21
21
|
isActive: boolean;
|
|
22
22
|
};
|
|
23
|
-
export declare const TeamRow: ({ team }: TeamRowProps) =>
|
|
23
|
+
export declare const TeamRow: ({ team }: TeamRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
24
|
export type ViewMoreRowProps = {
|
|
25
25
|
routeName: keyof ConversationFilterStackParamList;
|
|
26
26
|
};
|
|
27
|
-
export declare const ViewMore: ({ routeName }: ViewMoreRowProps) =>
|
|
27
|
+
export declare const ViewMore: ({ routeName }: ViewMoreRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
28
|
export declare const PressableRow: ({ children, isActive, onPress, style, }: PropsWithChildren<{
|
|
29
29
|
isActive: boolean;
|
|
30
30
|
onPress: () => void;
|
|
31
31
|
style?: ViewStyle;
|
|
32
|
-
}>) =>
|
|
32
|
+
}>) => import("react/jsx-runtime").JSX.Element;
|
|
33
33
|
//# sourceMappingURL=rows.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rows.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversation_filters/components/rows.tsx"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"rows.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversation_filters/components/rows.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,iBAAiB,EAAc,MAAM,OAAO,CAAA;AAC5D,OAAO,EAAoB,SAAS,EAAE,MAAM,cAAc,CAAA;AAS1D,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAA;AAGvE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,gCAAgC,EAAE,MAAM,iBAAiB,CAAA;AAElE,MAAM,MAAM,WAAW,GAAG;IACxB,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,WAAW,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,SAAS,GAAI,oEAKvB,WAAW,4CAWb,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,aAAa,CAAA;IACpB,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,QAAQ,GAAI,qBAAqB,aAAa,4CA8B1D,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,aAAa,CAAA;IACnB,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,OAAO,GAAI,UAAU,YAAY,4CA6B7C,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAAE,SAAS,EAAE,MAAM,gCAAgC,CAAA;CAAE,CAAA;AAEpF,eAAO,MAAM,QAAQ,GAAI,eAAe,gBAAgB,4CAWvD,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,yCAK1B,iBAAiB,CAAC;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,CAAA;CAAE,CAAC,4CAoBlF,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { PlatformPressable } from '@react-navigation/elements';
|
|
2
3
|
import { useNavigation } from '@react-navigation/native';
|
|
3
|
-
import
|
|
4
|
+
import { useContext } from 'react';
|
|
4
5
|
import { StyleSheet, View } from 'react-native';
|
|
5
6
|
import { Heading, Icon, Image, Text, TextButton } from '../../../components';
|
|
6
7
|
import { useAtFontScaleBreakpoint, useFontScale, useScalableNumberOfLines, useTheme, } from '../../../hooks';
|
|
@@ -9,9 +10,7 @@ import { MAX_FONT_SIZE_MULTIPLIER, platformFontWeightBold } from '../../../utils
|
|
|
9
10
|
import { FilterContext } from '../context/conversation_filter_context';
|
|
10
11
|
export const FilterRow = ({ group_source_app_name, show_direct_messages, isActive, filter, }) => {
|
|
11
12
|
const { setAppFilter } = useContext(FilterContext);
|
|
12
|
-
return (
|
|
13
|
-
<Text>{filter}</Text>
|
|
14
|
-
</PressableRow>);
|
|
13
|
+
return (_jsx(PressableRow, { onPress: () => setAppFilter({ group_source_app_name, show_direct_messages }), isActive: isActive, children: _jsx(Text, { children: filter }) }));
|
|
15
14
|
};
|
|
16
15
|
export const GroupRow = ({ group, isActive }) => {
|
|
17
16
|
const styles = useRowStyles();
|
|
@@ -20,15 +19,7 @@ export const GroupRow = ({ group, isActive }) => {
|
|
|
20
19
|
setGroupFilter({ chat_group_graph_id: group.id });
|
|
21
20
|
};
|
|
22
21
|
const { headerImage, membershipsCount } = group;
|
|
23
|
-
return (
|
|
24
|
-
{headerImage?.thumbnail && (<Image source={{ uri: headerImage?.thumbnail }} resizeMode="cover" style={styles.rowImage} alt=""/>)}
|
|
25
|
-
<View style={styles.rowTextContainer}>
|
|
26
|
-
<Heading variant="h3" style={styles.rowTitle}>
|
|
27
|
-
{group.name}
|
|
28
|
-
</Heading>
|
|
29
|
-
{membershipsCount && (<Text style={styles.rowSubtitle}>{group.membershipsCount} members</Text>)}
|
|
30
|
-
</View>
|
|
31
|
-
</PressableRow>);
|
|
22
|
+
return (_jsxs(PressableRow, { onPress: handleFilterByGroup, isActive: isActive, children: [headerImage?.thumbnail && (_jsx(Image, { source: { uri: headerImage?.thumbnail }, resizeMode: "cover", style: styles.rowImage, alt: "" })), _jsxs(View, { style: styles.rowTextContainer, children: [_jsx(Heading, { variant: "h3", style: styles.rowTitle, children: group.name }), membershipsCount && (_jsxs(Text, { style: styles.rowSubtitle, children: [group.membershipsCount, " members"] }))] })] }));
|
|
32
23
|
};
|
|
33
24
|
export const TeamRow = ({ team }) => {
|
|
34
25
|
const { setGroupFilter } = useContext(FilterContext);
|
|
@@ -44,34 +35,16 @@ export const TeamRow = ({ team }) => {
|
|
|
44
35
|
const servicesTeam = servicesTeams[team.id];
|
|
45
36
|
const concatedServiceTypeNames = servicesTeam?.serviceTypeNames.join(', ');
|
|
46
37
|
const serviceTypeName = concatedServiceTypeNames || servicesTeam?.group;
|
|
47
|
-
return (
|
|
48
|
-
<View style={styles.rowTextContainer}>
|
|
49
|
-
<Heading variant="h3" style={styles.rowTitle}>
|
|
50
|
-
{team.name}
|
|
51
|
-
</Heading>
|
|
52
|
-
<Text numberOfLines={scalableNumberOfLines} style={styles.rowSubtitle}>
|
|
53
|
-
{serviceTypeName}
|
|
54
|
-
</Text>
|
|
55
|
-
</View>
|
|
56
|
-
</PressableRow>);
|
|
38
|
+
return (_jsx(PressableRow, { onPress: handleFilterByGroup, isActive: isActive, children: _jsxs(View, { style: styles.rowTextContainer, children: [_jsx(Heading, { variant: "h3", style: styles.rowTitle, children: team.name }), _jsx(Text, { numberOfLines: scalableNumberOfLines, style: styles.rowSubtitle, children: serviceTypeName })] }) }));
|
|
57
39
|
};
|
|
58
40
|
export const ViewMore = ({ routeName }) => {
|
|
59
41
|
const styles = useRowStyles();
|
|
60
42
|
const navigation = useNavigation();
|
|
61
|
-
return (
|
|
62
|
-
<TextButton onPress={() => navigation.navigate(routeName, {})} style={styles.viewMoreButton}>
|
|
63
|
-
View more
|
|
64
|
-
</TextButton>
|
|
65
|
-
</View>);
|
|
43
|
+
return (_jsx(View, { style: [styles.rowWithoutBorder], children: _jsx(TextButton, { onPress: () => navigation.navigate(routeName, {}), style: styles.viewMoreButton, children: "View more" }) }));
|
|
66
44
|
};
|
|
67
45
|
export const PressableRow = ({ children, isActive, onPress, style, }) => {
|
|
68
46
|
const styles = useRowStyles({ isActive });
|
|
69
|
-
return (
|
|
70
|
-
<View style={styles.row}>
|
|
71
|
-
<View style={[styles.rowInner, style]}>{children}</View>
|
|
72
|
-
<Icon name="general.check" style={styles.rowIconRight} accessibilityElementsHidden maxFontSizeMultiplier={2.5}/>
|
|
73
|
-
</View>
|
|
74
|
-
</PlatformPressable>);
|
|
47
|
+
return (_jsx(PlatformPressable, { style: styles.pressable, onPress: onPress, accessibilityRole: "radio", accessibilityState: { selected: isActive }, children: _jsxs(View, { style: styles.row, children: [_jsx(View, { style: [styles.rowInner, style], children: children }), _jsx(Icon, { name: "general.check", style: styles.rowIconRight, accessibilityElementsHidden: true, maxFontSizeMultiplier: 2.5 })] }) }));
|
|
75
48
|
};
|
|
76
49
|
const ASPECT_RATIO = 16 / 9;
|
|
77
50
|
const THUMBNAIL_WIDTH = 80;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rows.js","sourceRoot":"","sources":["../../../../src/screens/conversation_filters/components/rows.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAkB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxE,OAAO,KAAK,EAA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AAC;SACR;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,eAAe,GAAG,SAAS;YAClC,MAAM,EAAE,gBAAgB,GAAG,SAAS;YACpC,YAAY,EAAE,CAAC,GAAG,SAAS;SAC5B;QACD,YAAY,EAAE;YACZ,QAAQ,EAAE,EAAE;YACZ,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,iBAAiB;YACrC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC1B;QACD,QAAQ,EAAE;YACR,QAAQ,EAAE,EAAE;YACZ,UAAU,EAAE,CAAC;YACb,UAAU,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,sBAAsB;SACjE;QACD,WAAW,EAAE;YACX,KAAK,EAAE,qBAAqB;gBAC1B,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,yBAAyB;gBACxC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,uBAAuB;SACzC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { PlatformPressable } from '@react-navigation/elements'\nimport { NavigationProp, useNavigation } from '@react-navigation/native'\nimport React, { PropsWithChildren, useContext } from 'react'\nimport { StyleSheet, View, ViewStyle } from 'react-native'\nimport { Heading, Icon, Image, Text, TextButton } from '../../../components'\nimport {\n useAtFontScaleBreakpoint,\n useFontScale,\n useScalableNumberOfLines,\n useTheme,\n} from '../../../hooks'\nimport { useServicesTeamsMap } from '../../../hooks/services/use_services_team'\nimport { GroupResource } from '../../../types/resources/group_resource'\nimport { MAX_FONT_SIZE_MULTIPLIER, platformFontWeightBold } from '../../../utils/styles'\nimport { FilterContext } from '../context/conversation_filter_context'\nimport { FilterTypes } from '../filter_types'\nimport { FilteredGroup } from '../hooks/filters'\nimport { ConversationFilterStackParamList } from '../screen_props'\n\nexport type FilterProps = {\n group_source_app_name?: string\n show_direct_messages?: boolean\n isActive: boolean\n filter: FilterTypes\n}\n\nexport const FilterRow = ({\n group_source_app_name,\n show_direct_messages,\n isActive,\n filter,\n}: FilterProps) => {\n const { setAppFilter } = useContext(FilterContext)\n\n return (\n <PressableRow\n onPress={() => setAppFilter({ group_source_app_name, show_direct_messages })}\n isActive={isActive}\n >\n <Text>{filter}</Text>\n </PressableRow>\n )\n}\n\nexport type GroupRowProps = {\n group: FilteredGroup\n isActive: boolean\n}\n\nexport const GroupRow = ({ group, isActive }: GroupRowProps) => {\n const styles = useRowStyles()\n const { setGroupFilter } = useContext(FilterContext)\n\n const handleFilterByGroup = () => {\n setGroupFilter({ chat_group_graph_id: group.id })\n }\n\n const { headerImage, membershipsCount } = group\n\n return (\n <PressableRow onPress={handleFilterByGroup} isActive={isActive}>\n {headerImage?.thumbnail && (\n <Image\n source={{ uri: headerImage?.thumbnail }}\n resizeMode=\"cover\"\n style={styles.rowImage}\n alt=\"\"\n />\n )}\n <View style={styles.rowTextContainer}>\n <Heading variant=\"h3\" style={styles.rowTitle}>\n {group.name}\n </Heading>\n {membershipsCount && (\n <Text style={styles.rowSubtitle}>{group.membershipsCount} members</Text>\n )}\n </View>\n </PressableRow>\n )\n}\n\nexport type TeamRowProps = {\n team: GroupResource\n isActive: boolean\n}\n\nexport const TeamRow = ({ team }: TeamRowProps) => {\n const { setGroupFilter } = useContext(FilterContext)\n const servicesTeams = useServicesTeamsMap()\n const { params } = useContext(FilterContext)\n const { chat_group_graph_id } = params\n const isActive = chat_group_graph_id === team.id.toString()\n const styles = useRowStyles()\n const scalableNumberOfLines = useScalableNumberOfLines()\n\n const handleFilterByGroup = () => {\n setGroupFilter({ chat_group_graph_id: team.id })\n }\n\n const servicesTeam = servicesTeams[team.id]\n const concatedServiceTypeNames = servicesTeam?.serviceTypeNames.join(', ')\n const serviceTypeName = concatedServiceTypeNames || servicesTeam?.group\n\n return (\n <PressableRow onPress={handleFilterByGroup} isActive={isActive}>\n <View style={styles.rowTextContainer}>\n <Heading variant=\"h3\" style={styles.rowTitle}>\n {team.name}\n </Heading>\n <Text numberOfLines={scalableNumberOfLines} style={styles.rowSubtitle}>\n {serviceTypeName}\n </Text>\n </View>\n </PressableRow>\n )\n}\n\nexport type ViewMoreRowProps = { routeName: keyof ConversationFilterStackParamList }\n\nexport const ViewMore = ({ routeName }: ViewMoreRowProps) => {\n const styles = useRowStyles()\n const navigation = useNavigation<NavigationProp<ConversationFilterStackParamList, 'Filters'>>()\n\n return (\n <View style={[styles.rowWithoutBorder]}>\n <TextButton onPress={() => navigation.navigate(routeName, {})} style={styles.viewMoreButton}>\n View more\n </TextButton>\n </View>\n )\n}\n\nexport const PressableRow = ({\n children,\n isActive,\n onPress,\n style,\n}: PropsWithChildren<{ isActive: boolean; onPress: () => void; style?: ViewStyle }>) => {\n const styles = useRowStyles({ isActive })\n return (\n <PlatformPressable\n style={styles.pressable}\n onPress={onPress}\n accessibilityRole=\"radio\"\n accessibilityState={{ selected: isActive }}\n >\n <View style={styles.row}>\n <View style={[styles.rowInner, style]}>{children}</View>\n <Icon\n name=\"general.check\"\n style={styles.rowIconRight}\n accessibilityElementsHidden\n maxFontSizeMultiplier={2.5}\n />\n </View>\n </PlatformPressable>\n )\n}\n\nconst ASPECT_RATIO = 16 / 9\nconst THUMBNAIL_WIDTH = 80\nconst THUMBNAIL_HEIGHT = THUMBNAIL_WIDTH / ASPECT_RATIO\n\nconst useRowStyles = ({ isActive = false }: { isActive?: boolean } = {}) => {\n const theme = useTheme()\n const fontScale = useFontScale({ maxFontSizeMultiplier: MAX_FONT_SIZE_MULTIPLIER })\n const atFontScaleBreakpoint = useAtFontScaleBreakpoint()\n\n return StyleSheet.create({\n pressable: {\n paddingLeft: 16,\n },\n row: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: 12,\n borderBottomWidth: 1,\n borderBottomColor: atFontScaleBreakpoint\n ? theme.colors.borderColorDefaultDark\n : theme.colors.borderColorDefaultBase,\n paddingVertical: 12,\n paddingRight: 16,\n },\n rowInner: {\n flexDirection: atFontScaleBreakpoint ? 'column' : 'row',\n alignItems: atFontScaleBreakpoint ? 'flex-start' : 'center',\n gap: 12,\n flexShrink: 1,\n },\n rowTextContainer: {\n flexShrink: 1,\n },\n rowWithoutBorder: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 12,\n paddingVertical: 12,\n paddingRight: 16,\n paddingLeft: 16,\n },\n viewMoreButton: {\n flex: 1,\n },\n rowImage: {\n width: THUMBNAIL_WIDTH * fontScale,\n height: THUMBNAIL_HEIGHT * fontScale,\n borderRadius: 4 * fontScale,\n },\n rowIconRight: {\n fontSize: 16,\n color: theme.colors.statusSuccessIcon,\n opacity: isActive ? 1 : 0,\n },\n rowTitle: {\n fontSize: 16,\n flexShrink: 1,\n fontWeight: atFontScaleBreakpoint ? 400 : platformFontWeightBold,\n },\n rowSubtitle: {\n color: atFontScaleBreakpoint\n ? theme.colors.textColorDefaultSecondary\n : theme.colors.textColorDefaultPrimary,\n },\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"rows.js","sourceRoot":"","sources":["../../../../src/screens/conversation_filters/components/rows.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAkB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxE,OAAc,EAAqB,UAAU,EAAE,MAAM,OAAO,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,IAAI,EAAa,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAC5E,OAAO,EACL,wBAAwB,EACxB,YAAY,EACZ,wBAAwB,EACxB,QAAQ,GACT,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAA;AAE/E,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AACxF,OAAO,EAAE,aAAa,EA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WAAW,EAAE,EAAE;SAChB;QACD,cAAc,EAAE;YACd,IAAI,EAAE,CAAC;SACR;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,eAAe,GAAG,SAAS;YAClC,MAAM,EAAE,gBAAgB,GAAG,SAAS;YACpC,YAAY,EAAE,CAAC,GAAG,SAAS;SAC5B;QACD,YAAY,EAAE;YACZ,QAAQ,EAAE,EAAE;YACZ,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,iBAAiB;YACrC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC1B;QACD,QAAQ,EAAE;YACR,QAAQ,EAAE,EAAE;YACZ,UAAU,EAAE,CAAC;YACb,UAAU,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,sBAAsB;SACjE;QACD,WAAW,EAAE;YACX,KAAK,EAAE,qBAAqB;gBAC1B,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,yBAAyB;gBACxC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,uBAAuB;SACzC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { PlatformPressable } from '@react-navigation/elements'\nimport { NavigationProp, useNavigation } from '@react-navigation/native'\nimport React, { PropsWithChildren, useContext } from 'react'\nimport { StyleSheet, View, ViewStyle } from 'react-native'\nimport { Heading, Icon, Image, Text, TextButton } from '../../../components'\nimport {\n useAtFontScaleBreakpoint,\n useFontScale,\n useScalableNumberOfLines,\n useTheme,\n} from '../../../hooks'\nimport { useServicesTeamsMap } from '../../../hooks/services/use_services_team'\nimport { GroupResource } from '../../../types/resources/group_resource'\nimport { MAX_FONT_SIZE_MULTIPLIER, platformFontWeightBold } from '../../../utils/styles'\nimport { FilterContext } from '../context/conversation_filter_context'\nimport { FilterTypes } from '../filter_types'\nimport { FilteredGroup } from '../hooks/filters'\nimport { ConversationFilterStackParamList } from '../screen_props'\n\nexport type FilterProps = {\n group_source_app_name?: string\n show_direct_messages?: boolean\n isActive: boolean\n filter: FilterTypes\n}\n\nexport const FilterRow = ({\n group_source_app_name,\n show_direct_messages,\n isActive,\n filter,\n}: FilterProps) => {\n const { setAppFilter } = useContext(FilterContext)\n\n return (\n <PressableRow\n onPress={() => setAppFilter({ group_source_app_name, show_direct_messages })}\n isActive={isActive}\n >\n <Text>{filter}</Text>\n </PressableRow>\n )\n}\n\nexport type GroupRowProps = {\n group: FilteredGroup\n isActive: boolean\n}\n\nexport const GroupRow = ({ group, isActive }: GroupRowProps) => {\n const styles = useRowStyles()\n const { setGroupFilter } = useContext(FilterContext)\n\n const handleFilterByGroup = () => {\n setGroupFilter({ chat_group_graph_id: group.id })\n }\n\n const { headerImage, membershipsCount } = group\n\n return (\n <PressableRow onPress={handleFilterByGroup} isActive={isActive}>\n {headerImage?.thumbnail && (\n <Image\n source={{ uri: headerImage?.thumbnail }}\n resizeMode=\"cover\"\n style={styles.rowImage}\n alt=\"\"\n />\n )}\n <View style={styles.rowTextContainer}>\n <Heading variant=\"h3\" style={styles.rowTitle}>\n {group.name}\n </Heading>\n {membershipsCount && (\n <Text style={styles.rowSubtitle}>{group.membershipsCount} members</Text>\n )}\n </View>\n </PressableRow>\n )\n}\n\nexport type TeamRowProps = {\n team: GroupResource\n isActive: boolean\n}\n\nexport const TeamRow = ({ team }: TeamRowProps) => {\n const { setGroupFilter } = useContext(FilterContext)\n const servicesTeams = useServicesTeamsMap()\n const { params } = useContext(FilterContext)\n const { chat_group_graph_id } = params\n const isActive = chat_group_graph_id === team.id.toString()\n const styles = useRowStyles()\n const scalableNumberOfLines = useScalableNumberOfLines()\n\n const handleFilterByGroup = () => {\n setGroupFilter({ chat_group_graph_id: team.id })\n }\n\n const servicesTeam = servicesTeams[team.id]\n const concatedServiceTypeNames = servicesTeam?.serviceTypeNames.join(', ')\n const serviceTypeName = concatedServiceTypeNames || servicesTeam?.group\n\n return (\n <PressableRow onPress={handleFilterByGroup} isActive={isActive}>\n <View style={styles.rowTextContainer}>\n <Heading variant=\"h3\" style={styles.rowTitle}>\n {team.name}\n </Heading>\n <Text numberOfLines={scalableNumberOfLines} style={styles.rowSubtitle}>\n {serviceTypeName}\n </Text>\n </View>\n </PressableRow>\n )\n}\n\nexport type ViewMoreRowProps = { routeName: keyof ConversationFilterStackParamList }\n\nexport const ViewMore = ({ routeName }: ViewMoreRowProps) => {\n const styles = useRowStyles()\n const navigation = useNavigation<NavigationProp<ConversationFilterStackParamList, 'Filters'>>()\n\n return (\n <View style={[styles.rowWithoutBorder]}>\n <TextButton onPress={() => navigation.navigate(routeName, {})} style={styles.viewMoreButton}>\n View more\n </TextButton>\n </View>\n )\n}\n\nexport const PressableRow = ({\n children,\n isActive,\n onPress,\n style,\n}: PropsWithChildren<{ isActive: boolean; onPress: () => void; style?: ViewStyle }>) => {\n const styles = useRowStyles({ isActive })\n return (\n <PlatformPressable\n style={styles.pressable}\n onPress={onPress}\n accessibilityRole=\"radio\"\n accessibilityState={{ selected: isActive }}\n >\n <View style={styles.row}>\n <View style={[styles.rowInner, style]}>{children}</View>\n <Icon\n name=\"general.check\"\n style={styles.rowIconRight}\n accessibilityElementsHidden\n maxFontSizeMultiplier={2.5}\n />\n </View>\n </PlatformPressable>\n )\n}\n\nconst ASPECT_RATIO = 16 / 9\nconst THUMBNAIL_WIDTH = 80\nconst THUMBNAIL_HEIGHT = THUMBNAIL_WIDTH / ASPECT_RATIO\n\nconst useRowStyles = ({ isActive = false }: { isActive?: boolean } = {}) => {\n const theme = useTheme()\n const fontScale = useFontScale({ maxFontSizeMultiplier: MAX_FONT_SIZE_MULTIPLIER })\n const atFontScaleBreakpoint = useAtFontScaleBreakpoint()\n\n return StyleSheet.create({\n pressable: {\n paddingLeft: 16,\n },\n row: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: 12,\n borderBottomWidth: 1,\n borderBottomColor: atFontScaleBreakpoint\n ? theme.colors.borderColorDefaultDark\n : theme.colors.borderColorDefaultBase,\n paddingVertical: 12,\n paddingRight: 16,\n },\n rowInner: {\n flexDirection: atFontScaleBreakpoint ? 'column' : 'row',\n alignItems: atFontScaleBreakpoint ? 'flex-start' : 'center',\n gap: 12,\n flexShrink: 1,\n },\n rowTextContainer: {\n flexShrink: 1,\n },\n rowWithoutBorder: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 12,\n paddingVertical: 12,\n paddingRight: 16,\n paddingLeft: 16,\n },\n viewMoreButton: {\n flex: 1,\n },\n rowImage: {\n width: THUMBNAIL_WIDTH * fontScale,\n height: THUMBNAIL_HEIGHT * fontScale,\n borderRadius: 4 * fontScale,\n },\n rowIconRight: {\n fontSize: 16,\n color: theme.colors.statusSuccessIcon,\n opacity: isActive ? 1 : 0,\n },\n rowTitle: {\n fontSize: 16,\n flexShrink: 1,\n fontWeight: atFontScaleBreakpoint ? 400 : platformFontWeightBold,\n },\n rowSubtitle: {\n color: atFontScaleBreakpoint\n ? theme.colors.textColorDefaultSecondary\n : theme.colors.textColorDefaultPrimary,\n },\n })\n}\n"]}
|
|
@@ -12,7 +12,7 @@ export declare const FilterContext: React.Context<{
|
|
|
12
12
|
applyFilters: (params: ConversationFiltersParams) => void;
|
|
13
13
|
platformListPaddingBottom: number | undefined;
|
|
14
14
|
}>;
|
|
15
|
-
export declare const FilterProvider: ({ children }: PropsWithChildren) =>
|
|
15
|
+
export declare const FilterProvider: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
export declare const useFilterContext: () => {
|
|
17
17
|
params: ConversationFiltersParams;
|
|
18
18
|
scrollOffset: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_filter_context.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversation_filters/context/conversation_filter_context.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAiB,iBAAiB,EAAY,MAAM,OAAO,CAAA;AAGlE,OAAO,EAAE,yBAAyB,EAAkC,MAAM,iBAAiB,CAAA;AAI3F,eAAO,MAAM,aAAa;YAChB,yBAAyB;kBACnB,MAAM;qBACH,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI;8BACf,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI;iBACrC,MAAM,IAAI;oBACP,CAAC,MAAM,EAAE,yBAAyB,KAAK,IAAI;kBAC7C,CAAC,MAAM,EAAE,yBAAyB,KAAK,IAAI;kBAC3C,CAAC,MAAM,EAAE,yBAAyB,KAAK,IAAI;+BAC9B,MAAM,GAAG,SAAS;EAe7C,CAAA;AAEF,eAAO,MAAM,cAAc,GAAI,cAAc,iBAAiB,
|
|
1
|
+
{"version":3,"file":"conversation_filter_context.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversation_filters/context/conversation_filter_context.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAiB,iBAAiB,EAAY,MAAM,OAAO,CAAA;AAGlE,OAAO,EAAE,yBAAyB,EAAkC,MAAM,iBAAiB,CAAA;AAI3F,eAAO,MAAM,aAAa;YAChB,yBAAyB;kBACnB,MAAM;qBACH,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI;8BACf,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI;iBACrC,MAAM,IAAI;oBACP,CAAC,MAAM,EAAE,yBAAyB,KAAK,IAAI;kBAC7C,CAAC,MAAM,EAAE,yBAAyB,KAAK,IAAI;kBAC3C,CAAC,MAAM,EAAE,yBAAyB,KAAK,IAAI;+BAC9B,MAAM,GAAG,SAAS;EAe7C,CAAA;AAEF,eAAO,MAAM,cAAc,GAAI,cAAc,iBAAiB,4CA+C7D,CAAA;AAED,eAAO,MAAM,gBAAgB;YA1EnB,yBAAyB;kBACnB,MAAM;qBACH,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI;8BACf,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI;iBACrC,MAAM,IAAI;oBACP,CAAC,MAAM,EAAE,yBAAyB,KAAK,IAAI;kBAC7C,CAAC,MAAM,EAAE,yBAAyB,KAAK,IAAI;kBAC3C,CAAC,MAAM,EAAE,yBAAyB,KAAK,IAAI;+BAC9B,MAAM,GAAG,SAAS;CAoE9C,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { StackActions, useNavigation, useRoute } from '@react-navigation/native';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import { createContext, useState } from 'react';
|
|
@@ -60,7 +61,7 @@ export const FilterProvider = ({ children }) => {
|
|
|
60
61
|
navigation.dispatch(StackActions.popTo('Conversations', params));
|
|
61
62
|
},
|
|
62
63
|
};
|
|
63
|
-
return
|
|
64
|
+
return _jsx(FilterContext.Provider, { value: filterContextValue, children: children });
|
|
64
65
|
};
|
|
65
66
|
export const useFilterContext = () => {
|
|
66
67
|
return React.useContext(FilterContext);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_filter_context.js","sourceRoot":"","sources":["../../../../src/screens/conversation_filters/context/conversation_filter_context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAC3F,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,aAAa,EAAqB,QAAQ,EAAE,MAAM,OAAO,CAAA;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAGlE,MAAM,2BAA2B,GAAG,EAAE,CAAA;AAEtC,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAUvC;IACD,MAAM,EAAE;QACN,mBAAmB,EAAE,SAAS;QAC9B,qBAAqB,EAAE,SAAS;QAChC,oBAAoB,EAAE,SAAS;KAChC;IACD,YAAY,EAAE,CAAC;IACf,eAAe,EAAE,GAAG,EAAE,GAAE,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AAmB;gBAC/C,qBAAqB,EAAE,SAAS;gBAChC,oBAAoB,EAAE,SAAS;aAChC,CAAC,CAAA;QACJ,CAAC;QACD,YAAY,EAAE,CAAC,MAA8D,EAAE,EAAE;YAC/E,UAAU,CAAC,SAAS,CAAC;gBACnB,mBAAmB,EAAE,SAAS;gBAC9B,qBAAqB,EAAE,MAAM,CAAC,qBAAqB;gBACnD,oBAAoB,EAAE,MAAM,CAAC,oBAAoB;aAClD,CAAC,CAAA;QACJ,CAAC;QACD,YAAY,EAAE,CAAC,MAAiC,EAAE,EAAE;YAClD,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAA;QAClE,CAAC;KACF,CAAA;IAED,OAAO,
|
|
1
|
+
{"version":3,"file":"conversation_filter_context.js","sourceRoot":"","sources":["../../../../src/screens/conversation_filters/context/conversation_filter_context.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAa,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAC3F,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,aAAa,EAAqB,QAAQ,EAAE,MAAM,OAAO,CAAA;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAGlE,MAAM,2BAA2B,GAAG,EAAE,CAAA;AAEtC,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAUvC;IACD,MAAM,EAAE;QACN,mBAAmB,EAAE,SAAS;QAC9B,qBAAqB,EAAE,SAAS;QAChC,oBAAoB,EAAE,SAAS;KAChC;IACD,YAAY,EAAE,CAAC;IACf,eAAe,EAAE,GAAG,EAAE,GAAE,CAAC;IACzB,wBAAwB,EAAE,GAAG,EAAE,GAAE,CAAC;IAClC,WAAW,EAAE,GAAG,EAAE,GAAE,CAAC;IACrB,cAAc,EAAE,GAAG,EAAE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,EAAE,EAAE;YAC/E,UAAU,CAAC,SAAS,CAAC;gBACnB,mBAAmB,EAAE,SAAS;gBAC9B,qBAAqB,EAAE,MAAM,CAAC,qBAAqB;gBACnD,oBAAoB,EAAE,MAAM,CAAC,oBAAoB;aAClD,CAAC,CAAA;QACJ,CAAC;QACD,YAAY,EAAE,CAAC,MAAiC,EAAE,EAAE;YAClD,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAA;QAClE,CAAC;KACF,CAAA;IAED,OAAO,KAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,kBAAkB,YAAG,QAAQ,GAA0B,CAAA;AAC/F,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,OAAO,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAA;AACxC,CAAC,CAAA","sourcesContent":["import { RouteProp, StackActions, useNavigation, useRoute } from '@react-navigation/native'\nimport React from 'react'\nimport { createContext, PropsWithChildren, useState } from 'react'\nimport { Platform } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { ConversationFiltersParams, ConversationFiltersScreenProps } from '../screen_props'\n\nconst DEFAULT_LIST_PADDING_BOTTOM = 64\n\nexport const FilterContext = createContext<{\n params: ConversationFiltersParams\n scrollOffset: number\n setScrollOffset: (offset: number) => void\n setFormSheetHeaderHeight: (height: number) => void\n resetFilter: () => void\n setGroupFilter: (params: ConversationFiltersParams) => void\n setAppFilter: (params: ConversationFiltersParams) => void\n applyFilters: (params: ConversationFiltersParams) => void\n platformListPaddingBottom: number | undefined\n}>({\n params: {\n chat_group_graph_id: undefined,\n group_source_app_name: undefined,\n show_direct_messages: undefined,\n },\n scrollOffset: 0,\n setScrollOffset: () => {},\n setFormSheetHeaderHeight: () => {},\n resetFilter: () => {},\n setGroupFilter: () => {},\n setAppFilter: () => {},\n applyFilters: () => {},\n platformListPaddingBottom: DEFAULT_LIST_PADDING_BOTTOM,\n})\n\nexport const FilterProvider = ({ children }: PropsWithChildren) => {\n const [scrollOffset, setScrollOffset] = useState(0)\n const [formSheetHeaderHeight, setFormSheetHeaderHeight] = useState(56)\n const navigation = useNavigation()\n const route = useRoute<RouteProp<ConversationFiltersScreenProps['route']>>()\n const { bottom } = useSafeAreaInsets()\n\n const platformListPaddingBottom = Platform.select({\n ios: bottom + formSheetHeaderHeight,\n android: bottom + 12,\n })\n\n const filterContextValue = {\n params: route.params,\n scrollOffset,\n setScrollOffset,\n platformListPaddingBottom,\n setFormSheetHeaderHeight,\n resetFilter: () => {\n navigation.dispatch(\n StackActions.popTo('Conversations', {\n chat_group_graph_id: undefined,\n group_source_app_name: undefined,\n show_direct_messages: undefined,\n })\n )\n },\n setGroupFilter: (params: Omit<ConversationFiltersParams, 'group_source_app_name'>) => {\n navigation.setParams({\n chat_group_graph_id: params.chat_group_graph_id,\n group_source_app_name: undefined,\n show_direct_messages: undefined,\n })\n },\n setAppFilter: (params: Omit<ConversationFiltersParams, 'chat_group_graph_id'>) => {\n navigation.setParams({\n chat_group_graph_id: undefined,\n group_source_app_name: params.group_source_app_name,\n show_direct_messages: params.show_direct_messages,\n })\n },\n applyFilters: (params: ConversationFiltersParams) => {\n navigation.dispatch(StackActions.popTo('Conversations', params))\n },\n }\n\n return <FilterContext.Provider value={filterContextValue}>{children}</FilterContext.Provider>\n}\n\nexport const useFilterContext = () => {\n return React.useContext(FilterContext)\n}\n"]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { StaticScreenProps } from '@react-navigation/native';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import { ConversationFiltersParams } from './screen_props';
|
|
4
3
|
export type GroupFiltersScreenProps = StaticScreenProps<ConversationFiltersParams>;
|
|
5
|
-
export declare const GroupFilters: () =>
|
|
4
|
+
export declare const GroupFilters: () => import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
//# sourceMappingURL=group_filters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group_filters.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation_filters/group_filters.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"group_filters.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation_filters/group_filters.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAQ5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAA;AAE1D,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,CAAC,yBAAyB,CAAC,CAAA;AAElF,eAAO,MAAM,YAAY,+CAkBxB,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { RefreshControl, StyleSheet } from 'react-native';
|
|
3
3
|
import { FlatList } from 'react-native-gesture-handler';
|
|
4
4
|
import { Text } from '../../components/display';
|
|
@@ -10,7 +10,7 @@ export const GroupFilters = () => {
|
|
|
10
10
|
const { groups, fetchNextPage, isRefetching, refetch } = useGroupsToFilter();
|
|
11
11
|
const { params } = useFilterContext();
|
|
12
12
|
const { chat_group_graph_id } = params;
|
|
13
|
-
return (
|
|
13
|
+
return (_jsx(FlatList, { data: groups, renderItem: ({ item }) => (_jsx(GroupRow, { group: item, isActive: item?.id.toString() === chat_group_graph_id })), ListEmptyComponent: _jsx(Text, { children: "No groups available" }), refreshing: isRefetching, refreshControl: _jsx(RefreshControl, { refreshing: isRefetching, onRefresh: refetch }), onEndReached: () => fetchNextPage(), contentContainerStyle: styles.container }));
|
|
14
14
|
};
|
|
15
15
|
const useStyles = () => {
|
|
16
16
|
const { platformListPaddingBottom } = useFilterContext();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group_filters.js","sourceRoot":"","sources":["../../../src/screens/conversation_filters/group_filters.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"group_filters.js","sourceRoot":"","sources":["../../../src/screens/conversation_filters/group_filters.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAKnD,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,iBAAiB,EAAE,CAAA;IAC5E,MAAM,EAAE,MAAM,EAAE,GAAG,gBAAgB,EAAE,CAAA;IACrC,MAAM,EAAE,mBAAmB,EAAE,GAAG,MAAM,CAAA;IACtC,OAAO,CACL,KAAC,QAAQ,IACP,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CACxB,KAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC,QAAQ,EAAE,KAAK,mBAAmB,GAAI,CACjF,EACD,kBAAkB,EAAE,KAAC,IAAI,sCAA2B,EACpD,UAAU,EAAE,YAAY,EACxB,cAAc,EAAE,KAAC,cAAc,IAAC,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,OAAO,GAAI,EAChF,YAAY,EAAE,GAAG,EAAE,CAAC,aAAa,EAAE,EACnC,qBAAqB,EAAE,MAAM,CAAC,SAAS,GACvC,CACH,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,EAAE,yBAAyB,EAAE,GAAG,gBAAgB,EAAE,CAAA;IACxD,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,SAAS,EAAE;YACT,aAAa,EAAE,yBAAyB;SACzC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { StaticScreenProps } from '@react-navigation/native'\nimport React from 'react'\nimport { RefreshControl, StyleSheet } from 'react-native'\nimport { FlatList } from 'react-native-gesture-handler'\nimport { Text } from '../../components/display'\nimport { GroupRow } from './components/rows'\nimport { useFilterContext } from './context/conversation_filter_context'\nimport { useGroupsToFilter } from './hooks/filters'\nimport { ConversationFiltersParams } from './screen_props'\n\nexport type GroupFiltersScreenProps = StaticScreenProps<ConversationFiltersParams>\n\nexport const GroupFilters = () => {\n const styles = useStyles()\n const { groups, fetchNextPage, isRefetching, refetch } = useGroupsToFilter()\n const { params } = useFilterContext()\n const { chat_group_graph_id } = params\n return (\n <FlatList\n data={groups}\n renderItem={({ item }) => (\n <GroupRow group={item} isActive={item?.id.toString() === chat_group_graph_id} />\n )}\n ListEmptyComponent={<Text>No groups available</Text>}\n refreshing={isRefetching}\n refreshControl={<RefreshControl refreshing={isRefetching} onRefresh={refetch} />}\n onEndReached={() => fetchNextPage()}\n contentContainerStyle={styles.container}\n />\n )\n}\n\nconst useStyles = () => {\n const { platformListPaddingBottom } = useFilterContext()\n return StyleSheet.create({\n container: {\n paddingBottom: platformListPaddingBottom,\n },\n })\n}\n"]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { StaticScreenProps } from '@react-navigation/native';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import { ConversationFiltersParams } from './screen_props';
|
|
4
3
|
export type GroupFiltersScreenProps = StaticScreenProps<ConversationFiltersParams>;
|
|
5
|
-
export declare const TeamFilters: () =>
|
|
4
|
+
export declare const TeamFilters: () => import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
//# sourceMappingURL=team_filters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team_filters.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation_filters/team_filters.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"team_filters.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation_filters/team_filters.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAQ5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAA;AAE1D,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,CAAC,yBAAyB,CAAC,CAAA;AAElF,eAAO,MAAM,WAAW,+CAkBvB,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { RefreshControl, StyleSheet } from 'react-native';
|
|
3
3
|
import { FlatList } from 'react-native-gesture-handler';
|
|
4
4
|
import { Text } from '../../components/display';
|
|
@@ -10,7 +10,7 @@ export const TeamFilters = () => {
|
|
|
10
10
|
const { teams, fetchNextPage, isRefetching, refetch } = useTeamsToFilter();
|
|
11
11
|
const { params } = useFilterContext();
|
|
12
12
|
const { chat_group_graph_id } = params;
|
|
13
|
-
return (
|
|
13
|
+
return (_jsx(FlatList, { data: teams, renderItem: ({ item }) => (_jsx(TeamRow, { team: item, isActive: item?.id.toString() === chat_group_graph_id })), refreshing: isRefetching, refreshControl: _jsx(RefreshControl, { refreshing: isRefetching, onRefresh: refetch }), ListEmptyComponent: _jsx(Text, { children: "No teams available" }), onEndReached: () => fetchNextPage(), contentContainerStyle: styles.container }));
|
|
14
14
|
};
|
|
15
15
|
const useStyles = () => {
|
|
16
16
|
const { platformListPaddingBottom } = useFilterContext();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team_filters.js","sourceRoot":"","sources":["../../../src/screens/conversation_filters/team_filters.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"team_filters.js","sourceRoot":"","sources":["../../../src/screens/conversation_filters/team_filters.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAKlD,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE;IAC9B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,gBAAgB,EAAE,CAAA;IAC1E,MAAM,EAAE,MAAM,EAAE,GAAG,gBAAgB,EAAE,CAAA;IACrC,MAAM,EAAE,mBAAmB,EAAE,GAAG,MAAM,CAAA;IACtC,OAAO,CACL,KAAC,QAAQ,IACP,IAAI,EAAE,KAAK,EACX,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CACxB,KAAC,OAAO,IAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC,QAAQ,EAAE,KAAK,mBAAmB,GAAI,CAC/E,EACD,UAAU,EAAE,YAAY,EACxB,cAAc,EAAE,KAAC,cAAc,IAAC,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,OAAO,GAAI,EAChF,kBAAkB,EAAE,KAAC,IAAI,qCAA0B,EACnD,YAAY,EAAE,GAAG,EAAE,CAAC,aAAa,EAAE,EACnC,qBAAqB,EAAE,MAAM,CAAC,SAAS,GACvC,CACH,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,EAAE,yBAAyB,EAAE,GAAG,gBAAgB,EAAE,CAAA;IAExD,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,SAAS,EAAE;YACT,aAAa,EAAE,yBAAyB;SACzC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { StaticScreenProps } from '@react-navigation/native'\nimport React from 'react'\nimport { RefreshControl, StyleSheet } from 'react-native'\nimport { FlatList } from 'react-native-gesture-handler'\nimport { Text } from '../../components/display'\nimport { TeamRow } from './components/rows'\nimport { useFilterContext } from './context/conversation_filter_context'\nimport { useTeamsToFilter } from './hooks/filters'\nimport { ConversationFiltersParams } from './screen_props'\n\nexport type GroupFiltersScreenProps = StaticScreenProps<ConversationFiltersParams>\n\nexport const TeamFilters = () => {\n const styles = useStyles()\n const { teams, fetchNextPage, isRefetching, refetch } = useTeamsToFilter()\n const { params } = useFilterContext()\n const { chat_group_graph_id } = params\n return (\n <FlatList\n data={teams}\n renderItem={({ item }) => (\n <TeamRow team={item} isActive={item?.id.toString() === chat_group_graph_id} />\n )}\n refreshing={isRefetching}\n refreshControl={<RefreshControl refreshing={isRefetching} onRefresh={refetch} />}\n ListEmptyComponent={<Text>No teams available</Text>}\n onEndReached={() => fetchNextPage()}\n contentContainerStyle={styles.container}\n />\n )\n}\n\nconst useStyles = () => {\n const { platformListPaddingBottom } = useFilterContext()\n\n return StyleSheet.create({\n container: {\n paddingBottom: platformListPaddingBottom,\n },\n })\n}\n"]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { ConversationFiltersScreenProps } from './conversation_filters/screen_props';
|
|
3
2
|
export declare const ConversationFiltersScreenOptions: import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
4
|
-
export declare const ConversationFiltersScreen: (_props: ConversationFiltersScreenProps) =>
|
|
3
|
+
export declare const ConversationFiltersScreen: (_props: ConversationFiltersScreenProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
4
|
//# sourceMappingURL=conversation_filters_screen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_filters_screen.d.ts","sourceRoot":"","sources":["../../src/screens/conversation_filters_screen.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"conversation_filters_screen.d.ts","sourceRoot":"","sources":["../../src/screens/conversation_filters_screen.tsx"],"names":[],"mappings":"AAaA,OAAO,EACL,8BAA8B,EAE/B,MAAM,qCAAqC,CAAA;AAG5C,eAAO,MAAM,gCAAgC,uEAO3C,CAAA;AAoCF,eAAO,MAAM,yBAAyB,GAAI,QAAQ,8BAA8B,4CAW/E,CAAA"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { useHeaderHeight } from '@react-navigation/elements';
|
|
2
3
|
import { createComponentForStaticNavigation, useRoute } from '@react-navigation/native';
|
|
3
4
|
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
|
4
|
-
import
|
|
5
|
+
import { useCallback } from 'react';
|
|
5
6
|
import { Platform, StyleSheet, useWindowDimensions, View } from 'react-native';
|
|
6
7
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
7
8
|
import FormSheet, { getFormSheetScreenOptions } from '../components/primitive/form_sheet';
|
|
@@ -51,12 +52,7 @@ const FilterNavigator = createNativeStackNavigator({
|
|
|
51
52
|
const Filters = createComponentForStaticNavigation(FilterNavigator, 'Filters');
|
|
52
53
|
export const ConversationFiltersScreen = (_props) => {
|
|
53
54
|
const styles = useStyles();
|
|
54
|
-
return (
|
|
55
|
-
<FormSheet.Root contentStyle={styles.contentContainer} showAndroidSheetGrabber={false}>
|
|
56
|
-
<FormSheetHeaderWithContext />
|
|
57
|
-
<Filters />
|
|
58
|
-
</FormSheet.Root>
|
|
59
|
-
</FilterProvider>);
|
|
55
|
+
return (_jsx(FilterProvider, { children: _jsxs(FormSheet.Root, { contentStyle: styles.contentContainer, showAndroidSheetGrabber: false, children: [_jsx(FormSheetHeaderWithContext, {}), _jsx(Filters, {})] }) }));
|
|
60
56
|
};
|
|
61
57
|
const FormSheetHeaderWithContext = () => {
|
|
62
58
|
const { resetFilter, applyFilters, setFormSheetHeaderHeight } = useFilterContext();
|
|
@@ -65,15 +61,7 @@ const FormSheetHeaderWithContext = () => {
|
|
|
65
61
|
const handleFormSheetHeaderLayout = useCallback((event) => {
|
|
66
62
|
setFormSheetHeaderHeight(event.nativeEvent.layout.height);
|
|
67
63
|
}, [setFormSheetHeaderHeight]);
|
|
68
|
-
return (
|
|
69
|
-
<FormSheet.Header style={styles.header}>
|
|
70
|
-
<FormSheet.HeaderTitle>Filters</FormSheet.HeaderTitle>
|
|
71
|
-
<FormSheet.HeaderActions>
|
|
72
|
-
<FormSheet.HeaderTextButton onPress={resetFilter}>Reset</FormSheet.HeaderTextButton>
|
|
73
|
-
<FormSheet.HeaderButton title="Apply" onPress={() => applyFilters(route.params)}/>
|
|
74
|
-
</FormSheet.HeaderActions>
|
|
75
|
-
</FormSheet.Header>
|
|
76
|
-
</View>);
|
|
64
|
+
return (_jsx(View, { onLayout: handleFormSheetHeaderLayout, children: _jsxs(FormSheet.Header, { style: styles.header, children: [_jsx(FormSheet.HeaderTitle, { children: "Filters" }), _jsxs(FormSheet.HeaderActions, { children: [_jsx(FormSheet.HeaderTextButton, { onPress: resetFilter, children: "Reset" }), _jsx(FormSheet.HeaderButton, { title: "Apply", onPress: () => applyFilters(route.params) })] })] }) }));
|
|
77
65
|
};
|
|
78
66
|
const useStyles = () => {
|
|
79
67
|
const { top } = useSafeAreaInsets();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_filters_screen.js","sourceRoot":"","sources":["../../src/screens/conversation_filters_screen.tsx"],"names":[],"mappings":"AAAA,OAA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react-navigation/elements'\nimport { createComponentForStaticNavigation, RouteProp, useRoute } from '@react-navigation/native'\nimport { createNativeStackNavigator } from '@react-navigation/native-stack'\nimport React, { useCallback } from 'react'\nimport { LayoutChangeEvent, Platform, StyleSheet, useWindowDimensions, View } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport FormSheet, { getFormSheetScreenOptions } from '../components/primitive/form_sheet'\nimport { ConversationFilters } from './conversation_filters/components/conversation_filters'\nimport {\n FilterProvider,\n useFilterContext,\n} from './conversation_filters/context/conversation_filter_context'\nimport { GroupFilters } from './conversation_filters/group_filters'\nimport {\n ConversationFiltersScreenProps,\n ConversationFilterStackParamList,\n} from './conversation_filters/screen_props'\nimport { TeamFilters } from './conversation_filters/team_filters'\n\nexport const ConversationFiltersScreenOptions = getFormSheetScreenOptions({\n presentation: Platform.select({ android: 'modal', ios: 'formSheet' }),\n sheetAllowedDetents: Platform.select({\n ios: [0.75, 1],\n default: [1],\n }),\n headerTitle: 'Filters',\n})\n\nconst FilterNavigator = createNativeStackNavigator<ConversationFilterStackParamList>({\n initialRouteName: 'Filters',\n screens: {\n Filters: {\n screen: ConversationFilters,\n options: {\n headerShown: false,\n },\n },\n GroupFilters: {\n screen: GroupFilters,\n options: {\n headerTitle: Platform.select({\n android: 'Groups',\n ios: '',\n }),\n headerBackTitle: 'Groups',\n },\n },\n TeamFilters: {\n screen: TeamFilters,\n options: {\n headerTitle: Platform.select({\n android: 'Teams',\n ios: '',\n }),\n headerBackTitle: 'Teams',\n },\n },\n },\n})\n\nconst Filters = createComponentForStaticNavigation(FilterNavigator, 'Filters')\n\nexport const ConversationFiltersScreen = (_props: ConversationFiltersScreenProps) => {\n const styles = useStyles()\n\n return (\n <FilterProvider>\n <FormSheet.Root contentStyle={styles.contentContainer} showAndroidSheetGrabber={false}>\n <FormSheetHeaderWithContext />\n <Filters />\n </FormSheet.Root>\n </FilterProvider>\n )\n}\n\nconst FormSheetHeaderWithContext = () => {\n const { resetFilter, applyFilters, setFormSheetHeaderHeight } = useFilterContext()\n const route = useRoute<RouteProp<ConversationFiltersScreenProps['route']>>()\n const styles = useStyles()\n\n const handleFormSheetHeaderLayout = useCallback(\n (event: LayoutChangeEvent) => {\n setFormSheetHeaderHeight(event.nativeEvent.layout.height)\n },\n [setFormSheetHeaderHeight]\n )\n\n return (\n <View onLayout={handleFormSheetHeaderLayout}>\n <FormSheet.Header style={styles.header}>\n <FormSheet.HeaderTitle>Filters</FormSheet.HeaderTitle>\n <FormSheet.HeaderActions>\n <FormSheet.HeaderTextButton onPress={resetFilter}>Reset</FormSheet.HeaderTextButton>\n <FormSheet.HeaderButton title=\"Apply\" onPress={() => applyFilters(route.params)} />\n </FormSheet.HeaderActions>\n </FormSheet.Header>\n </View>\n )\n}\n\nconst useStyles = () => {\n const { top } = useSafeAreaInsets()\n const { height } = useWindowDimensions()\n const headerHeight = useHeaderHeight()\n\n const containerHeight = Platform.select({\n android: height,\n ios: height - top - headerHeight,\n })\n\n return StyleSheet.create({\n contentContainer: {\n height: containerHeight,\n },\n header: {\n paddingTop: Platform.select({\n ios: 20,\n android: 20 + top,\n }),\n },\n })\n}\n"]}
|