@planningcenter/chat-react-native 3.42.2-qa-staging.1 → 3.42.2-qa-821.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/conversation/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 +3 -3
- package/build/components/conversation/messages_disabled_banners.d.ts.map +1 -1
- package/build/components/conversation/messages_disabled_banners.js +5 -8
- 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 +12 -76
- 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 +2 -4
- package/build/components/conversations/unread_count_badge.d.ts.map +1 -1
- package/build/components/conversations/unread_count_badge.js +7 -12
- 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 +1 -1
- package/build/contexts/chat_context.d.ts.map +1 -1
- package/build/contexts/chat_context.js +2 -1
- 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/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 +0 -2
- package/build/hooks/use_conversation.js.map +1 -1
- package/build/hooks/use_conversation_jolt_events.d.ts.map +1 -1
- package/build/hooks/use_conversation_jolt_events.js +19 -4
- package/build/hooks/use_conversation_jolt_events.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_conversation_messages.d.ts +1 -0
- package/build/hooks/use_conversation_messages.d.ts.map +1 -1
- package/build/hooks/use_conversation_messages.js +2 -2
- package/build/hooks/use_conversation_messages.js.map +1 -1
- package/build/hooks/use_conversations_actions.d.ts +36 -36
- package/build/hooks/use_conversations_actions.d.ts.map +1 -1
- package/build/hooks/use_conversations_actions.js +1 -3
- package/build/hooks/use_conversations_actions.js.map +1 -1
- package/build/hooks/use_mark_latest_message_read.d.ts.map +1 -1
- package/build/hooks/use_mark_latest_message_read.js +4 -3
- package/build/hooks/use_mark_latest_message_read.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 +35 -36
- package/build/navigation/index.d.ts.map +1 -1
- package/build/navigation/index.js +19 -21
- 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 +10 -11
- 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 +25 -66
- 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 +11 -83
- 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_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 +3 -10
- 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 +19 -42
- 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 +4 -26
- 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/conversation.d.ts +1 -10
- package/build/types/resources/conversation.d.ts.map +1 -1
- package/build/types/resources/conversation.js.map +1 -1
- package/build/utils/request/conversation.d.ts.map +1 -1
- package/build/utils/request/conversation.js +0 -2
- package/build/utils/request/conversation.js.map +1 -1
- 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.map +1 -1
- package/package.json +12 -12
- package/src/__tests__/hooks/use_attachment_uploader.test.tsx +1 -0
- package/src/__tests__/hooks/use_font_scale.test.ts +7 -3
- 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/conversations/conversation_preview.tsx +23 -58
- package/src/components/conversations/unread_count_badge.tsx +4 -13
- 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/hooks/use_conversation.ts +0 -2
- package/src/hooks/use_conversation_jolt_events.ts +19 -3
- package/src/hooks/use_conversation_messages.ts +6 -5
- package/src/hooks/use_conversations_actions.ts +1 -3
- package/src/hooks/use_mark_latest_message_read.ts +4 -3
- package/src/index.tsx +2 -1
- package/src/polyfills/events/EventTarget.ts +1 -1
- package/src/screens/conversation_screen.tsx +4 -2
- package/src/screens/conversations/components/list_header_component.tsx +6 -6
- package/src/types/resources/conversation.ts +1 -11
- package/src/utils/request/conversation.ts +0 -2
- package/src/utils/sha_256.ts +24 -24
- package/src/utils/system_messages.ts +1 -1
- package/src/utils/theme.ts +3 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { StackActions, useNavigation } from '@react-navigation/native';
|
|
2
|
-
import
|
|
3
|
+
import { useCallback, useReducer } from 'react';
|
|
3
4
|
import { Platform, StyleSheet, View } from 'react-native';
|
|
4
5
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
5
6
|
import { ConversationAvatar } from '../../components/display/conversation_avatar';
|
|
@@ -38,9 +39,9 @@ const TAB_LABELS = {
|
|
|
38
39
|
export function AvatarPickerScreen({ route }) {
|
|
39
40
|
const { conversation_id, source_params, avatar_selection } = route.params;
|
|
40
41
|
if (conversation_id) {
|
|
41
|
-
return
|
|
42
|
+
return _jsx(EditModeContent, { conversationId: conversation_id });
|
|
42
43
|
}
|
|
43
|
-
return
|
|
44
|
+
return _jsx(CreateModeContent, { sourceParams: source_params, existingSelection: avatar_selection });
|
|
44
45
|
}
|
|
45
46
|
function EditModeContent({ conversationId }) {
|
|
46
47
|
const navigation = useNavigation();
|
|
@@ -63,14 +64,7 @@ function EditModeContent({ conversationId }) {
|
|
|
63
64
|
const handleRemove = useCallback(() => {
|
|
64
65
|
mutation.mutate({ kind: 'clear' }, { onSuccess: () => dispatch({ type: 'CLEAR' }) });
|
|
65
66
|
}, [mutation, dispatch]);
|
|
66
|
-
return (
|
|
67
|
-
{hasAvatar && (<FormSheet.HeaderTextButton onPress={handleRemove} appearance="danger">
|
|
68
|
-
Remove
|
|
69
|
-
</FormSheet.HeaderTextButton>)}
|
|
70
|
-
<FormSheet.HeaderTextButton onPress={handleDone} disabled={mutation.isPending}>
|
|
71
|
-
Done
|
|
72
|
-
</FormSheet.HeaderTextButton>
|
|
73
|
-
</>} fallbackPreview={<ConversationAvatar conversation={conversation} size="2xl" maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK} style={{ width: previewDiameter, height: previewDiameter }}/>}/>);
|
|
67
|
+
return (_jsx(AvatarPickerFormSheet, { state: state, dispatch: dispatch, headerTitle: "Update avatar", headerActions: _jsxs(_Fragment, { children: [hasAvatar && (_jsx(FormSheet.HeaderTextButton, { onPress: handleRemove, appearance: "danger", children: "Remove" })), _jsx(FormSheet.HeaderTextButton, { onPress: handleDone, disabled: mutation.isPending, children: "Done" })] }), fallbackPreview: _jsx(ConversationAvatar, { conversation: conversation, size: "2xl", maxFontSizeMultiplier: MAX_FONT_SIZE_MULTIPLIER_LANDMARK, style: { width: previewDiameter, height: previewDiameter } }) }));
|
|
74
68
|
}
|
|
75
69
|
function CreateModeContent({ sourceParams, existingSelection }) {
|
|
76
70
|
const navigation = useNavigation();
|
|
@@ -88,40 +82,19 @@ function CreateModeContent({ sourceParams, existingSelection }) {
|
|
|
88
82
|
navigation.goBack();
|
|
89
83
|
}
|
|
90
84
|
}, [state, navigation, sourceParams]);
|
|
91
|
-
return (
|
|
85
|
+
return (_jsx(AvatarPickerFormSheet, { state: state, dispatch: dispatch, headerTitle: "Choose avatar", headerActions: _jsx(FormSheet.HeaderTextButton, { onPress: handleDone, children: "Done" }), fallbackPreview: _jsx(EmptyAvatarPlaceholder, {}) }));
|
|
92
86
|
}
|
|
93
87
|
function AvatarPickerFormSheet({ state, dispatch, headerTitle, headerActions, fallbackPreview, }) {
|
|
94
88
|
const styles = useStyles();
|
|
95
|
-
return (
|
|
96
|
-
<FormSheet.Header style={styles.header}>
|
|
97
|
-
<FormSheet.HeaderTitle>{headerTitle}</FormSheet.HeaderTitle>
|
|
98
|
-
<FormSheet.HeaderActions>{headerActions}</FormSheet.HeaderActions>
|
|
99
|
-
</FormSheet.Header>
|
|
100
|
-
|
|
101
|
-
<AvatarPreview state={state} fallback={fallbackPreview}/>
|
|
102
|
-
|
|
103
|
-
<Tabs data={TABS} activeTab={state.activeTab} onTabPress={tab => dispatch({ type: 'SELECT_TAB', payload: tab })} renderItem={({ item }) => (<Text style={[styles.tabLabel, item === state.activeTab && styles.tabLabelActive]} maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}>
|
|
104
|
-
{TAB_LABELS[item]}
|
|
105
|
-
</Text>)} style={styles.tabs}/>
|
|
106
|
-
|
|
107
|
-
<View style={styles.body}>
|
|
108
|
-
{state.activeTab === 'icon' && (<IconGrid selectedIconKey={state.selectedType === 'icon' ? state.selectedKey : null} onIconSelect={iconKey => dispatch({ type: 'SELECT_ICON', payload: iconKey })}/>)}
|
|
109
|
-
{state.activeTab === 'emoji' && (<EmojiTab onEmojiSelect={emoji => dispatch({ type: 'SELECT_EMOJI', payload: emoji })}/>)}
|
|
110
|
-
{state.activeTab === 'upload' && (<UploadTab imagePreviewUri={state.imagePreviewUri} onImageSelect={asset => dispatch({ type: 'SET_IMAGE', payload: asset })}/>)}
|
|
111
|
-
</View>
|
|
112
|
-
|
|
113
|
-
{state.activeTab !== 'upload' && (<View style={styles.colorPickerWrapper}>
|
|
114
|
-
<ColorPicker selectedColor={state.selectedColor} onColorSelect={color => dispatch({ type: 'SELECT_COLOR', payload: color })}/>
|
|
115
|
-
</View>)}
|
|
116
|
-
</FormSheet.Root>);
|
|
89
|
+
return (_jsxs(FormSheet.Root, { style: styles.formSheetRoot, contentStyle: styles.formSheetContent, showAndroidSheetGrabber: false, children: [_jsxs(FormSheet.Header, { style: styles.header, children: [_jsx(FormSheet.HeaderTitle, { children: headerTitle }), _jsx(FormSheet.HeaderActions, { children: headerActions })] }), _jsx(AvatarPreview, { state: state, fallback: fallbackPreview }), _jsx(Tabs, { data: TABS, activeTab: state.activeTab, onTabPress: tab => dispatch({ type: 'SELECT_TAB', payload: tab }), renderItem: ({ item }) => (_jsx(Text, { style: [styles.tabLabel, item === state.activeTab && styles.tabLabelActive], maxFontSizeMultiplier: MAX_FONT_SIZE_MULTIPLIER_LANDMARK, children: TAB_LABELS[item] })), style: styles.tabs }), _jsxs(View, { style: styles.body, children: [state.activeTab === 'icon' && (_jsx(IconGrid, { selectedIconKey: state.selectedType === 'icon' ? state.selectedKey : null, onIconSelect: iconKey => dispatch({ type: 'SELECT_ICON', payload: iconKey }) })), state.activeTab === 'emoji' && (_jsx(EmojiTab, { onEmojiSelect: emoji => dispatch({ type: 'SELECT_EMOJI', payload: emoji }) })), state.activeTab === 'upload' && (_jsx(UploadTab, { imagePreviewUri: state.imagePreviewUri, onImageSelect: asset => dispatch({ type: 'SET_IMAGE', payload: asset }) }))] }), state.activeTab !== 'upload' && (_jsx(View, { style: styles.colorPickerWrapper, children: _jsx(ColorPicker, { selectedColor: state.selectedColor, onColorSelect: color => dispatch({ type: 'SELECT_COLOR', payload: color }) }) }))] }));
|
|
117
90
|
}
|
|
118
91
|
function EmptyAvatarPlaceholder() {
|
|
119
92
|
const styles = useStyles();
|
|
120
93
|
const diameter = usePreviewAvatarDiameter();
|
|
121
|
-
return (
|
|
94
|
+
return (_jsx(View, { style: [
|
|
122
95
|
styles.emptyAvatarPlaceholder,
|
|
123
96
|
{ width: diameter, height: diameter, borderRadius: diameter / 2 },
|
|
124
|
-
]}
|
|
97
|
+
] }));
|
|
125
98
|
}
|
|
126
99
|
function hasValidSelection(state) {
|
|
127
100
|
switch (state.selectedType) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar_picker_screen.js","sourceRoot":"","sources":["../../../src/screens/avatar_picker/avatar_picker_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACzF,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAA;AACjF,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAA;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,uDAAuD,CAAA;AACtF,OAAO,SAAS,EAAE,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAA;AAC5F,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAC9D,OAAO,EACL,2BAA2B,GAE5B,MAAM,4CAA4C,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAA;AAClF,OAAO,EAAE,iCAAiC,EAAE,MAAM,aAAa,CAAA;AAE/D,OAAO,EACL,mBAAmB,EACnB,qBAA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CAAC;SACR;QACD,gBAAgB,EAAE;YAChB,IAAI,EAAE,CAAC;SACR;QACD,MAAM,EAAE;YACN,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,GAAG,GAAG,EAAE,CAAC;SAC5D;QACD,IAAI,EAAE;YACJ,SAAS,EAAE,EAAE,GAAG,SAAS;YACzB,iBAAiB,EAAE,CAAC;YACpB,iBAAiB,EAAE,MAAM,CAAC,sBAAsB;YAChD,eAAe,EAAE,MAAM,CAAC,2BAA2B;YACnD,MAAM,EAAE,CAAC;SACV;QACD,QAAQ,EAAE;YACR,QAAQ,EAAE,EAAE;YACZ,KAAK,EAAE,MAAM,CAAC,yBAAyB;YACvC,eAAe,EAAE,EAAE,GAAG,SAAS;YAC/B,QAAQ,EAAE,EAAE,GAAG,SAAS;YACxB,SAAS,EAAE,QAAQ;SACpB;QACD,cAAc,EAAE;YACd,KAAK,EAAE,MAAM,CAAC,uBAAuB;SACtC;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,CAAC;YACP,QAAQ,EAAE,QAAQ;SACnB;QACD,kBAAkB,EAAE;YAClB,cAAc,EAAE,CAAC;YACjB,cAAc,EAAE,MAAM,CAAC,sBAAsB;SAC9C;QACD,sBAAsB,EAAE;YACtB,WAAW,EAAE,CAAC;YACd,WAAW,EAAE,QAAQ;YACrB,WAAW,EAAE,MAAM,CAAC,sBAAsB;SAC3C;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { StackActions, StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React, { useCallback, useReducer } from 'react'\nimport { Platform, StyleSheet, View } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { ConversationAvatar } from '../../components/display/conversation_avatar'\nimport { Tabs } from '../../components/display/tabs'\nimport { Text } from '../../components/display/text'\nimport { coerceColorKey } from '../../components/display/utils/avatar_gradient_colors'\nimport FormSheet, { getFormSheetScreenOptions } from '../../components/primitive/form_sheet'\nimport { useTheme } from '../../hooks'\nimport { useConversation } from '../../hooks/use_conversation'\nimport {\n useConversationAvatarUpdate,\n type AvatarUpdatePayload,\n} from '../../hooks/use_conversation_avatar_update'\nimport { useFontScale } from '../../hooks/use_font_scale'\nimport { usePreviewAvatarDiameter } from '../../hooks/use_preview_avatar_diameter'\nimport { MAX_FONT_SIZE_MULTIPLIER_LANDMARK } from '../../utils'\nimport type { ImagePickerAsset } from '../../utils/native_adapters/image_picker'\nimport {\n avatarPickerReducer,\n initAvatarPickerState,\n initAvatarPickerStateFromPayload,\n initEmptyAvatarPickerState,\n type AvatarPickerAction,\n type AvatarPickerState,\n type AvatarTab,\n} from './avatar_picker_state'\nimport { AvatarPreview } from './avatar_preview'\nimport { ColorPicker } from './color_picker'\nimport { EmojiTab } from './emoji_tab'\nimport { IconGrid } from './icon_grid'\nimport { UploadTab } from './upload_tab'\n\nexport const AvatarPickerScreenOptions = getFormSheetScreenOptions({\n headerTitle: 'Update avatar',\n presentation: Platform.select({ android: 'modal', ios: 'formSheet' }),\n sheetAllowedDetents: [1],\n})\n\nexport const AvatarPickerCreateScreenOptions = getFormSheetScreenOptions({\n headerTitle: 'Choose avatar',\n presentation: Platform.select({ android: 'modal', ios: 'formSheet' }),\n sheetAllowedDetents: [1],\n})\n\nexport type AvatarPickerScreenProps = StaticScreenProps<{\n conversation_id?: number\n source_params?: Record<string, unknown>\n avatar_selection?: AvatarUpdatePayload\n}>\n\nconst TABS: AvatarTab[] = ['icon', 'emoji', 'upload']\n\nconst TAB_LABELS: Record<AvatarTab, string> = {\n icon: 'Icon',\n emoji: 'Emoji',\n upload: 'Upload',\n}\n\nexport function AvatarPickerScreen({ route }: AvatarPickerScreenProps) {\n const { conversation_id, source_params, avatar_selection } = route.params\n if (conversation_id) {\n return <EditModeContent conversationId={conversation_id} />\n }\n return <CreateModeContent sourceParams={source_params} existingSelection={avatar_selection} />\n}\n\nfunction EditModeContent({ conversationId }: { conversationId: number }) {\n const navigation = useNavigation()\n const { data: conversation } = useConversation({ conversation_id: conversationId })\n const mutation = useConversationAvatarUpdate({ conversationId })\n const previewDiameter = usePreviewAvatarDiameter()\n\n const [state, dispatch] = useReducer(avatarPickerReducer, conversation, initAvatarPickerState)\n\n const hasAvatar = state.selectedType !== null\n\n const handleDone = useCallback(() => {\n if (!state.isDirty) {\n navigation.goBack()\n return\n }\n\n const payload = buildPayload(state)\n if (payload) {\n mutation.mutate(payload)\n }\n navigation.goBack()\n }, [state, mutation, navigation])\n\n const handleRemove = useCallback(() => {\n mutation.mutate({ kind: 'clear' }, { onSuccess: () => dispatch({ type: 'CLEAR' }) })\n }, [mutation, dispatch])\n\n return (\n <AvatarPickerFormSheet\n state={state}\n dispatch={dispatch}\n headerTitle=\"Update avatar\"\n headerActions={\n <>\n {hasAvatar && (\n <FormSheet.HeaderTextButton onPress={handleRemove} appearance=\"danger\">\n Remove\n </FormSheet.HeaderTextButton>\n )}\n <FormSheet.HeaderTextButton onPress={handleDone} disabled={mutation.isPending}>\n Done\n </FormSheet.HeaderTextButton>\n </>\n }\n fallbackPreview={\n <ConversationAvatar\n conversation={conversation}\n size=\"2xl\"\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}\n style={{ width: previewDiameter, height: previewDiameter }}\n />\n }\n />\n )\n}\n\ninterface CreateModeContentProps {\n sourceParams?: Record<string, unknown>\n existingSelection?: AvatarUpdatePayload\n}\n\nfunction CreateModeContent({ sourceParams, existingSelection }: CreateModeContentProps) {\n const navigation = useNavigation()\n\n const [state, dispatch] = useReducer(avatarPickerReducer, existingSelection, selection =>\n selection ? initAvatarPickerStateFromPayload(selection) : initEmptyAvatarPickerState()\n )\n\n const handleDone = useCallback(() => {\n if (!state.isDirty) {\n navigation.goBack()\n return\n }\n\n const payload = buildPayload(state)\n if (payload) {\n navigation.dispatch(\n StackActions.popTo('ConversationNew', { ...sourceParams, avatar_selection: payload })\n )\n } else {\n navigation.goBack()\n }\n }, [state, navigation, sourceParams])\n\n return (\n <AvatarPickerFormSheet\n state={state}\n dispatch={dispatch}\n headerTitle=\"Choose avatar\"\n headerActions={\n <FormSheet.HeaderTextButton onPress={handleDone}>Done</FormSheet.HeaderTextButton>\n }\n fallbackPreview={<EmptyAvatarPlaceholder />}\n />\n )\n}\n\ninterface AvatarPickerFormSheetProps {\n state: AvatarPickerState\n dispatch: React.Dispatch<AvatarPickerAction>\n headerTitle: string\n headerActions: React.ReactNode\n fallbackPreview: React.ReactNode\n}\n\nfunction AvatarPickerFormSheet({\n state,\n dispatch,\n headerTitle,\n headerActions,\n fallbackPreview,\n}: AvatarPickerFormSheetProps) {\n const styles = useStyles()\n\n return (\n <FormSheet.Root\n style={styles.formSheetRoot}\n contentStyle={styles.formSheetContent}\n showAndroidSheetGrabber={false}\n >\n <FormSheet.Header style={styles.header}>\n <FormSheet.HeaderTitle>{headerTitle}</FormSheet.HeaderTitle>\n <FormSheet.HeaderActions>{headerActions}</FormSheet.HeaderActions>\n </FormSheet.Header>\n\n <AvatarPreview state={state} fallback={fallbackPreview} />\n\n <Tabs\n data={TABS}\n activeTab={state.activeTab}\n onTabPress={tab => dispatch({ type: 'SELECT_TAB', payload: tab })}\n renderItem={({ item }) => (\n <Text\n style={[styles.tabLabel, item === state.activeTab && styles.tabLabelActive]}\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}\n >\n {TAB_LABELS[item]}\n </Text>\n )}\n style={styles.tabs}\n />\n\n <View style={styles.body}>\n {state.activeTab === 'icon' && (\n <IconGrid\n selectedIconKey={state.selectedType === 'icon' ? state.selectedKey : null}\n onIconSelect={iconKey => dispatch({ type: 'SELECT_ICON', payload: iconKey })}\n />\n )}\n {state.activeTab === 'emoji' && (\n <EmojiTab onEmojiSelect={emoji => dispatch({ type: 'SELECT_EMOJI', payload: emoji })} />\n )}\n {state.activeTab === 'upload' && (\n <UploadTab\n imagePreviewUri={state.imagePreviewUri}\n onImageSelect={asset => dispatch({ type: 'SET_IMAGE', payload: asset })}\n />\n )}\n </View>\n\n {state.activeTab !== 'upload' && (\n <View style={styles.colorPickerWrapper}>\n <ColorPicker\n selectedColor={state.selectedColor}\n onColorSelect={color => dispatch({ type: 'SELECT_COLOR', payload: color })}\n />\n </View>\n )}\n </FormSheet.Root>\n )\n}\n\nfunction EmptyAvatarPlaceholder() {\n const styles = useStyles()\n const diameter = usePreviewAvatarDiameter()\n return (\n <View\n style={[\n styles.emptyAvatarPlaceholder,\n { width: diameter, height: diameter, borderRadius: diameter / 2 },\n ]}\n />\n )\n}\n\ntype ValidAvatarPickerState = AvatarPickerState &\n (\n | { selectedType: 'icon' | 'emoji'; selectedKey: string }\n | { selectedType: 'image'; imageAsset: ImagePickerAsset }\n )\n\nfunction hasValidSelection(state: AvatarPickerState): state is ValidAvatarPickerState {\n switch (state.selectedType) {\n case 'icon':\n case 'emoji':\n return state.selectedKey !== null\n case 'image':\n return state.imageAsset !== null\n case null:\n return false\n }\n}\n\nfunction buildPayload(state: AvatarPickerState): AvatarUpdatePayload | null {\n if (!hasValidSelection(state)) return null\n\n const color = coerceColorKey(state.selectedColor)\n\n switch (state.selectedType) {\n case 'icon':\n return { kind: 'icon', key: state.selectedKey, color }\n case 'emoji':\n return { kind: 'emoji', key: state.selectedKey, color }\n case 'image':\n return { kind: 'image', imageAsset: state.imageAsset, color }\n }\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n const fontScale = useFontScale({ maxFontSizeMultiplier: MAX_FONT_SIZE_MULTIPLIER_LANDMARK })\n const { top } = useSafeAreaInsets()\n\n return StyleSheet.create({\n formSheetRoot: {\n flex: 1,\n },\n formSheetContent: {\n flex: 1,\n },\n header: {\n paddingTop: Platform.select({ ios: 20, android: 20 + top }),\n },\n tabs: {\n minHeight: 52 * fontScale,\n borderBottomWidth: 1,\n borderBottomColor: colors.borderColorDefaultBase,\n backgroundColor: colors.fillColorNeutral100Inverted,\n zIndex: 1,\n },\n tabLabel: {\n fontSize: 14,\n color: colors.textColorDefaultSecondary,\n paddingVertical: 14 * fontScale,\n minWidth: 56 * fontScale,\n textAlign: 'center',\n },\n tabLabelActive: {\n color: colors.textColorDefaultPrimary,\n },\n body: {\n flex: 1,\n overflow: 'hidden',\n },\n colorPickerWrapper: {\n borderTopWidth: 1,\n borderTopColor: colors.borderColorDefaultBase,\n },\n emptyAvatarPlaceholder: {\n borderWidth: 2,\n borderStyle: 'dashed',\n borderColor: colors.borderColorDefaultBase,\n },\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"avatar_picker_screen.js","sourceRoot":"","sources":["../../../src/screens/avatar_picker/avatar_picker_screen.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACzF,OAAc,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAA;AACjF,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAA;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,uDAAuD,CAAA;AACtF,OAAO,SAAS,EAAE,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAA;AAC5F,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAC9D,OAAO,EACL,2BAA2B,GAE5B,MAAM,4CAA4C,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAA;AAClF,OAAO,EAAE,iCAAiC,EAAE,MAAM,a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B,WAAW,EAAE,MAAM,CAAC,sBAAsB;SAC3C;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { StackActions, StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React, { useCallback, useReducer } from 'react'\nimport { Platform, StyleSheet, View } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { ConversationAvatar } from '../../components/display/conversation_avatar'\nimport { Tabs } from '../../components/display/tabs'\nimport { Text } from '../../components/display/text'\nimport { coerceColorKey } from '../../components/display/utils/avatar_gradient_colors'\nimport FormSheet, { getFormSheetScreenOptions } from '../../components/primitive/form_sheet'\nimport { useTheme } from '../../hooks'\nimport { useConversation } from '../../hooks/use_conversation'\nimport {\n useConversationAvatarUpdate,\n type AvatarUpdatePayload,\n} from '../../hooks/use_conversation_avatar_update'\nimport { useFontScale } from '../../hooks/use_font_scale'\nimport { usePreviewAvatarDiameter } from '../../hooks/use_preview_avatar_diameter'\nimport { MAX_FONT_SIZE_MULTIPLIER_LANDMARK } from '../../utils'\nimport type { ImagePickerAsset } from '../../utils/native_adapters/image_picker'\nimport {\n avatarPickerReducer,\n initAvatarPickerState,\n initAvatarPickerStateFromPayload,\n initEmptyAvatarPickerState,\n type AvatarPickerAction,\n type AvatarPickerState,\n type AvatarTab,\n} from './avatar_picker_state'\nimport { AvatarPreview } from './avatar_preview'\nimport { ColorPicker } from './color_picker'\nimport { EmojiTab } from './emoji_tab'\nimport { IconGrid } from './icon_grid'\nimport { UploadTab } from './upload_tab'\n\nexport const AvatarPickerScreenOptions = getFormSheetScreenOptions({\n headerTitle: 'Update avatar',\n presentation: Platform.select({ android: 'modal', ios: 'formSheet' }),\n sheetAllowedDetents: [1],\n})\n\nexport const AvatarPickerCreateScreenOptions = getFormSheetScreenOptions({\n headerTitle: 'Choose avatar',\n presentation: Platform.select({ android: 'modal', ios: 'formSheet' }),\n sheetAllowedDetents: [1],\n})\n\nexport type AvatarPickerScreenProps = StaticScreenProps<{\n conversation_id?: number\n source_params?: Record<string, unknown>\n avatar_selection?: AvatarUpdatePayload\n}>\n\nconst TABS: AvatarTab[] = ['icon', 'emoji', 'upload']\n\nconst TAB_LABELS: Record<AvatarTab, string> = {\n icon: 'Icon',\n emoji: 'Emoji',\n upload: 'Upload',\n}\n\nexport function AvatarPickerScreen({ route }: AvatarPickerScreenProps) {\n const { conversation_id, source_params, avatar_selection } = route.params\n if (conversation_id) {\n return <EditModeContent conversationId={conversation_id} />\n }\n return <CreateModeContent sourceParams={source_params} existingSelection={avatar_selection} />\n}\n\nfunction EditModeContent({ conversationId }: { conversationId: number }) {\n const navigation = useNavigation()\n const { data: conversation } = useConversation({ conversation_id: conversationId })\n const mutation = useConversationAvatarUpdate({ conversationId })\n const previewDiameter = usePreviewAvatarDiameter()\n\n const [state, dispatch] = useReducer(avatarPickerReducer, conversation, initAvatarPickerState)\n\n const hasAvatar = state.selectedType !== null\n\n const handleDone = useCallback(() => {\n if (!state.isDirty) {\n navigation.goBack()\n return\n }\n\n const payload = buildPayload(state)\n if (payload) {\n mutation.mutate(payload)\n }\n navigation.goBack()\n }, [state, mutation, navigation])\n\n const handleRemove = useCallback(() => {\n mutation.mutate({ kind: 'clear' }, { onSuccess: () => dispatch({ type: 'CLEAR' }) })\n }, [mutation, dispatch])\n\n return (\n <AvatarPickerFormSheet\n state={state}\n dispatch={dispatch}\n headerTitle=\"Update avatar\"\n headerActions={\n <>\n {hasAvatar && (\n <FormSheet.HeaderTextButton onPress={handleRemove} appearance=\"danger\">\n Remove\n </FormSheet.HeaderTextButton>\n )}\n <FormSheet.HeaderTextButton onPress={handleDone} disabled={mutation.isPending}>\n Done\n </FormSheet.HeaderTextButton>\n </>\n }\n fallbackPreview={\n <ConversationAvatar\n conversation={conversation}\n size=\"2xl\"\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}\n style={{ width: previewDiameter, height: previewDiameter }}\n />\n }\n />\n )\n}\n\ninterface CreateModeContentProps {\n sourceParams?: Record<string, unknown>\n existingSelection?: AvatarUpdatePayload\n}\n\nfunction CreateModeContent({ sourceParams, existingSelection }: CreateModeContentProps) {\n const navigation = useNavigation()\n\n const [state, dispatch] = useReducer(avatarPickerReducer, existingSelection, selection =>\n selection ? initAvatarPickerStateFromPayload(selection) : initEmptyAvatarPickerState()\n )\n\n const handleDone = useCallback(() => {\n if (!state.isDirty) {\n navigation.goBack()\n return\n }\n\n const payload = buildPayload(state)\n if (payload) {\n navigation.dispatch(\n StackActions.popTo('ConversationNew', { ...sourceParams, avatar_selection: payload })\n )\n } else {\n navigation.goBack()\n }\n }, [state, navigation, sourceParams])\n\n return (\n <AvatarPickerFormSheet\n state={state}\n dispatch={dispatch}\n headerTitle=\"Choose avatar\"\n headerActions={\n <FormSheet.HeaderTextButton onPress={handleDone}>Done</FormSheet.HeaderTextButton>\n }\n fallbackPreview={<EmptyAvatarPlaceholder />}\n />\n )\n}\n\ninterface AvatarPickerFormSheetProps {\n state: AvatarPickerState\n dispatch: React.Dispatch<AvatarPickerAction>\n headerTitle: string\n headerActions: React.ReactNode\n fallbackPreview: React.ReactNode\n}\n\nfunction AvatarPickerFormSheet({\n state,\n dispatch,\n headerTitle,\n headerActions,\n fallbackPreview,\n}: AvatarPickerFormSheetProps) {\n const styles = useStyles()\n\n return (\n <FormSheet.Root\n style={styles.formSheetRoot}\n contentStyle={styles.formSheetContent}\n showAndroidSheetGrabber={false}\n >\n <FormSheet.Header style={styles.header}>\n <FormSheet.HeaderTitle>{headerTitle}</FormSheet.HeaderTitle>\n <FormSheet.HeaderActions>{headerActions}</FormSheet.HeaderActions>\n </FormSheet.Header>\n\n <AvatarPreview state={state} fallback={fallbackPreview} />\n\n <Tabs\n data={TABS}\n activeTab={state.activeTab}\n onTabPress={tab => dispatch({ type: 'SELECT_TAB', payload: tab })}\n renderItem={({ item }) => (\n <Text\n style={[styles.tabLabel, item === state.activeTab && styles.tabLabelActive]}\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}\n >\n {TAB_LABELS[item]}\n </Text>\n )}\n style={styles.tabs}\n />\n\n <View style={styles.body}>\n {state.activeTab === 'icon' && (\n <IconGrid\n selectedIconKey={state.selectedType === 'icon' ? state.selectedKey : null}\n onIconSelect={iconKey => dispatch({ type: 'SELECT_ICON', payload: iconKey })}\n />\n )}\n {state.activeTab === 'emoji' && (\n <EmojiTab onEmojiSelect={emoji => dispatch({ type: 'SELECT_EMOJI', payload: emoji })} />\n )}\n {state.activeTab === 'upload' && (\n <UploadTab\n imagePreviewUri={state.imagePreviewUri}\n onImageSelect={asset => dispatch({ type: 'SET_IMAGE', payload: asset })}\n />\n )}\n </View>\n\n {state.activeTab !== 'upload' && (\n <View style={styles.colorPickerWrapper}>\n <ColorPicker\n selectedColor={state.selectedColor}\n onColorSelect={color => dispatch({ type: 'SELECT_COLOR', payload: color })}\n />\n </View>\n )}\n </FormSheet.Root>\n )\n}\n\nfunction EmptyAvatarPlaceholder() {\n const styles = useStyles()\n const diameter = usePreviewAvatarDiameter()\n return (\n <View\n style={[\n styles.emptyAvatarPlaceholder,\n { width: diameter, height: diameter, borderRadius: diameter / 2 },\n ]}\n />\n )\n}\n\ntype ValidAvatarPickerState = AvatarPickerState &\n (\n | { selectedType: 'icon' | 'emoji'; selectedKey: string }\n | { selectedType: 'image'; imageAsset: ImagePickerAsset }\n )\n\nfunction hasValidSelection(state: AvatarPickerState): state is ValidAvatarPickerState {\n switch (state.selectedType) {\n case 'icon':\n case 'emoji':\n return state.selectedKey !== null\n case 'image':\n return state.imageAsset !== null\n case null:\n return false\n }\n}\n\nfunction buildPayload(state: AvatarPickerState): AvatarUpdatePayload | null {\n if (!hasValidSelection(state)) return null\n\n const color = coerceColorKey(state.selectedColor)\n\n switch (state.selectedType) {\n case 'icon':\n return { kind: 'icon', key: state.selectedKey, color }\n case 'emoji':\n return { kind: 'emoji', key: state.selectedKey, color }\n case 'image':\n return { kind: 'image', imageAsset: state.imageAsset, color }\n }\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n const fontScale = useFontScale({ maxFontSizeMultiplier: MAX_FONT_SIZE_MULTIPLIER_LANDMARK })\n const { top } = useSafeAreaInsets()\n\n return StyleSheet.create({\n formSheetRoot: {\n flex: 1,\n },\n formSheetContent: {\n flex: 1,\n },\n header: {\n paddingTop: Platform.select({ ios: 20, android: 20 + top }),\n },\n tabs: {\n minHeight: 52 * fontScale,\n borderBottomWidth: 1,\n borderBottomColor: colors.borderColorDefaultBase,\n backgroundColor: colors.fillColorNeutral100Inverted,\n zIndex: 1,\n },\n tabLabel: {\n fontSize: 14,\n color: colors.textColorDefaultSecondary,\n paddingVertical: 14 * fontScale,\n minWidth: 56 * fontScale,\n textAlign: 'center',\n },\n tabLabelActive: {\n color: colors.textColorDefaultPrimary,\n },\n body: {\n flex: 1,\n overflow: 'hidden',\n },\n colorPickerWrapper: {\n borderTopWidth: 1,\n borderTopColor: colors.borderColorDefaultBase,\n },\n emptyAvatarPlaceholder: {\n borderWidth: 2,\n borderStyle: 'dashed',\n borderColor: colors.borderColorDefaultBase,\n },\n })\n}\n"]}
|
|
@@ -4,6 +4,6 @@ interface AvatarPreviewProps {
|
|
|
4
4
|
state: AvatarPickerState;
|
|
5
5
|
fallback: React.ReactNode;
|
|
6
6
|
}
|
|
7
|
-
export declare function AvatarPreview({ state, fallback }: AvatarPreviewProps):
|
|
7
|
+
export declare function AvatarPreview({ state, fallback }: AvatarPreviewProps): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export {};
|
|
9
9
|
//# sourceMappingURL=avatar_preview.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar_preview.d.ts","sourceRoot":"","sources":["../../../src/screens/avatar_picker/avatar_preview.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAE9D,UAAU,kBAAkB;IAC1B,KAAK,EAAE,iBAAiB,CAAA;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AA8BD,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"avatar_preview.d.ts","sourceRoot":"","sources":["../../../src/screens/avatar_picker/avatar_preview.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAE9D,UAAU,kBAAkB;IAC1B,KAAK,EAAE,iBAAiB,CAAA;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AA8BD,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,kBAAkB,2CAIpE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { StyleSheet, View } from 'react-native';
|
|
3
3
|
import { EmojiAvatar } from '../../components/display/emoji_avatar';
|
|
4
4
|
import { IconAvatar } from '../../components/display/icon_avatar';
|
|
@@ -15,19 +15,15 @@ function getPreviewNode(state, diameter) {
|
|
|
15
15
|
case 'icon':
|
|
16
16
|
if (!state.selectedKey)
|
|
17
17
|
return null;
|
|
18
|
-
return
|
|
18
|
+
return _jsx(IconAvatar, { iconKey: state.selectedKey, color: state.selectedColor, ...sizeProps });
|
|
19
19
|
case 'emoji':
|
|
20
20
|
if (!state.selectedKey)
|
|
21
21
|
return null;
|
|
22
|
-
return
|
|
22
|
+
return _jsx(EmojiAvatar, { emoji: state.selectedKey, color: state.selectedColor, ...sizeProps });
|
|
23
23
|
case 'image':
|
|
24
24
|
if (!state.imagePreviewUri)
|
|
25
25
|
return null;
|
|
26
|
-
return (
|
|
27
|
-
<AvatarPrimitive.Mask>
|
|
28
|
-
<AvatarPrimitive.Image sourceUri={state.imagePreviewUri}/>
|
|
29
|
-
</AvatarPrimitive.Mask>
|
|
30
|
-
</AvatarPrimitive.Root>);
|
|
26
|
+
return (_jsx(AvatarPrimitive.Root, { ...sizeProps, children: _jsx(AvatarPrimitive.Mask, { children: _jsx(AvatarPrimitive.Image, { sourceUri: state.imagePreviewUri }) }) }));
|
|
31
27
|
default:
|
|
32
28
|
return null;
|
|
33
29
|
}
|
|
@@ -35,7 +31,7 @@ function getPreviewNode(state, diameter) {
|
|
|
35
31
|
export function AvatarPreview({ state, fallback }) {
|
|
36
32
|
const diameter = usePreviewAvatarDiameter();
|
|
37
33
|
const preview = getPreviewNode(state, diameter);
|
|
38
|
-
return
|
|
34
|
+
return _jsx(View, { style: styles.container, children: preview ?? fallback });
|
|
39
35
|
}
|
|
40
36
|
const styles = StyleSheet.create({
|
|
41
37
|
container: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar_preview.js","sourceRoot":"","sources":["../../../src/screens/avatar_picker/avatar_preview.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"avatar_preview.js","sourceRoot":"","sources":["../../../src/screens/avatar_picker/avatar_preview.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAA;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAA;AACjE,OAAO,eAAe,MAAM,6CAA6C,CAAA;AACzE,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAA;AAClF,OAAO,EAAE,iCAAiC,EAAE,MAAM,aAAa,CAAA;AAQ/D,SAAS,cAAc,CAAC,KAAwB,EAAE,QAAgB;IAChE,MAAM,SAAS,GAAG;QAChB,IAAI,EAAE,KAAK;QACX,qBAAqB,EAAE,iCAAiC;QACxD,KAAK,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE;KAC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yleSheet, View } from 'react-native'\nimport { EmojiAvatar } from '../../components/display/emoji_avatar'\nimport { IconAvatar } from '../../components/display/icon_avatar'\nimport AvatarPrimitive from '../../components/primitive/avatar_primitive'\nimport { usePreviewAvatarDiameter } from '../../hooks/use_preview_avatar_diameter'\nimport { MAX_FONT_SIZE_MULTIPLIER_LANDMARK } from '../../utils'\nimport type { AvatarPickerState } from './avatar_picker_state'\n\ninterface AvatarPreviewProps {\n state: AvatarPickerState\n fallback: React.ReactNode\n}\n\nfunction getPreviewNode(state: AvatarPickerState, diameter: number): React.ReactNode {\n const sizeProps = {\n size: '2xl',\n maxFontSizeMultiplier: MAX_FONT_SIZE_MULTIPLIER_LANDMARK,\n style: { width: diameter, height: diameter },\n } as const\n\n switch (state.selectedType) {\n case 'icon':\n if (!state.selectedKey) return null\n return <IconAvatar iconKey={state.selectedKey} color={state.selectedColor} {...sizeProps} />\n case 'emoji':\n if (!state.selectedKey) return null\n return <EmojiAvatar emoji={state.selectedKey} color={state.selectedColor} {...sizeProps} />\n case 'image':\n if (!state.imagePreviewUri) return null\n return (\n <AvatarPrimitive.Root {...sizeProps}>\n <AvatarPrimitive.Mask>\n <AvatarPrimitive.Image sourceUri={state.imagePreviewUri} />\n </AvatarPrimitive.Mask>\n </AvatarPrimitive.Root>\n )\n default:\n return null\n }\n}\n\nexport function AvatarPreview({ state, fallback }: AvatarPreviewProps) {\n const diameter = usePreviewAvatarDiameter()\n const preview = getPreviewNode(state, diameter)\n return <View style={styles.container}>{preview ?? fallback}</View>\n}\n\nconst styles = StyleSheet.create({\n container: {\n alignItems: 'center',\n paddingTop: 24,\n paddingBottom: 16,\n },\n})\n"]}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { type CustomAvatarColorKey } from '../../components/display/utils/avatar_gradient_colors';
|
|
3
2
|
interface ColorPickerProps {
|
|
4
3
|
selectedColor: string;
|
|
5
4
|
onColorSelect: (color: CustomAvatarColorKey) => void;
|
|
6
5
|
}
|
|
7
|
-
export declare function ColorPicker({ selectedColor, onColorSelect }: ColorPickerProps):
|
|
6
|
+
export declare function ColorPicker({ selectedColor, onColorSelect }: ColorPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
8
7
|
export {};
|
|
9
8
|
//# sourceMappingURL=color_picker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color_picker.d.ts","sourceRoot":"","sources":["../../../src/screens/avatar_picker/color_picker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"color_picker.d.ts","sourceRoot":"","sources":["../../../src/screens/avatar_picker/color_picker.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,oBAAoB,EAE1B,MAAM,uDAAuD,CAAA;AAI9D,UAAU,gBAAgB;IACxB,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAA;CACrD;AAED,wBAAgB,WAAW,CAAC,EAAE,aAAa,EAAE,aAAa,EAAE,EAAE,gBAAgB,2CAkC7E"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { PlatformPressable } from '@react-navigation/elements';
|
|
2
|
-
import
|
|
3
|
+
import { useCallback } from 'react';
|
|
3
4
|
import { FlatList, StyleSheet, useWindowDimensions } from 'react-native';
|
|
4
5
|
import LinearGradient from 'react-native-linear-gradient';
|
|
5
6
|
import { COLOR_KEYS, getAvatarGradientProps, } from '../../components/display/utils/avatar_gradient_colors';
|
|
@@ -10,11 +11,9 @@ export function ColorPicker({ selectedColor, onColorSelect }) {
|
|
|
10
11
|
const renderItem = useCallback(({ item }) => {
|
|
11
12
|
const gradientProps = getAvatarGradientProps(item);
|
|
12
13
|
const isSelected = item === selectedColor;
|
|
13
|
-
return (
|
|
14
|
-
<LinearGradient {...gradientProps} style={styles.swatch}/>
|
|
15
|
-
</PlatformPressable>);
|
|
14
|
+
return (_jsx(PlatformPressable, { onPress: () => onColorSelect(item), style: [styles.swatchOuter, isSelected && styles.swatchSelected], accessibilityRole: "button", accessibilityLabel: `${item.replace(/-/g, ' ')} color`, accessibilityState: { selected: isSelected }, children: _jsx(LinearGradient, { ...gradientProps, style: styles.swatch }) }));
|
|
16
15
|
}, [selectedColor, onColorSelect, styles.swatch, styles.swatchOuter, styles.swatchSelected]);
|
|
17
|
-
return (
|
|
16
|
+
return (_jsx(FlatList, { data: COLOR_KEYS, numColumns: GRID_COLUMNS, keyExtractor: item => item, renderItem: renderItem, contentContainerStyle: styles.grid, columnWrapperStyle: styles.row, scrollEnabled: false }));
|
|
18
17
|
}
|
|
19
18
|
const PADDING = 16;
|
|
20
19
|
const GAP = 8;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color_picker.js","sourceRoot":"","sources":["../../../src/screens/avatar_picker/color_picker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,
|
|
1
|
+
{"version":3,"file":"color_picker.js","sourceRoot":"","sources":["../../../src/screens/avatar_picker/color_picker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAc,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AACxE,OAAO,cAAc,MAAM,8BAA8B,CAAA;AACzD,OAAO,EACL,UAAU,EAEV,sBAAsB,GACvB,MAAM,uDAAuD,CAAA;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAO1C,MAAM,UAAU,WAAW,CAAC,EAAE,aAAa,EAAE,aAAa,EAAoB;IAC5E,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAE1B,MAA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AAE,CAAA;IACpD,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAC3B,CAAC,WAAW,GAAG,OAAO,GAAG,CAAC,GAAG,CAAC,YAAY,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,YAAY,CACtE,CAAA;IACD,MAAM,SAAS,GAAG,UAAU,GAAG,CAAC,CAAA;IAEhC,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,IAAI,EAAE;YACJ,iBAAiB,EAAE,OAAO;YAC1B,eAAe,EAAE,EAAE;SACpB;QACD,GAAG,EAAE;YACH,GAAG,EAAE,GAAG;YACR,YAAY,EAAE,GAAG;SAClB;QACD,WAAW,EAAE;YACX,KAAK,EAAE,UAAU;YACjB,MAAM,EAAE,UAAU;YAClB,YAAY,EAAE,UAAU,GAAG,CAAC;YAC5B,UAAU,EAAE,QAAQ;YACpB,cAAc,EAAE,QAAQ;SACzB;QACD,cAAc,EAAE;YACd,WAAW,EAAE,CAAC;YACd,WAAW,EAAE,MAAM,CAAC,WAAW;SAChC;QACD,MAAM,EAAE;YACN,KAAK,EAAE,SAAS;YAChB,MAAM,EAAE,SAAS;YACjB,YAAY,EAAE,SAAS,GAAG,CAAC;SAC5B;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { PlatformPressable } from '@react-navigation/elements'\nimport React, { useCallback } from 'react'\nimport { FlatList, StyleSheet, useWindowDimensions } from 'react-native'\nimport LinearGradient from 'react-native-linear-gradient'\nimport {\n COLOR_KEYS,\n type CustomAvatarColorKey,\n getAvatarGradientProps,\n} from '../../components/display/utils/avatar_gradient_colors'\nimport { useTheme } from '../../hooks'\nimport { GRID_COLUMNS } from './constants'\n\ninterface ColorPickerProps {\n selectedColor: string\n onColorSelect: (color: CustomAvatarColorKey) => void\n}\n\nexport function ColorPicker({ selectedColor, onColorSelect }: ColorPickerProps) {\n const styles = useStyles()\n\n const renderItem = useCallback(\n ({ item }: { item: CustomAvatarColorKey }) => {\n const gradientProps = getAvatarGradientProps(item)\n const isSelected = item === selectedColor\n\n return (\n <PlatformPressable\n onPress={() => onColorSelect(item)}\n style={[styles.swatchOuter, isSelected && styles.swatchSelected]}\n accessibilityRole=\"button\"\n accessibilityLabel={`${item.replace(/-/g, ' ')} color`}\n accessibilityState={{ selected: isSelected }}\n >\n <LinearGradient {...gradientProps} style={styles.swatch} />\n </PlatformPressable>\n )\n },\n [selectedColor, onColorSelect, styles.swatch, styles.swatchOuter, styles.swatchSelected]\n )\n\n return (\n <FlatList\n data={COLOR_KEYS}\n numColumns={GRID_COLUMNS}\n keyExtractor={item => item}\n renderItem={renderItem}\n contentContainerStyle={styles.grid}\n columnWrapperStyle={styles.row}\n scrollEnabled={false}\n />\n )\n}\n\nconst PADDING = 16\nconst GAP = 8\n\nconst useStyles = () => {\n const { colors } = useTheme()\n const { width: screenWidth } = useWindowDimensions()\n const swatchSize = Math.floor(\n (screenWidth - PADDING * 2 - (GRID_COLUMNS - 1) * GAP) / GRID_COLUMNS\n )\n const innerSize = swatchSize - 6\n\n return StyleSheet.create({\n grid: {\n paddingHorizontal: PADDING,\n paddingVertical: 12,\n },\n row: {\n gap: GAP,\n marginBottom: GAP,\n },\n swatchOuter: {\n width: swatchSize,\n height: swatchSize,\n borderRadius: swatchSize / 2,\n alignItems: 'center',\n justifyContent: 'center',\n },\n swatchSelected: {\n borderWidth: 3,\n borderColor: colors.interaction,\n },\n swatch: {\n width: innerSize,\n height: innerSize,\n borderRadius: innerSize / 2,\n },\n })\n}\n"]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
interface EmojiTabProps {
|
|
3
2
|
onEmojiSelect: (emoji: string) => void;
|
|
4
3
|
}
|
|
5
|
-
export declare function EmojiTab({ onEmojiSelect }: EmojiTabProps):
|
|
4
|
+
export declare function EmojiTab({ onEmojiSelect }: EmojiTabProps): import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
export {};
|
|
7
6
|
//# sourceMappingURL=emoji_tab.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emoji_tab.d.ts","sourceRoot":"","sources":["../../../src/screens/avatar_picker/emoji_tab.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"emoji_tab.d.ts","sourceRoot":"","sources":["../../../src/screens/avatar_picker/emoji_tab.tsx"],"names":[],"mappings":"AAYA,UAAU,aAAa;IACrB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACvC;AAED,wBAAgB,QAAQ,CAAC,EAAE,aAAa,EAAE,EAAE,aAAa,2CAyDxD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { EmojiKeyboard, emojisByCategory } from '@planningcenter/emoji-keyboard';
|
|
2
|
-
import
|
|
3
|
+
import { useCallback } from 'react';
|
|
3
4
|
import { StyleSheet, View } from 'react-native';
|
|
4
5
|
import { useTheme } from '../../hooks';
|
|
5
6
|
const BLOCKED_EMOJIS = new Set(['🖕']);
|
|
@@ -34,19 +35,17 @@ export function EmojiTab({ onEmojiSelect }) {
|
|
|
34
35
|
selected: colors.fillColorNeutral080,
|
|
35
36
|
},
|
|
36
37
|
};
|
|
37
|
-
return (
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
return (_jsx(View, { style: styles.container, children: _jsx(EmojiKeyboard, { categoryPosition: "top", emojisByCategory: filteredEmojis, onEmojiSelected: handleEmojiSelected, hideHeader: true, enableSearchBar: true, enableRecentlyUsed: true, theme: emojiTheme, styles: {
|
|
39
|
+
container: { borderRadius: 0 },
|
|
40
|
+
category: {
|
|
41
|
+
container: {
|
|
42
|
+
borderRadius: 0,
|
|
43
|
+
marginTop: -6,
|
|
44
|
+
borderBottomWidth: 1,
|
|
45
|
+
borderBottomColor: colors.borderColorDefaultDim,
|
|
46
|
+
},
|
|
46
47
|
},
|
|
47
|
-
}
|
|
48
|
-
}}/>
|
|
49
|
-
</View>);
|
|
48
|
+
} }) }));
|
|
50
49
|
}
|
|
51
50
|
const useStyles = () => {
|
|
52
51
|
const { colors } = useTheme();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emoji_tab.js","sourceRoot":"","sources":["../../../src/screens/avatar_picker/emoji_tab.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAkB,MAAM,gCAAgC,CAAA;AAChG,
|
|
1
|
+
{"version":3,"file":"emoji_tab.js","sourceRoot":"","sources":["../../../src/screens/avatar_picker/emoji_tab.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAkB,MAAM,gCAAgC,CAAA;AAChG,OAAc,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA;AAEtC,MAAM,cAAc,GAAG,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACvD,GAAG,QAAQ;IACX,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;CAC9D,CAAC,CAAC,CAAA;AAMH,MAAM,UAAU,QAAQ,CAAC,EAAE,aAAa,EAAiB;IACvD,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAE7B,MAAM,mBAAmB,GAAG,WAAW,CACrC,CAAC,WAAsB,EAAE,EAAE;QACzB,a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;IACrB,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAE7B,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,SAAS,EAAE;YACT,IAAI,EAAE,CAAC;YACP,eAAe,EAAE,MAAM,CAAC,2BAA2B;SACpD;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { EmojiKeyboard, emojisByCategory, type EmojiType } from '@planningcenter/emoji-keyboard'\nimport React, { useCallback } from 'react'\nimport { StyleSheet, View } from 'react-native'\nimport { useTheme } from '../../hooks'\n\nconst BLOCKED_EMOJIS = new Set(['🖕'])\n\nconst filteredEmojis = emojisByCategory.map(category => ({\n ...category,\n data: category.data.filter(e => !BLOCKED_EMOJIS.has(e.emoji)),\n}))\n\ninterface EmojiTabProps {\n onEmojiSelect: (emoji: string) => void\n}\n\nexport function EmojiTab({ onEmojiSelect }: EmojiTabProps) {\n const styles = useStyles()\n const { colors } = useTheme()\n\n const handleEmojiSelected = useCallback(\n (emojiObject: EmojiType) => {\n onEmojiSelect(emojiObject.emoji)\n },\n [onEmojiSelect]\n )\n\n const emojiTheme = {\n container: colors.fillColorNeutral100Inverted,\n header: colors.textColorDefaultSecondary,\n knob: colors.fillColorNeutral040,\n skinTonesContainer: colors.fillColorNeutral060,\n category: {\n icon: colors.textColorDefaultSecondary,\n iconActive: colors.interaction,\n container: colors.fillColorNeutral100Inverted,\n containerActive: colors.fillColorNeutral080,\n },\n search: {\n background: colors.fillColorNeutral080,\n text: colors.textColorDefaultPrimary,\n placeholder: colors.textColorDefaultSecondary,\n icon: colors.textColorDefaultSecondary,\n },\n emoji: {\n selected: colors.fillColorNeutral080,\n },\n }\n\n return (\n <View style={styles.container}>\n <EmojiKeyboard\n categoryPosition=\"top\"\n emojisByCategory={filteredEmojis}\n onEmojiSelected={handleEmojiSelected}\n hideHeader\n enableSearchBar\n enableRecentlyUsed\n theme={emojiTheme}\n styles={{\n container: { borderRadius: 0 },\n category: {\n container: {\n borderRadius: 0,\n marginTop: -6,\n borderBottomWidth: 1,\n borderBottomColor: colors.borderColorDefaultDim,\n },\n },\n }}\n />\n </View>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n\n return StyleSheet.create({\n container: {\n flex: 1,\n backgroundColor: colors.fillColorNeutral100Inverted,\n },\n })\n}\n"]}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
interface IconGridProps {
|
|
3
2
|
selectedIconKey: string | null;
|
|
4
3
|
onIconSelect: (iconKey: string) => void;
|
|
5
4
|
}
|
|
6
|
-
export declare function IconGrid({ selectedIconKey, onIconSelect }: IconGridProps):
|
|
5
|
+
export declare function IconGrid({ selectedIconKey, onIconSelect }: IconGridProps): import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
export {};
|
|
8
7
|
//# sourceMappingURL=icon_grid.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon_grid.d.ts","sourceRoot":"","sources":["../../../src/screens/avatar_picker/icon_grid.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"icon_grid.d.ts","sourceRoot":"","sources":["../../../src/screens/avatar_picker/icon_grid.tsx"],"names":[],"mappings":"AAQA,UAAU,aAAa;IACrB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,YAAY,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CACxC;AAED,wBAAgB,QAAQ,CAAC,EAAE,eAAe,EAAE,YAAY,EAAE,EAAE,aAAa,2CAiCxE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { FontAwesomeIcon } from '@fortawesome/react-native-fontawesome';
|
|
2
3
|
import { PlatformPressable } from '@react-navigation/elements';
|
|
3
|
-
import
|
|
4
|
+
import { useCallback } from 'react';
|
|
4
5
|
import { FlatList, StyleSheet, useWindowDimensions } from 'react-native';
|
|
5
6
|
import { useTheme } from '../../hooks';
|
|
6
7
|
import { AVATAR_ICON_KEYS, GRID_COLUMNS } from './constants';
|
|
@@ -8,11 +9,9 @@ export function IconGrid({ selectedIconKey, onIconSelect }) {
|
|
|
8
9
|
const styles = useStyles();
|
|
9
10
|
const renderItem = useCallback(({ item }) => {
|
|
10
11
|
const isSelected = item === selectedIconKey;
|
|
11
|
-
return (
|
|
12
|
-
<FontAwesomeIcon icon={['fas', item]} size={20} color="white"/>
|
|
13
|
-
</PlatformPressable>);
|
|
12
|
+
return (_jsx(PlatformPressable, { onPress: () => onIconSelect(item), style: [styles.cell, isSelected && styles.cellSelected], accessibilityRole: "button", accessibilityLabel: `${item.replace(/-/g, ' ')} icon`, accessibilityState: { selected: isSelected }, children: _jsx(FontAwesomeIcon, { icon: ['fas', item], size: 20, color: "white" }) }));
|
|
14
13
|
}, [selectedIconKey, onIconSelect, styles.cell, styles.cellSelected]);
|
|
15
|
-
return (
|
|
14
|
+
return (_jsx(FlatList, { data: AVATAR_ICON_KEYS, numColumns: GRID_COLUMNS, keyExtractor: item => item, renderItem: renderItem, contentContainerStyle: styles.grid, columnWrapperStyle: styles.row, style: styles.list }));
|
|
16
15
|
}
|
|
17
16
|
const PADDING = 16;
|
|
18
17
|
const GAP = 8;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon_grid.js","sourceRoot":"","sources":["../../../src/screens/avatar_picker/icon_grid.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAA;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,
|
|
1
|
+
{"version":3,"file":"icon_grid.js","sourceRoot":"","sources":["../../../src/screens/avatar_picker/icon_grid.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAA;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAc,EAAE,WAAW,EAA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AAE,MAAM,CAAC,GAAG,EAC9B,KAAK,EAAE,MAAM,CAAC,IAAI,GAClB,CACH,CAAA;AACH,CAAC;AAED,MAAM,OAAO,GAAG,EAAE,CAAA;AAClB,MAAM,GAAG,GAAG,CAAC,CAAA;AAEb,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAC7B,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,mBAAmB,EAAE,CAAA;IACpD,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,WAAW,GAAG,OAAO,GAAG,CAAC,GAAG,CAAC,YAAY,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,YAAY,CAAC,CAAA;IAElG,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,IAAI,EAAE;YACJ,IAAI,EAAE,CAAC;SACR;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,OAAO;SACjB;QACD,GAAG,EAAE;YACH,GAAG,EAAE,GAAG;YACR,YAAY,EAAE,GAAG;SAClB;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,QAAQ;YACf,MAAM,EAAE,QAAQ;YAChB,YAAY,EAAE,QAAQ,GAAG,CAAC;YAC1B,eAAe,EAAE,MAAM,CAAC,mBAAmB;YAC3C,UAAU,EAAE,QAAQ;YACpB,cAAc,EAAE,QAAQ;SACzB;QACD,YAAY,EAAE;YACZ,WAAW,EAAE,CAAC;YACd,WAAW,EAAE,MAAM,CAAC,WAAW;SAChC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import type { IconName } from '@fortawesome/fontawesome-svg-core'\nimport { FontAwesomeIcon } from '@fortawesome/react-native-fontawesome'\nimport { PlatformPressable } from '@react-navigation/elements'\nimport React, { useCallback } from 'react'\nimport { FlatList, StyleSheet, useWindowDimensions } from 'react-native'\nimport { useTheme } from '../../hooks'\nimport { AVATAR_ICON_KEYS, GRID_COLUMNS } from './constants'\n\ninterface IconGridProps {\n selectedIconKey: string | null\n onIconSelect: (iconKey: string) => void\n}\n\nexport function IconGrid({ selectedIconKey, onIconSelect }: IconGridProps) {\n const styles = useStyles()\n\n const renderItem = useCallback(\n ({ item }: { item: string }) => {\n const isSelected = item === selectedIconKey\n\n return (\n <PlatformPressable\n onPress={() => onIconSelect(item)}\n style={[styles.cell, isSelected && styles.cellSelected]}\n accessibilityRole=\"button\"\n accessibilityLabel={`${item.replace(/-/g, ' ')} icon`}\n accessibilityState={{ selected: isSelected }}\n >\n <FontAwesomeIcon icon={['fas', item as IconName]} size={20} color=\"white\" />\n </PlatformPressable>\n )\n },\n [selectedIconKey, onIconSelect, styles.cell, styles.cellSelected]\n )\n\n return (\n <FlatList\n data={AVATAR_ICON_KEYS}\n numColumns={GRID_COLUMNS}\n keyExtractor={item => item}\n renderItem={renderItem}\n contentContainerStyle={styles.grid}\n columnWrapperStyle={styles.row}\n style={styles.list}\n />\n )\n}\n\nconst PADDING = 16\nconst GAP = 8\n\nconst useStyles = () => {\n const { colors } = useTheme()\n const { width: screenWidth } = useWindowDimensions()\n const cellSize = Math.floor((screenWidth - PADDING * 2 - (GRID_COLUMNS - 1) * GAP) / GRID_COLUMNS)\n\n return StyleSheet.create({\n list: {\n flex: 1,\n },\n grid: {\n padding: PADDING,\n },\n row: {\n gap: GAP,\n marginBottom: GAP,\n },\n cell: {\n width: cellSize,\n height: cellSize,\n borderRadius: cellSize / 2,\n backgroundColor: colors.fillColorNeutral040,\n alignItems: 'center',\n justifyContent: 'center',\n },\n cellSelected: {\n borderWidth: 3,\n borderColor: colors.interaction,\n },\n })\n}\n"]}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { ImagePickerAsset } from '../../utils/native_adapters/image_picker';
|
|
3
2
|
interface UploadTabProps {
|
|
4
3
|
imagePreviewUri: string | null;
|
|
5
4
|
onImageSelect: (asset: ImagePickerAsset) => void;
|
|
6
5
|
}
|
|
7
|
-
export declare function UploadTab({ imagePreviewUri, onImageSelect }: UploadTabProps):
|
|
6
|
+
export declare function UploadTab({ imagePreviewUri, onImageSelect }: UploadTabProps): import("react/jsx-runtime").JSX.Element;
|
|
8
7
|
export {};
|
|
9
8
|
//# sourceMappingURL=upload_tab.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload_tab.d.ts","sourceRoot":"","sources":["../../../src/screens/avatar_picker/upload_tab.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"upload_tab.d.ts","sourceRoot":"","sources":["../../../src/screens/avatar_picker/upload_tab.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAA;AAIhF,UAAU,cAAc;IACtB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,aAAa,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAA;CACjD;AAED,wBAAgB,SAAS,CAAC,EAAE,eAAe,EAAE,aAAa,EAAE,EAAE,cAAc,2CAmC3E"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback } from 'react';
|
|
2
3
|
import { Alert, StyleSheet, View } from 'react-native';
|
|
3
4
|
import { Button } from '../../components';
|
|
4
5
|
import { useTheme } from '../../hooks';
|
|
@@ -22,9 +23,7 @@ export function UploadTab({ imagePreviewUri, onImageSelect }) {
|
|
|
22
23
|
}
|
|
23
24
|
onImageSelect(asset);
|
|
24
25
|
}, [onImageSelect]);
|
|
25
|
-
return (
|
|
26
|
-
<Button title={imagePreviewUri ? 'Change photo' : 'Choose photo'} iconNameLeft="general.image" onPress={pickImage} variant="outline" appearance="interaction" size="md" maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}/>
|
|
27
|
-
</View>);
|
|
26
|
+
return (_jsx(View, { style: styles.container, children: _jsx(Button, { title: imagePreviewUri ? 'Change photo' : 'Choose photo', iconNameLeft: "general.image", onPress: pickImage, variant: "outline", appearance: "interaction", size: "md", maxFontSizeMultiplier: MAX_FONT_SIZE_MULTIPLIER_LANDMARK }) }));
|
|
28
27
|
}
|
|
29
28
|
const useStyles = () => {
|
|
30
29
|
const { colors } = useTheme();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload_tab.js","sourceRoot":"","sources":["../../../src/screens/avatar_picker/upload_tab.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"upload_tab.js","sourceRoot":"","sources":["../../../src/screens/avatar_picker/upload_tab.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,iCAAiC,EAAE,MAAM,aAAa,CAAA;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAGzD,MAAM,aAAa,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAA,CAAC,OAAO;AAO9C,MAAM,UAAU,SAAS,CAAC,EAAE,eAAe,EAAE,aAAa,EAAkB;IAC1E,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAE1B,MAAM,SAAS,GAAG,WAAW,CAAC,KAAK,IAAI,EAAE;QACvC,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,qBAAqB,CAAC;YACrD,UAAU,EAAE,CAAC,QAAQ,CAAC;YACtB,aAAa,EAAE,IAAI;YACnB,uBAAuB,EAAE,KAAK;SAC/B,CAAC,CAAA;QAEF,IAAI,MAAM,CAAC,QAAQ,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;YAAE,OAAM;QAElD,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QAE9B,IAAI,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,GAAG,aAAa,EAAE,CAAC;YACrD,KAAK,CAAC,KAAK,CAAC,iBAAiB,EAAE,oCAAoC,CAAC,CAAA;YACpE,OAAM;QACR,CAAC;QAED,aAAa,CAAC,KAAK,CAAC,CAAA;IACtB,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAA;IAEnB,OAAO,CACL,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,SAAS,YAC3B,KAAC,MAAM,IACL,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,EACxD,YAAY,EAAC,eAAe,EAC5B,OAAO,EAAE,SAAS,EAClB,OAAO,EAAC,SAAS,EACjB,UAAU,EAAC,aAAa,EACxB,IAAI,EAAC,IAAI,EACT,qBAAqB,EAAE,iCAAiC,GACxD,GACG,CACR,CAAA;AACH,CAAC;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAE7B,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,SAAS,EAAE;YACT,IAAI,EAAE,CAAC;YACP,UAAU,EAAE,QAAQ;YACpB,cAAc,EAAE,QAAQ;YACxB,eAAe,EAAE,MAAM,CAAC,2BAA2B;SACpD;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React, { useCallback } from 'react'\nimport { Alert, StyleSheet, View } from 'react-native'\nimport { Button } from '../../components'\nimport { useTheme } from '../../hooks'\nimport { MAX_FONT_SIZE_MULTIPLIER_LANDMARK } from '../../utils'\nimport { ImagePicker } from '../../utils/native_adapters'\nimport type { ImagePickerAsset } from '../../utils/native_adapters/image_picker'\n\nconst MAX_FILE_SIZE = 10 * 1024 * 1024 // 10MB\n\ninterface UploadTabProps {\n imagePreviewUri: string | null\n onImageSelect: (asset: ImagePickerAsset) => void\n}\n\nexport function UploadTab({ imagePreviewUri, onImageSelect }: UploadTabProps) {\n const styles = useStyles()\n\n const pickImage = useCallback(async () => {\n const result = await ImagePicker.openImageLibraryAsync({\n mediaTypes: ['images'],\n allowsEditing: true,\n allowsMultipleSelection: false,\n })\n\n if (result.canceled || !result.assets?.[0]) return\n\n const asset = result.assets[0]\n\n if (asset.fileSize && asset.fileSize > MAX_FILE_SIZE) {\n Alert.alert('Image too large', 'Please choose an image under 10MB.')\n return\n }\n\n onImageSelect(asset)\n }, [onImageSelect])\n\n return (\n <View style={styles.container}>\n <Button\n title={imagePreviewUri ? 'Change photo' : 'Choose photo'}\n iconNameLeft=\"general.image\"\n onPress={pickImage}\n variant=\"outline\"\n appearance=\"interaction\"\n size=\"md\"\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}\n />\n </View>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n\n return StyleSheet.create({\n container: {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: colors.fillColorNeutral100Inverted,\n },\n })\n}\n"]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { NativeStackNavigationOptions, NativeStackScreenProps } from '@react-navigation/native-stack';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
export declare const BugReportScreenOptions: ({ navigation, }: NativeStackScreenProps<any>) => NativeStackNavigationOptions;
|
|
4
|
-
export declare function BugReportScreen():
|
|
3
|
+
export declare function BugReportScreen(): import("react/jsx-runtime").JSX.Element;
|
|
5
4
|
//# sourceMappingURL=bug_report_screen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bug_report_screen.d.ts","sourceRoot":"","sources":["../../src/screens/bug_report_screen.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,4BAA4B,EAC5B,sBAAsB,EACvB,MAAM,gCAAgC,CAAA;
|
|
1
|
+
{"version":3,"file":"bug_report_screen.d.ts","sourceRoot":"","sources":["../../src/screens/bug_report_screen.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,4BAA4B,EAC5B,sBAAsB,EACvB,MAAM,gCAAgC,CAAA;AAmDvC,eAAO,MAAM,sBAAsB,GAAI,iBAEpC,sBAAsB,CAAC,GAAG,CAAC,KAAG,4BAI/B,CAAA;AAoBF,wBAAgB,eAAe,4CA0S9B"}
|