@openpeepshq/rn-components 0.7.0 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/README.md +63 -0
- package/metro/css-interop-observable.js +41 -0
- package/metro/resolve-asset-source.js +19 -0
- package/metro.js +67 -0
- package/package.json +1 -1
- package/react-native.config.js +5 -0
- package/src/assets/audio/click-notification.wav +0 -0
- package/src/assets/images/audio-container.png +0 -0
- package/src/assets/images/black-ambition-2025-hero.png +0 -0
- package/src/assets/images/default-group-avatar.png +0 -0
- package/src/assets/images/event-placeholder.png +0 -0
- package/src/assets/images/group-header-placeholder.png +0 -0
- package/src/assets/images/jam-placeholder.png +0 -0
- package/src/assets/images/logo.webp +0 -0
- package/src/assets/images/profile-background-placeholder.png +0 -0
- package/src/assets/images/success.webp +0 -0
- package/src/assets/images/welcome-bg.webp +0 -0
- package/src/components/CapabilityMatrix.tsx +218 -0
- package/src/components/configuration/ConfigMenuButton.tsx +48 -0
- package/src/components/configuration/index.ts +1 -0
- package/src/components/conversations/ConversationMessageBubble.tsx +51 -0
- package/src/components/conversations/ConversationParticipantsModal.tsx +46 -0
- package/src/components/conversations/ConversationPreviewCard.tsx +158 -0
- package/src/components/conversations/ConversationProfileHeader.tsx +28 -0
- package/src/components/conversations/ConversationSettingsSheet.tsx +81 -0
- package/src/components/conversations/CreateNewConversationContext.tsx +71 -0
- package/src/components/conversations/DirectMessagesHeaderActions.tsx +24 -0
- package/src/components/conversations/MessageInThread.tsx +131 -0
- package/src/components/conversations/index.ts +8 -0
- package/src/components/custom/common/Loader.tsx +67 -0
- package/src/components/custom/common/agenda-tabs.tsx +47 -0
- package/src/components/custom/common/audio-player.tsx +219 -0
- package/src/components/custom/common/cached-image.tsx +34 -0
- package/src/components/custom/common/cached-video-player.tsx +497 -0
- package/src/components/custom/common/empty-state-container.tsx +58 -0
- package/src/components/custom/common/image-grid.tsx +95 -0
- package/src/components/custom/common/index.ts +12 -0
- package/src/components/custom/common/infinite-scroll-container.tsx +99 -0
- package/src/components/custom/common/media-upload-progress.tsx +109 -0
- package/src/components/custom/common/participant-avatar.tsx +34 -0
- package/src/components/custom/common/popover.tsx +268 -0
- package/src/components/custom/common/select.tsx +215 -0
- package/src/components/custom/date/formatter.ts +24 -0
- package/src/components/custom/date/index.ts +3 -0
- package/src/components/custom/date/timespan.tsx +49 -0
- package/src/components/custom/date/updating-date.tsx +31 -0
- package/src/components/custom/index.ts +4 -0
- package/src/components/custom/modals/common/base-sheet.tsx +104 -0
- package/src/components/custom/modals/common/index.ts +3 -0
- package/src/components/custom/modals/common/sheet-backdrop.tsx +14 -0
- package/src/components/custom/modals/common/sheet-footer.tsx +59 -0
- package/src/components/custom/modals/index.ts +3 -0
- package/src/components/custom/modals/media/alt-text-sheet.tsx +90 -0
- package/src/components/custom/modals/media/audio-picker-sheet.tsx +180 -0
- package/src/components/custom/modals/media/document-picker-sheet.tsx +384 -0
- package/src/components/custom/modals/media/image-picker-sheet.tsx +200 -0
- package/src/components/custom/modals/media/index.ts +7 -0
- package/src/components/custom/modals/media/record-audio-sheet.tsx +227 -0
- package/src/components/custom/modals/media/send-media-sheet.tsx +278 -0
- package/src/components/custom/modals/media/video-picker-sheet.tsx +109 -0
- package/src/components/custom/modals/settings/edit-notifications-sheet.tsx +184 -0
- package/src/components/custom/modals/settings/index.ts +1 -0
- package/src/components/custom/navigation/side-menu.tsx +223 -0
- package/src/components/form/HeaderAvatarInput.tsx +108 -0
- package/src/components/form/ImageInput.tsx +86 -0
- package/src/components/form/RadioSelect.tsx +58 -0
- package/src/components/form/TimeZoneSelect.tsx +97 -0
- package/src/components/form/index.ts +4 -0
- package/src/components/groups/AddGroupMemberModal.tsx +58 -0
- package/src/components/groups/AddGroupMembersButton.tsx +39 -0
- package/src/components/groups/ChangeGroupRolesModal.tsx +121 -0
- package/src/components/groups/ConfirmGroupExitModal.tsx +66 -0
- package/src/components/groups/ConfirmMemberRemovalModal.tsx +73 -0
- package/src/components/groups/DeleteGroupModal.tsx +68 -0
- package/src/components/groups/GroupAvatar.tsx +73 -0
- package/src/components/groups/GroupCapabilityMatrix.tsx +40 -0
- package/src/components/groups/GroupCard.tsx +84 -0
- package/src/components/groups/GroupFeed.tsx +25 -0
- package/src/components/groups/GroupForm.tsx +148 -0
- package/src/components/groups/GroupHeader.tsx +74 -0
- package/src/components/groups/GroupMembersList.tsx +194 -0
- package/src/components/groups/GroupNameFromId.tsx +17 -0
- package/src/components/groups/GroupNotificationSettingsModal.tsx +139 -0
- package/src/components/groups/GroupOptionsMenu.tsx +183 -0
- package/src/components/groups/GroupShareMenu.tsx +130 -0
- package/src/components/groups/JoinGroupButton.tsx +42 -0
- package/src/components/groups/index.ts +18 -0
- package/src/components/icons/iconWithClassName.ts +12 -0
- package/src/components/icons/index.ts +289 -0
- package/src/components/icons/types.ts +4 -0
- package/src/components/index.ts +12 -0
- package/src/components/jams/CreateNewJam.tsx +20 -0
- package/src/components/jams/CreateNewJamContext.tsx +36 -0
- package/src/components/jams/DeleteJamModal.tsx +69 -0
- package/src/components/jams/JamActionsFooter.tsx +85 -0
- package/src/components/jams/JamAnimatedEmoji.tsx +112 -0
- package/src/components/jams/JamCallParticipant.tsx +348 -0
- package/src/components/jams/JamCapacityGate.tsx +88 -0
- package/src/components/jams/JamCard.tsx +72 -0
- package/src/components/jams/JamChatDrawer.tsx +114 -0
- package/src/components/jams/JamChatMessage.tsx +86 -0
- package/src/components/jams/JamConference.tsx +69 -0
- package/src/components/jams/JamDesktopFooter.tsx +182 -0
- package/src/components/jams/JamDetailsDrawer.tsx +187 -0
- package/src/components/jams/JamDeviceSelectors.tsx +243 -0
- package/src/components/jams/JamDrawer.tsx +37 -0
- package/src/components/jams/JamFooter.tsx +241 -0
- package/src/components/jams/JamGuestForm.tsx +120 -0
- package/src/components/jams/JamLobby.tsx +203 -0
- package/src/components/jams/JamObserverShell.tsx +43 -0
- package/src/components/jams/JamParticipantConference.tsx +146 -0
- package/src/components/jams/JamPeopleDrawer.tsx +183 -0
- package/src/components/jams/JamReactionMenu.tsx +120 -0
- package/src/components/jams/JamRequestJoin.tsx +46 -0
- package/src/components/jams/JamRoom.tsx +194 -0
- package/src/components/jams/JamRoomIndicators.tsx +73 -0
- package/src/components/jams/JamRoomPanel.tsx +35 -0
- package/src/components/jams/JamToolbarButton.tsx +89 -0
- package/src/components/jams/JamVideoCall.tsx +50 -0
- package/src/components/jams/JamVideoLayout.tsx +401 -0
- package/src/components/jams/LeaveCloseButton.tsx +60 -0
- package/src/components/jams/LiveJamsSection.tsx +53 -0
- package/src/components/jams/index.ts +28 -0
- package/src/components/jams/useParticipantConnection.ts +43 -0
- package/src/components/layout/AuthLayout.tsx +156 -0
- package/src/components/layout/ContentHeader.tsx +62 -0
- package/src/components/layout/HeaderActionButton.tsx +23 -0
- package/src/components/layout/HeaderMobile.tsx +106 -0
- package/src/components/layout/PlusButton.tsx +34 -0
- package/src/components/layout/RootLayout.tsx +30 -0
- package/src/components/layout/index.ts +13 -0
- package/src/components/layout/pageChrome.test.tsx +147 -0
- package/src/components/layout/pageChrome.tsx +112 -0
- package/src/components/markdown/OpenpeepsMarkdown.tsx +129 -0
- package/src/components/markdown/extensions/codeBlock.tsx +63 -0
- package/src/components/markdown/extensions/codeInline.tsx +82 -0
- package/src/components/markdown/extensions/hashtag.tsx +77 -0
- package/src/components/markdown/extensions/html.test.tsx +172 -0
- package/src/components/markdown/extensions/html.tsx +116 -0
- package/src/components/markdown/extensions/mention.tsx +92 -0
- package/src/components/markdown/index.ts +2 -0
- package/src/components/markdown/theme.ts +59 -0
- package/src/components/markdown/utils.ts +34 -0
- package/src/components/navigation/Base.tsx +21 -0
- package/src/components/navigation/auth-navigator.tsx +47 -0
- package/src/components/navigation/helpers.ts +101 -0
- package/src/components/navigation/index.tsx +157 -0
- package/src/components/navigation/main-navigator.tsx +176 -0
- package/src/components/navigation/nativeRouter.tsx +255 -0
- package/src/components/navigation/parent-back.ts +139 -0
- package/src/components/navigation/side-menu-drawer.tsx +69 -0
- package/src/components/navigation/side-menu-wrapper.tsx +82 -0
- package/src/components/navigation/tab-navigator.tsx +254 -0
- package/src/components/navigation/types/auth.ts +23 -0
- package/src/components/navigation/types/index.ts +4 -0
- package/src/components/navigation/types/main.ts +156 -0
- package/src/components/navigation/types/root.ts +13 -0
- package/src/components/navigation/types/tabs.ts +51 -0
- package/src/components/notifications/NotificationErrorBoundary.tsx +40 -0
- package/src/components/notifications/NotificationHeaderActions.tsx +55 -0
- package/src/components/notifications/NotificationItem.tsx +80 -0
- package/src/components/notifications/NotificationWrapper.tsx +57 -0
- package/src/components/notifications/NotificationsList.tsx +103 -0
- package/src/components/notifications/index.ts +6 -0
- package/src/components/notifications/types/Announcement.tsx +51 -0
- package/src/components/notifications/types/DirectMessage.tsx +55 -0
- package/src/components/notifications/types/Follow.tsx +54 -0
- package/src/components/notifications/types/GroupMemberExit.tsx +52 -0
- package/src/components/notifications/types/JamModerator.tsx +38 -0
- package/src/components/notifications/types/JamSpeaker.tsx +38 -0
- package/src/components/notifications/types/JamStarted.tsx +39 -0
- package/src/components/notifications/types/Mention.tsx +56 -0
- package/src/components/notifications/types/NewGroupInvitation.tsx +53 -0
- package/src/components/notifications/types/NewGroupMember.tsx +57 -0
- package/src/components/notifications/types/NewGroupPost.tsx +41 -0
- package/src/components/notifications/types/NewProfile.tsx +53 -0
- package/src/components/notifications/types/PollEnded.tsx +55 -0
- package/src/components/notifications/types/PollVote.tsx +50 -0
- package/src/components/notifications/types/Reaction.tsx +49 -0
- package/src/components/notifications/types/Reply.tsx +52 -0
- package/src/components/notifications/types/Repost.tsx +49 -0
- package/src/components/notifications/types/Rsvp.tsx +48 -0
- package/src/components/notifications/types/RsvpCanceled.tsx +72 -0
- package/src/components/notifications/types/index.ts +19 -0
- package/src/components/post/CompactReplyParent.tsx +273 -0
- package/src/components/post/EventViewSwitch.tsx +42 -0
- package/src/components/post/Feed.tsx +110 -0
- package/src/components/post/FeedFormatSwitch.tsx +47 -0
- package/src/components/post/FeedPost.tsx +115 -0
- package/src/components/post/FeedPostContent.tsx +52 -0
- package/src/components/post/FullPostLayout.tsx +54 -0
- package/src/components/post/Markdown.tsx +8 -0
- package/src/components/post/NewEventButton.tsx +61 -0
- package/src/components/post/NewNoteButton.tsx +48 -0
- package/src/components/post/NewResourceButton.tsx +57 -0
- package/src/components/post/PinnedPost.tsx +42 -0
- package/src/components/post/PostDetail.tsx +55 -0
- package/src/components/post/ReplyBox.tsx +36 -0
- package/src/components/post/VideoPlayOverlay.tsx +23 -0
- package/src/components/post/feed/events/EventsCalendar.tsx +213 -0
- package/src/components/post/feed/events/EventsFeed.tsx +91 -0
- package/src/components/post/feed/events/EventsView.tsx +30 -0
- package/src/components/post/feed/events/index.ts +3 -0
- package/src/components/post/feed/threaded/ThreadPost.tsx +76 -0
- package/src/components/post/feed/threaded/ThreadedFeed.tsx +47 -0
- package/src/components/post/feed/threaded/index.ts +2 -0
- package/src/components/post/helpers.ts +54 -0
- package/src/components/post/index.ts +21 -0
- package/src/components/post/pieces/Attachments.tsx +153 -0
- package/src/components/post/pieces/AudioAttachment.tsx +57 -0
- package/src/components/post/pieces/DocumentAttachment.tsx +41 -0
- package/src/components/post/pieces/EventLocation.tsx +46 -0
- package/src/components/post/pieces/EventMenu.tsx +126 -0
- package/src/components/post/pieces/EventOccurrenceList.tsx +131 -0
- package/src/components/post/pieces/EventRsvpButton.tsx +177 -0
- package/src/components/post/pieces/EventRsvpList.tsx +277 -0
- package/src/components/post/pieces/EventRsvpScopeDialog.tsx +238 -0
- package/src/components/post/pieces/FeedPostStats.tsx +75 -0
- package/src/components/post/pieces/FeedThreadPreview.tsx +88 -0
- package/src/components/post/pieces/GalleryModal.tsx +115 -0
- package/src/components/post/pieces/ParticipantsCard.tsx +20 -0
- package/src/components/post/pieces/PollContent.tsx +219 -0
- package/src/components/post/pieces/PostActions.tsx +81 -0
- package/src/components/post/pieces/PostInfoHeader.tsx +52 -0
- package/src/components/post/pieces/PostMenu.tsx +477 -0
- package/src/components/post/pieces/PostReactionHeader.tsx +120 -0
- package/src/components/post/pieces/ShareMenu.tsx +127 -0
- package/src/components/post/pieces/UnreadPostIndicator.tsx +34 -0
- package/src/components/post/pieces/VideoPlayer.tsx +30 -0
- package/src/components/post/pieces/VisibilityDisplay.tsx +43 -0
- package/src/components/post/pieces/gallery/GalleryAudio.tsx +20 -0
- package/src/components/post/pieces/gallery/GalleryDocument.tsx +35 -0
- package/src/components/post/pieces/gallery/GalleryImage.tsx +15 -0
- package/src/components/post/pieces/gallery/GalleryVideo.tsx +39 -0
- package/src/components/post/pieces/gallery/index.ts +4 -0
- package/src/components/post/pieces/index.ts +24 -0
- package/src/components/post/pieces/modals/CancelEventModal.tsx +60 -0
- package/src/components/post/pieces/modals/DeleteEventModal.tsx +60 -0
- package/src/components/post/pieces/modals/DeletePostModal.tsx +54 -0
- package/src/components/post/pieces/modals/PostOptionsSheet.tsx +59 -0
- package/src/components/post/pieces/modals/ReactionsModal.tsx +45 -0
- package/src/components/post/pieces/modals/RepostModal.tsx +56 -0
- package/src/components/post/pieces/modals/index.ts +6 -0
- package/src/components/post/post-form/ArticleForm.tsx +101 -0
- package/src/components/post/post-form/ArticlePreviewSheet.tsx +24 -0
- package/src/components/post/post-form/AttachmentCard.tsx +119 -0
- package/src/components/post/post-form/ComposeAttachments.tsx +126 -0
- package/src/components/post/post-form/ComposePreviewLinks.tsx +21 -0
- package/src/components/post/post-form/DateSheet.tsx +154 -0
- package/src/components/post/post-form/DescriptionEditModal.tsx +58 -0
- package/src/components/post/post-form/EditPostModalContext.tsx +49 -0
- package/src/components/post/post-form/EventForm.tsx +416 -0
- package/src/components/post/post-form/EventTypeSwitcher.tsx +164 -0
- package/src/components/post/post-form/Footer.tsx +61 -0
- package/src/components/post/post-form/NewPostModalContext.tsx +77 -0
- package/src/components/post/post-form/OpenpeepsMarkdownInput.tsx +218 -0
- package/src/components/post/post-form/PollComposerFields.tsx +141 -0
- package/src/components/post/post-form/PostAudienceSelector.tsx +82 -0
- package/src/components/post/post-form/PostForm.tsx +187 -0
- package/src/components/post/post-form/PostTypeSwitcher.tsx +125 -0
- package/src/components/post/post-form/ReplyModal.tsx +40 -0
- package/src/components/post/post-form/ReplyModalContext.tsx +24 -0
- package/src/components/post/post-form/ResourceForm.tsx +241 -0
- package/src/components/post/post-form/VisibilitySelector.tsx +60 -0
- package/src/components/post/post-form/VisibilitySheet.tsx +239 -0
- package/src/components/post/post-form/constants.ts +47 -0
- package/src/components/post/post-form/index.ts +23 -0
- package/src/components/post/types/Article.tsx +55 -0
- package/src/components/post/types/Event.tsx +79 -0
- package/src/components/post/types/Note.tsx +29 -0
- package/src/components/post/types/Poll.tsx +34 -0
- package/src/components/post/types/article/CardArticle.tsx +44 -0
- package/src/components/post/types/article/FullArticle.tsx +56 -0
- package/src/components/post/types/article/index.ts +2 -0
- package/src/components/post/types/event/CardEvent.tsx +138 -0
- package/src/components/post/types/event/FullEvent.tsx +760 -0
- package/src/components/post/types/event/ProfileEventRelationship.tsx +56 -0
- package/src/components/post/types/event/index.ts +3 -0
- package/src/components/post/types/index.ts +9 -0
- package/src/components/post/types/note/FullNote.tsx +15 -0
- package/src/components/post/types/note/index.ts +1 -0
- package/src/components/post/types/poll/FullPoll.tsx +26 -0
- package/src/components/post/types/poll/index.ts +1 -0
- package/src/components/post/types/resource/FullResource.tsx +177 -0
- package/src/components/preview-link/AccessDenied.tsx +44 -0
- package/src/components/preview-link/LocalPreviewLink.tsx +40 -0
- package/src/components/preview-link/PreviewLink.tsx +27 -0
- package/src/components/preview-link/RemotePreviewLink.tsx +76 -0
- package/src/components/preview-link/helpers.ts +38 -0
- package/src/components/preview-link/index.ts +7 -0
- package/src/components/preview-link/local/GroupPreview.tsx +57 -0
- package/src/components/preview-link/local/JamPreview.tsx +40 -0
- package/src/components/preview-link/local/PostPreview.tsx +40 -0
- package/src/components/profile/Avatar.tsx +90 -0
- package/src/components/profile/AvatarWithName.tsx +18 -0
- package/src/components/profile/EditProfileForm.tsx +380 -0
- package/src/components/profile/FollowUnfollowButton.tsx +83 -0
- package/src/components/profile/ProfileActivitySummary.tsx +129 -0
- package/src/components/profile/ProfileBadge.tsx +52 -0
- package/src/components/profile/ProfileCard.tsx +122 -0
- package/src/components/profile/ProfileFromId.tsx +23 -0
- package/src/components/profile/ProfileHeader.tsx +107 -0
- package/src/components/profile/ProfileLink.tsx +35 -0
- package/src/components/profile/ProfilePageAction.tsx +193 -0
- package/src/components/profile/ProfilePieces.tsx +191 -0
- package/src/components/profile/ProfilePostsAndReplies.tsx +108 -0
- package/src/components/profile/ProfileSelector.tsx +210 -0
- package/src/components/profile/ProfileSheet.tsx +48 -0
- package/src/components/profile/ProfileStats.tsx +47 -0
- package/src/components/profile/ProfileWithActionCard.tsx +35 -0
- package/src/components/profile/ProfilesInput.tsx +81 -0
- package/src/components/profile/ReportProfileOrPostModal.tsx +228 -0
- package/src/components/profile/index.ts +19 -0
- package/src/components/resources/ResourceCard.tsx +294 -0
- package/src/components/resources/ResourceLibrary.tsx +387 -0
- package/src/components/resources/index.ts +4 -0
- package/src/components/ui/alert.tsx +87 -0
- package/src/components/ui/avatar.tsx +91 -0
- package/src/components/ui/badge.tsx +36 -0
- package/src/components/ui/bottom-sheet.tsx +253 -0
- package/src/components/ui/button.tsx +101 -0
- package/src/components/ui/calendar.tsx +117 -0
- package/src/components/ui/card.tsx +87 -0
- package/src/components/ui/checkbox.tsx +35 -0
- package/src/components/ui/combobox.tsx +229 -0
- package/src/components/ui/dropdown-menu.tsx +350 -0
- package/src/components/ui/form.tsx +716 -0
- package/src/components/ui/index.ts +49 -0
- package/src/components/ui/input.tsx +25 -0
- package/src/components/ui/label.tsx +33 -0
- package/src/components/ui/loading-spinner.tsx +24 -0
- package/src/components/ui/popup-menu-button.tsx +99 -0
- package/src/components/ui/popup-menu-section.tsx +21 -0
- package/src/components/ui/popup-menu-separator.tsx +10 -0
- package/src/components/ui/popup-menu.tsx +75 -0
- package/src/components/ui/progress.tsx +83 -0
- package/src/components/ui/radio-group.tsx +42 -0
- package/src/components/ui/select.tsx +200 -0
- package/src/components/ui/separator.tsx +28 -0
- package/src/components/ui/skeleton.tsx +39 -0
- package/src/components/ui/svg-image.tsx +89 -0
- package/src/components/ui/switch.tsx +95 -0
- package/src/components/ui/tabs.tsx +93 -0
- package/src/components/ui/text.tsx +28 -0
- package/src/components/ui/textarea.tsx +39 -0
- package/src/components/ui/themed-safe-area-view.tsx +25 -0
- package/src/components/ui/themed-text.tsx +28 -0
- package/src/components/ui/themed-view.tsx +24 -0
- package/src/components/ui/tooltip.tsx +41 -0
- package/src/contexts/drawer-context.tsx +38 -0
- package/src/contexts/openpeeps-provider.tsx +135 -0
- package/src/global.css +53 -0
- package/src/hooks/helper.ts +26 -0
- package/src/hooks/index.ts +5 -0
- package/src/hooks/use-cached-media-uri.ts +59 -0
- package/src/hooks/use-controlled-sheet.ts +16 -0
- package/src/hooks/use-notification-badge-reset.ts +93 -0
- package/src/hooks/use-post-view-ref.ts +65 -0
- package/src/i18n/index.ts +49 -0
- package/src/index.ts +42 -0
- package/src/lib/attachmentHelpers.ts +15 -0
- package/src/lib/auth.ts +17 -0
- package/src/lib/bottom-sheet-ref.ts +30 -0
- package/src/lib/constants.ts +14 -0
- package/src/lib/credentialsStore.ts +20 -0
- package/src/lib/downloadFile.ts +12 -0
- package/src/lib/livekit/useStableLiveKitRoom.ts +172 -0
- package/src/lib/media-permissions.ts +90 -0
- package/src/lib/media-url.ts +51 -0
- package/src/lib/mediaUriHelpers.ts +94 -0
- package/src/lib/notification-helpers.ts +17 -0
- package/src/lib/notifications-screen-state.ts +21 -0
- package/src/lib/polyfills/customEvent.ts +40 -0
- package/src/lib/post.ts +175 -0
- package/src/lib/push-notification-navigation.ts +11 -0
- package/src/lib/push-notifications-background.ts +13 -0
- package/src/lib/push-notifications.ts +247 -0
- package/src/lib/uploadMedia.ts +191 -0
- package/src/lib/utils.ts +247 -0
- package/src/nativewind-env.d.ts +1 -0
- package/src/pages/About.tsx +27 -0
- package/src/pages/CodeOfConduct.tsx +24 -0
- package/src/pages/Explore.tsx +297 -0
- package/src/pages/Members.tsx +118 -0
- package/src/pages/NotFound.tsx +36 -0
- package/src/pages/Notifications.tsx +39 -0
- package/src/pages/PostDetail.tsx +61 -0
- package/src/pages/Profile.tsx +77 -0
- package/src/pages/Tags.tsx +114 -0
- package/src/pages/VideoPlayer.tsx +16 -0
- package/src/pages/Welcome.tsx +214 -0
- package/src/pages/articles/Edit.tsx +72 -0
- package/src/pages/articles/Index.tsx +31 -0
- package/src/pages/articles/New.tsx +55 -0
- package/src/pages/auth/Login.tsx +148 -0
- package/src/pages/auth/Register.tsx +271 -0
- package/src/pages/auth/RegisterInvitation.tsx +8 -0
- package/src/pages/auth/RequestResetPassword.tsx +102 -0
- package/src/pages/auth/ResetPassword.tsx +48 -0
- package/src/pages/auth/Success.tsx +104 -0
- package/src/pages/auth/ValidateEmail.tsx +80 -0
- package/src/pages/auth/Welcome.tsx +64 -0
- package/src/pages/conversations/Index.tsx +168 -0
- package/src/pages/conversations/Info.tsx +99 -0
- package/src/pages/conversations/New.tsx +135 -0
- package/src/pages/conversations/NewDraft.tsx +102 -0
- package/src/pages/conversations/Show.tsx +261 -0
- package/src/pages/events/Edit.tsx +74 -0
- package/src/pages/events/Index.tsx +99 -0
- package/src/pages/events/My.tsx +60 -0
- package/src/pages/events/New.tsx +51 -0
- package/src/pages/feeds/Bookmarks.tsx +47 -0
- package/src/pages/feeds/Local.tsx +45 -0
- package/src/pages/feeds/My.tsx +37 -0
- package/src/pages/groups/Edit.tsx +58 -0
- package/src/pages/groups/EditInfo.tsx +79 -0
- package/src/pages/groups/EditRoles.tsx +84 -0
- package/src/pages/groups/Index.tsx +159 -0
- package/src/pages/groups/Info.tsx +197 -0
- package/src/pages/groups/Members.tsx +55 -0
- package/src/pages/groups/New.tsx +80 -0
- package/src/pages/groups/Show.tsx +212 -0
- package/src/pages/index.ts +66 -0
- package/src/pages/jams/Event.tsx +49 -0
- package/src/pages/jams/Index.tsx +137 -0
- package/src/pages/jams/My.tsx +4 -0
- package/src/pages/jams/New.tsx +121 -0
- package/src/pages/posts/Edit.tsx +157 -0
- package/src/pages/posts/New.tsx +334 -0
- package/src/pages/posts/Reply.tsx +351 -0
- package/src/pages/profile/Followers.tsx +45 -0
- package/src/pages/profile/Following.tsx +44 -0
- package/src/pages/resources/Edit.tsx +72 -0
- package/src/pages/resources/Index.tsx +25 -0
- package/src/pages/resources/New.tsx +55 -0
- package/src/pages/settings/AccessTokens.tsx +276 -0
- package/src/pages/settings/Account.tsx +272 -0
- package/src/pages/settings/Blocked.tsx +81 -0
- package/src/pages/settings/Feed.tsx +78 -0
- package/src/pages/settings/Index.tsx +75 -0
- package/src/pages/settings/Language.tsx +81 -0
- package/src/pages/settings/NotificationPreferences.tsx +131 -0
- package/src/pages/settings/Notifications.tsx +36 -0
- package/src/pages/settings/PublicProfile.tsx +20 -0
- package/src/pages/settings/PushEnabledDevices.tsx +151 -0
- package/src/pages/settings/Theme.tsx +106 -0
- package/src/pages/settings/Timezone.tsx +75 -0
- package/src/stores/useAppImagesStore.ts +15 -0
- package/src/stores/useLocalPostStore.ts +62 -0
- package/src/stores/useNewConversationStore.ts +39 -0
- package/src/theme/OpenPeepsThemeProvider.tsx +98 -0
- package/src/theme/defaults.ts +40 -0
- package/src/theme/types.ts +37 -0
- package/src/theme/utils.ts +62 -0
- package/src/types/env.d.ts +11 -0
- package/src/types/goto.ts +12 -0
- package/src/types/markdown-plugin.ts +17 -0
- package/src/types/react-native-convert-ph-asset.d.ts +24 -0
- package/src/types.ts +56 -0
- package/src/utils/media-cache.ts +178 -0
- package/tailwind.config.js +128 -0
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Pressable, ScrollView, View } from 'react-native';
|
|
3
|
+
import Clipboard from '@react-native-clipboard/clipboard';
|
|
4
|
+
import Toast from 'react-native-toast-message';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import { truncateText } from '@openpeepshq/common';
|
|
7
|
+
import { useJamDetails, useJamRtmpStream } from '@openpeepshq/react';
|
|
8
|
+
import { CopyCheckIcon, CopyIcon } from '../icons/index';
|
|
9
|
+
import { Button } from '../ui/button';
|
|
10
|
+
import { Input } from '../ui/input';
|
|
11
|
+
import { Label } from '../ui/label';
|
|
12
|
+
import { ThemedText } from '../ui/themed-text';
|
|
13
|
+
import { BASE_URL } from '../../lib/constants';
|
|
14
|
+
import { JamDrawer } from './JamDrawer';
|
|
15
|
+
|
|
16
|
+
export interface JamDetailsDrawerProps {
|
|
17
|
+
open: boolean;
|
|
18
|
+
onClose: () => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const SectionHeading = ({ children }: { children: string }) => (
|
|
22
|
+
<ThemedText className="text-xs font-semibold uppercase text-muted-foreground">
|
|
23
|
+
{children}
|
|
24
|
+
</ThemedText>
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
const CopyLink = ({
|
|
28
|
+
url,
|
|
29
|
+
copyLabel,
|
|
30
|
+
copiedLabel,
|
|
31
|
+
truncate,
|
|
32
|
+
}: {
|
|
33
|
+
url: string;
|
|
34
|
+
copyLabel: string;
|
|
35
|
+
copiedLabel: string;
|
|
36
|
+
truncate?: number;
|
|
37
|
+
}) => {
|
|
38
|
+
const [copied, setCopied] = useState(false);
|
|
39
|
+
const Icon = copied ? CopyCheckIcon : CopyIcon;
|
|
40
|
+
return (
|
|
41
|
+
<>
|
|
42
|
+
<ThemedText className="mt-1 text-sm">
|
|
43
|
+
{truncate ? truncateText(url, truncate) : url}
|
|
44
|
+
</ThemedText>
|
|
45
|
+
<Pressable
|
|
46
|
+
className="mt-2 flex-row items-center"
|
|
47
|
+
onPress={() => {
|
|
48
|
+
Clipboard.setString(url);
|
|
49
|
+
setCopied(true);
|
|
50
|
+
}}
|
|
51
|
+
>
|
|
52
|
+
<Icon size={16} className="text-foreground" />
|
|
53
|
+
<ThemedText className="ml-2 text-sm">
|
|
54
|
+
{copied ? copiedLabel : copyLabel}
|
|
55
|
+
</ThemedText>
|
|
56
|
+
</Pressable>
|
|
57
|
+
</>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/** Jam details drawer (joining info + moderator observer link + RTMP). */
|
|
62
|
+
export const JamDetailsDrawer = ({ open, onClose }: JamDetailsDrawerProps) => {
|
|
63
|
+
const { t } = useTranslation();
|
|
64
|
+
const { jamPost, isModerator, observerPath } = useJamDetails();
|
|
65
|
+
|
|
66
|
+
if (!open) return null;
|
|
67
|
+
|
|
68
|
+
// The web drawer copies `window.location.href`; the equivalent web URL for
|
|
69
|
+
// this jam is the shareable one from a phone.
|
|
70
|
+
const href = `${BASE_URL}/events/${jamPost.id}/jam`;
|
|
71
|
+
const observerUrl = observerPath
|
|
72
|
+
? observerPath.startsWith('http')
|
|
73
|
+
? observerPath
|
|
74
|
+
: `${BASE_URL}${observerPath}`
|
|
75
|
+
: null;
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<JamDrawer title={t('jams.details.panelHeading')} onClose={onClose}>
|
|
79
|
+
<ScrollView
|
|
80
|
+
className="flex-1"
|
|
81
|
+
contentContainerClassName="gap-4 px-2 pb-4"
|
|
82
|
+
>
|
|
83
|
+
<View>
|
|
84
|
+
<SectionHeading>
|
|
85
|
+
{t('jams.details.joiningInfoHeading')}
|
|
86
|
+
</SectionHeading>
|
|
87
|
+
<CopyLink
|
|
88
|
+
url={href}
|
|
89
|
+
copyLabel={t('jams.details.copyJoiningInfo')}
|
|
90
|
+
copiedLabel={t('jams.details.copiedJoiningInfo')}
|
|
91
|
+
/>
|
|
92
|
+
</View>
|
|
93
|
+
|
|
94
|
+
{observerUrl ? (
|
|
95
|
+
<View>
|
|
96
|
+
<SectionHeading>
|
|
97
|
+
{t('jams.details.observerLinkHeading')}
|
|
98
|
+
</SectionHeading>
|
|
99
|
+
<CopyLink
|
|
100
|
+
url={observerUrl}
|
|
101
|
+
truncate={40}
|
|
102
|
+
copyLabel={t('jams.details.copyObserverLink')}
|
|
103
|
+
copiedLabel={t('jams.details.copiedObserverLink')}
|
|
104
|
+
/>
|
|
105
|
+
</View>
|
|
106
|
+
) : null}
|
|
107
|
+
|
|
108
|
+
{isModerator ? <JamRtmpStreamForm jamId={jamPost.id} /> : null}
|
|
109
|
+
</ScrollView>
|
|
110
|
+
</JamDrawer>
|
|
111
|
+
);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const JamRtmpStreamForm = ({ jamId }: { jamId: string }) => {
|
|
115
|
+
const { t } = useTranslation();
|
|
116
|
+
const {
|
|
117
|
+
live,
|
|
118
|
+
host,
|
|
119
|
+
url,
|
|
120
|
+
setUrl,
|
|
121
|
+
streamKey,
|
|
122
|
+
setStreamKey,
|
|
123
|
+
canSubmit,
|
|
124
|
+
toggle,
|
|
125
|
+
} = useJamRtmpStream({
|
|
126
|
+
jamId,
|
|
127
|
+
onSuccess: (text1) => Toast.show({ type: 'success', text1 }),
|
|
128
|
+
onError: (text1) => Toast.show({ type: 'error', text1 }),
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
return (
|
|
132
|
+
<View>
|
|
133
|
+
<SectionHeading>{t('jams.details.rtmpHeading')}</SectionHeading>
|
|
134
|
+
<ThemedText className="mt-1 text-sm text-muted-foreground">
|
|
135
|
+
{t('jams.details.rtmpHelp')}
|
|
136
|
+
</ThemedText>
|
|
137
|
+
{live ? (
|
|
138
|
+
<ThemedText className="mt-2 text-sm">
|
|
139
|
+
{t('jams.details.rtmpLive', { host: host || 'RTMP' })}
|
|
140
|
+
</ThemedText>
|
|
141
|
+
) : (
|
|
142
|
+
<View className="mt-2 gap-2">
|
|
143
|
+
<View>
|
|
144
|
+
<Label nativeID="rtmp-url" className="text-sm">
|
|
145
|
+
{t('jams.details.rtmpUrlLabel')}
|
|
146
|
+
</Label>
|
|
147
|
+
<Input
|
|
148
|
+
aria-labelledby="rtmp-url"
|
|
149
|
+
value={url}
|
|
150
|
+
onChangeText={setUrl}
|
|
151
|
+
placeholder={t('jams.details.rtmpUrlPlaceholder')}
|
|
152
|
+
autoCapitalize="none"
|
|
153
|
+
autoCorrect={false}
|
|
154
|
+
keyboardType="url"
|
|
155
|
+
className="mt-1"
|
|
156
|
+
/>
|
|
157
|
+
</View>
|
|
158
|
+
<View>
|
|
159
|
+
<Label nativeID="rtmp-key" className="text-sm">
|
|
160
|
+
{t('jams.details.rtmpStreamKeyLabel')}
|
|
161
|
+
</Label>
|
|
162
|
+
<Input
|
|
163
|
+
aria-labelledby="rtmp-key"
|
|
164
|
+
value={streamKey}
|
|
165
|
+
onChangeText={setStreamKey}
|
|
166
|
+
secureTextEntry
|
|
167
|
+
autoCapitalize="none"
|
|
168
|
+
autoCorrect={false}
|
|
169
|
+
className="mt-1"
|
|
170
|
+
/>
|
|
171
|
+
</View>
|
|
172
|
+
</View>
|
|
173
|
+
)}
|
|
174
|
+
<Button
|
|
175
|
+
variant="ghost"
|
|
176
|
+
size="sm"
|
|
177
|
+
className="mt-2 self-start"
|
|
178
|
+
disabled={!canSubmit}
|
|
179
|
+
onPress={toggle}
|
|
180
|
+
>
|
|
181
|
+
<ThemedText className="text-sm">
|
|
182
|
+
{live ? t('jams.details.rtmpStop') : t('jams.details.rtmpStart')}
|
|
183
|
+
</ThemedText>
|
|
184
|
+
</Button>
|
|
185
|
+
</View>
|
|
186
|
+
);
|
|
187
|
+
};
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
AudioSession,
|
|
4
|
+
useLocalParticipant,
|
|
5
|
+
useRoomContext,
|
|
6
|
+
} from '@livekit/react-native';
|
|
7
|
+
import { Room, RoomEvent } from 'livekit-client';
|
|
8
|
+
import { useTranslation } from 'react-i18next';
|
|
9
|
+
import {
|
|
10
|
+
CheckIcon,
|
|
11
|
+
MicIcon,
|
|
12
|
+
MicOffIcon,
|
|
13
|
+
VideoIcon,
|
|
14
|
+
VideoOffIcon,
|
|
15
|
+
Volume2Icon,
|
|
16
|
+
VolumeXIcon,
|
|
17
|
+
} from '../icons/index';
|
|
18
|
+
import type { iconWithClassName } from '../icons/iconWithClassName';
|
|
19
|
+
import { DropdownMenuItem } from '../ui/dropdown-menu';
|
|
20
|
+
import { ThemedText } from '../ui/themed-text';
|
|
21
|
+
import { JamToolbarButton, toneIconClass } from './JamToolbarButton';
|
|
22
|
+
|
|
23
|
+
type DeviceType = 'mic' | 'camera' | 'speaker';
|
|
24
|
+
export type JamIconType = ReturnType<typeof iconWithClassName>;
|
|
25
|
+
|
|
26
|
+
export interface JamDevice {
|
|
27
|
+
deviceId: string;
|
|
28
|
+
label: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface DeviceSelectorPillProps {
|
|
32
|
+
enabled: boolean;
|
|
33
|
+
onToggle: () => void;
|
|
34
|
+
onIcon: JamIconType;
|
|
35
|
+
offIcon: JamIconType;
|
|
36
|
+
deviceType: DeviceType;
|
|
37
|
+
/** Omit when the platform offers no device list (e.g. microphones). */
|
|
38
|
+
devices?: JamDevice[];
|
|
39
|
+
activeDeviceId?: string;
|
|
40
|
+
onDeviceChange?: (deviceId: string) => void;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Toggle pill with a drop-up listing the available devices. */
|
|
44
|
+
export const DeviceSelectorPill = ({
|
|
45
|
+
enabled,
|
|
46
|
+
onToggle,
|
|
47
|
+
onIcon: OnIcon,
|
|
48
|
+
offIcon: OffIcon,
|
|
49
|
+
deviceType,
|
|
50
|
+
devices,
|
|
51
|
+
activeDeviceId,
|
|
52
|
+
onDeviceChange,
|
|
53
|
+
}: DeviceSelectorPillProps) => {
|
|
54
|
+
const { t } = useTranslation();
|
|
55
|
+
const tone = enabled ? 'default' : 'danger';
|
|
56
|
+
const deviceLabel =
|
|
57
|
+
deviceType === 'mic'
|
|
58
|
+
? t('jams.device.microphone')
|
|
59
|
+
: deviceType === 'camera'
|
|
60
|
+
? t('jams.device.camera')
|
|
61
|
+
: '';
|
|
62
|
+
const ToggleIcon = enabled ? OffIcon : OnIcon;
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<JamToolbarButton
|
|
66
|
+
title={`${enabled ? t('jams.device.turnOff') : t('jams.device.turnOn')}${deviceLabel ? ` ${deviceLabel}` : ''}`}
|
|
67
|
+
tone={tone}
|
|
68
|
+
action={onToggle}
|
|
69
|
+
menuTitle={t('jams.device.changeTitle')}
|
|
70
|
+
menuChildren={
|
|
71
|
+
<>
|
|
72
|
+
<DropdownMenuItem
|
|
73
|
+
className="flex-row items-center gap-x-2"
|
|
74
|
+
onPress={onToggle}
|
|
75
|
+
>
|
|
76
|
+
<ToggleIcon size={16} className="text-foreground" />
|
|
77
|
+
<ThemedText>
|
|
78
|
+
{enabled ? t('jams.device.turnOff') : t('jams.device.turnOn')}
|
|
79
|
+
</ThemedText>
|
|
80
|
+
</DropdownMenuItem>
|
|
81
|
+
{devices && devices.length === 0 ? (
|
|
82
|
+
<ThemedText className="p-2 text-sm">
|
|
83
|
+
{t('jams.device.loadingDevices')}
|
|
84
|
+
</ThemedText>
|
|
85
|
+
) : null}
|
|
86
|
+
{devices?.map((device) => (
|
|
87
|
+
<DropdownMenuItem
|
|
88
|
+
key={device.deviceId}
|
|
89
|
+
className="flex-row items-center gap-x-2"
|
|
90
|
+
onPress={() => onDeviceChange?.(device.deviceId)}
|
|
91
|
+
>
|
|
92
|
+
<OnIcon size={16} className="text-foreground" />
|
|
93
|
+
<ThemedText numberOfLines={1} className="min-w-0 flex-1">
|
|
94
|
+
{device.label ||
|
|
95
|
+
(device.deviceId === 'default'
|
|
96
|
+
? t('jams.device.defaultSpeaker')
|
|
97
|
+
: device.deviceId)}
|
|
98
|
+
</ThemedText>
|
|
99
|
+
{device.deviceId === activeDeviceId ||
|
|
100
|
+
(activeDeviceId === '' && device.deviceId === 'default') ? (
|
|
101
|
+
<CheckIcon size={16} className="text-foreground" />
|
|
102
|
+
) : null}
|
|
103
|
+
</DropdownMenuItem>
|
|
104
|
+
))}
|
|
105
|
+
</>
|
|
106
|
+
}
|
|
107
|
+
>
|
|
108
|
+
{enabled ? (
|
|
109
|
+
<OnIcon size={20} className={toneIconClass[tone]} />
|
|
110
|
+
) : (
|
|
111
|
+
<OffIcon size={20} className={toneIconClass[tone]} />
|
|
112
|
+
)}
|
|
113
|
+
</JamToolbarButton>
|
|
114
|
+
);
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
/** Camera devices known to the room, refreshed on device changes. */
|
|
118
|
+
export const useCameraDevices = (room: Room) => {
|
|
119
|
+
const [devices, setDevices] = useState<JamDevice[]>([]);
|
|
120
|
+
const [activeDeviceId, setActiveDeviceId] = useState(
|
|
121
|
+
room.getActiveDevice('videoinput') ?? ''
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
useEffect(() => {
|
|
125
|
+
const load = () =>
|
|
126
|
+
Room.getLocalDevices('videoinput', false)
|
|
127
|
+
.then((list) =>
|
|
128
|
+
setDevices(list.map(({ deviceId, label }) => ({ deviceId, label })))
|
|
129
|
+
)
|
|
130
|
+
.catch(() => undefined);
|
|
131
|
+
const onActive = (kind: string, deviceId: string) => {
|
|
132
|
+
if (kind === 'videoinput') setActiveDeviceId(deviceId);
|
|
133
|
+
};
|
|
134
|
+
void load();
|
|
135
|
+
room
|
|
136
|
+
.on(RoomEvent.MediaDevicesChanged, load)
|
|
137
|
+
.on(RoomEvent.ActiveDeviceChanged, onActive);
|
|
138
|
+
return () => {
|
|
139
|
+
room
|
|
140
|
+
.off(RoomEvent.MediaDevicesChanged, load)
|
|
141
|
+
.off(RoomEvent.ActiveDeviceChanged, onActive);
|
|
142
|
+
};
|
|
143
|
+
}, [room]);
|
|
144
|
+
|
|
145
|
+
return { devices, activeDeviceId };
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
/** Audio outputs exposed by the native audio session. */
|
|
149
|
+
export const useAudioOutputs = () => {
|
|
150
|
+
const [devices, setDevices] = useState<JamDevice[]>([]);
|
|
151
|
+
|
|
152
|
+
useEffect(() => {
|
|
153
|
+
AudioSession.getAudioOutputs()
|
|
154
|
+
.then((outputs) =>
|
|
155
|
+
setDevices(outputs.map((id) => ({ deviceId: id, label: id })))
|
|
156
|
+
)
|
|
157
|
+
.catch(() => undefined);
|
|
158
|
+
}, []);
|
|
159
|
+
|
|
160
|
+
return devices;
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
/** In-room microphone control. Native exposes no selectable mic list. */
|
|
164
|
+
export const JamMicSelector = () => {
|
|
165
|
+
const { localParticipant, isMicrophoneEnabled } = useLocalParticipant();
|
|
166
|
+
|
|
167
|
+
return (
|
|
168
|
+
<DeviceSelectorPill
|
|
169
|
+
enabled={isMicrophoneEnabled}
|
|
170
|
+
onToggle={() =>
|
|
171
|
+
void localParticipant
|
|
172
|
+
.setMicrophoneEnabled(!isMicrophoneEnabled)
|
|
173
|
+
.catch(() => undefined)
|
|
174
|
+
}
|
|
175
|
+
onIcon={MicIcon}
|
|
176
|
+
offIcon={MicOffIcon}
|
|
177
|
+
deviceType="mic"
|
|
178
|
+
/>
|
|
179
|
+
);
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
/** In-room camera control with camera switching. */
|
|
183
|
+
export const JamCameraSelector = () => {
|
|
184
|
+
const room = useRoomContext();
|
|
185
|
+
const { localParticipant, isCameraEnabled } = useLocalParticipant();
|
|
186
|
+
const { devices, activeDeviceId } = useCameraDevices(room);
|
|
187
|
+
|
|
188
|
+
return (
|
|
189
|
+
<DeviceSelectorPill
|
|
190
|
+
enabled={isCameraEnabled}
|
|
191
|
+
onToggle={() =>
|
|
192
|
+
void localParticipant
|
|
193
|
+
.setCameraEnabled(!isCameraEnabled)
|
|
194
|
+
.catch(() => undefined)
|
|
195
|
+
}
|
|
196
|
+
onIcon={VideoIcon}
|
|
197
|
+
offIcon={VideoOffIcon}
|
|
198
|
+
deviceType="camera"
|
|
199
|
+
devices={devices}
|
|
200
|
+
activeDeviceId={activeDeviceId}
|
|
201
|
+
onDeviceChange={(deviceId) =>
|
|
202
|
+
void room
|
|
203
|
+
.switchActiveDevice('videoinput', deviceId)
|
|
204
|
+
.catch(() => undefined)
|
|
205
|
+
}
|
|
206
|
+
/>
|
|
207
|
+
);
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
export interface JamAudioOutputSelectorProps {
|
|
211
|
+
speakerDeviceId?: string;
|
|
212
|
+
speakerEnabled: boolean;
|
|
213
|
+
onSpeakerChange: (deviceId: string) => void;
|
|
214
|
+
onToggleSpeaker: () => void;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/** In-room speaker control. */
|
|
218
|
+
export const JamAudioOutputSelector = ({
|
|
219
|
+
speakerDeviceId,
|
|
220
|
+
speakerEnabled,
|
|
221
|
+
onSpeakerChange,
|
|
222
|
+
onToggleSpeaker,
|
|
223
|
+
}: JamAudioOutputSelectorProps) => {
|
|
224
|
+
const devices = useAudioOutputs();
|
|
225
|
+
|
|
226
|
+
const handleDeviceChange = (deviceId: string) => {
|
|
227
|
+
onSpeakerChange(deviceId);
|
|
228
|
+
void AudioSession.selectAudioOutput(deviceId).catch(() => undefined);
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
return (
|
|
232
|
+
<DeviceSelectorPill
|
|
233
|
+
enabled={speakerEnabled}
|
|
234
|
+
onToggle={onToggleSpeaker}
|
|
235
|
+
onIcon={Volume2Icon}
|
|
236
|
+
offIcon={VolumeXIcon}
|
|
237
|
+
deviceType="speaker"
|
|
238
|
+
devices={devices}
|
|
239
|
+
activeDeviceId={speakerDeviceId ?? ''}
|
|
240
|
+
onDeviceChange={handleDeviceChange}
|
|
241
|
+
/>
|
|
242
|
+
);
|
|
243
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
import { Pressable, View } from 'react-native';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { XIcon } from '../icons/index';
|
|
5
|
+
import { ThemedText } from '../ui/themed-text';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Full-overlay side panel used by the chat, people and details drawers —
|
|
9
|
+
* the web mobile layout, where drawers cover the conference view.
|
|
10
|
+
*/
|
|
11
|
+
export const JamDrawer = ({
|
|
12
|
+
title,
|
|
13
|
+
onClose,
|
|
14
|
+
children,
|
|
15
|
+
}: {
|
|
16
|
+
title: string;
|
|
17
|
+
onClose: () => void;
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
}) => {
|
|
20
|
+
const { t } = useTranslation();
|
|
21
|
+
return (
|
|
22
|
+
<View className="absolute inset-0 z-30 gap-3 overflow-hidden rounded bg-card">
|
|
23
|
+
<View className="w-full flex-row items-center justify-between border-b border-border p-2">
|
|
24
|
+
<ThemedText className="text-lg">{title}</ThemedText>
|
|
25
|
+
<Pressable
|
|
26
|
+
accessibilityLabel={t('jams.drawer.close')}
|
|
27
|
+
accessibilityRole="button"
|
|
28
|
+
onPress={onClose}
|
|
29
|
+
className="size-10 shrink-0 items-center justify-center"
|
|
30
|
+
>
|
|
31
|
+
<XIcon size={20} className="text-foreground" />
|
|
32
|
+
</Pressable>
|
|
33
|
+
</View>
|
|
34
|
+
{children}
|
|
35
|
+
</View>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Alert, Pressable, View } from 'react-native';
|
|
3
|
+
import { useParticipants, useRoomContext } from '@livekit/react-native';
|
|
4
|
+
import Toast from 'react-native-toast-message';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import { useJamFooterControls } from '@openpeepshq/react';
|
|
7
|
+
import {
|
|
8
|
+
CircleEllipsisIcon,
|
|
9
|
+
CircleStopIcon,
|
|
10
|
+
DiscIcon,
|
|
11
|
+
HandIcon,
|
|
12
|
+
InfoIcon,
|
|
13
|
+
LaughIcon,
|
|
14
|
+
MessageSquareTextIcon,
|
|
15
|
+
UsersRoundIcon,
|
|
16
|
+
} from '../icons/index';
|
|
17
|
+
import { ThemedText } from '../ui/themed-text';
|
|
18
|
+
import {
|
|
19
|
+
JamAudioOutputSelector,
|
|
20
|
+
JamCameraSelector,
|
|
21
|
+
JamMicSelector,
|
|
22
|
+
type JamIconType,
|
|
23
|
+
} from './JamDeviceSelectors';
|
|
24
|
+
import { JamReactionMenu } from './JamReactionMenu';
|
|
25
|
+
import { JamToolbarButton, toneIconClass } from './JamToolbarButton';
|
|
26
|
+
import { LeaveCloseButton } from './LeaveCloseButton';
|
|
27
|
+
|
|
28
|
+
export interface JamFooterProps {
|
|
29
|
+
chatOpen: boolean;
|
|
30
|
+
onToggleChat: () => void;
|
|
31
|
+
peopleOpen: boolean;
|
|
32
|
+
onTogglePeople: () => void;
|
|
33
|
+
detailsOpen: boolean;
|
|
34
|
+
onToggleDetails: () => void;
|
|
35
|
+
speakerDeviceId?: string;
|
|
36
|
+
speakerEnabled: boolean;
|
|
37
|
+
onSpeakerChange: (deviceId: string) => void;
|
|
38
|
+
onToggleSpeaker: () => void;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Native wrapper: `Alert` confirm + toasts. */
|
|
42
|
+
export const useFooterControls = () => {
|
|
43
|
+
const { t } = useTranslation();
|
|
44
|
+
const room = useRoomContext();
|
|
45
|
+
const participants = useParticipants();
|
|
46
|
+
|
|
47
|
+
const confirmStopRecording = () =>
|
|
48
|
+
new Promise<boolean>((resolve) => {
|
|
49
|
+
Alert.alert('', t('jams.recording.stopConfirm'), [
|
|
50
|
+
{
|
|
51
|
+
text: t('common.cancel'),
|
|
52
|
+
style: 'cancel',
|
|
53
|
+
onPress: () => resolve(false),
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
text: t('jams.recording.stopTitle'),
|
|
57
|
+
style: 'destructive',
|
|
58
|
+
onPress: () => resolve(true),
|
|
59
|
+
},
|
|
60
|
+
]);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
return useJamFooterControls({
|
|
64
|
+
room,
|
|
65
|
+
participantCount: participants.length,
|
|
66
|
+
confirmStopRecording,
|
|
67
|
+
onSuccess: (text1) => Toast.show({ type: 'success', text1 }),
|
|
68
|
+
onError: (text1) => Toast.show({ type: 'error', text1 }),
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const MenuEntry = ({
|
|
73
|
+
icon: Icon,
|
|
74
|
+
label,
|
|
75
|
+
disabled,
|
|
76
|
+
onPress,
|
|
77
|
+
}: {
|
|
78
|
+
icon: JamIconType;
|
|
79
|
+
label: string;
|
|
80
|
+
disabled?: boolean;
|
|
81
|
+
onPress: () => void;
|
|
82
|
+
}) => (
|
|
83
|
+
<Pressable
|
|
84
|
+
disabled={disabled}
|
|
85
|
+
onPress={onPress}
|
|
86
|
+
className="w-1/3 items-center justify-center gap-y-2 p-2"
|
|
87
|
+
>
|
|
88
|
+
<Icon size={24} className="text-foreground" />
|
|
89
|
+
<ThemedText className="text-center">{label}</ThemedText>
|
|
90
|
+
</Pressable>
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
/** Overflow menu: chat, details, hand, people and (moderators) record. */
|
|
94
|
+
const MobileMenu = ({
|
|
95
|
+
isModerator,
|
|
96
|
+
recordingEnabled,
|
|
97
|
+
isRecording,
|
|
98
|
+
recordingLabel,
|
|
99
|
+
busy,
|
|
100
|
+
onClose,
|
|
101
|
+
onOpenChat,
|
|
102
|
+
onOpenPeople,
|
|
103
|
+
onOpenDetails,
|
|
104
|
+
onRaiseHand,
|
|
105
|
+
onToggleRecording,
|
|
106
|
+
}: {
|
|
107
|
+
isModerator: boolean;
|
|
108
|
+
recordingEnabled: boolean;
|
|
109
|
+
isRecording: boolean;
|
|
110
|
+
recordingLabel: string;
|
|
111
|
+
busy: boolean;
|
|
112
|
+
onClose: () => void;
|
|
113
|
+
onOpenChat: () => void;
|
|
114
|
+
onOpenPeople: () => void;
|
|
115
|
+
onOpenDetails: () => void;
|
|
116
|
+
onRaiseHand: () => void;
|
|
117
|
+
onToggleRecording: () => void;
|
|
118
|
+
}) => {
|
|
119
|
+
const { t } = useTranslation();
|
|
120
|
+
const run = (action: () => void) => () => {
|
|
121
|
+
onClose();
|
|
122
|
+
action();
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
return (
|
|
126
|
+
<View className="absolute bottom-20 left-2 right-2 z-50 flex-row flex-wrap rounded-md bg-card p-2">
|
|
127
|
+
<MenuEntry
|
|
128
|
+
icon={MessageSquareTextIcon}
|
|
129
|
+
label={t('jams.mobileMenu.inJamMessage')}
|
|
130
|
+
onPress={run(onOpenChat)}
|
|
131
|
+
/>
|
|
132
|
+
<MenuEntry
|
|
133
|
+
icon={InfoIcon}
|
|
134
|
+
label={t('jams.mobileMenu.jamDetails')}
|
|
135
|
+
onPress={run(onOpenDetails)}
|
|
136
|
+
/>
|
|
137
|
+
<MenuEntry
|
|
138
|
+
icon={HandIcon}
|
|
139
|
+
label={t('jams.hand.raiseLabel')}
|
|
140
|
+
onPress={run(onRaiseHand)}
|
|
141
|
+
/>
|
|
142
|
+
<MenuEntry
|
|
143
|
+
icon={UsersRoundIcon}
|
|
144
|
+
label={t('jams.mobileMenu.people')}
|
|
145
|
+
onPress={run(onOpenPeople)}
|
|
146
|
+
/>
|
|
147
|
+
{isModerator && recordingEnabled ? (
|
|
148
|
+
<MenuEntry
|
|
149
|
+
icon={isRecording ? CircleStopIcon : DiscIcon}
|
|
150
|
+
label={recordingLabel}
|
|
151
|
+
disabled={busy}
|
|
152
|
+
onPress={run(onToggleRecording)}
|
|
153
|
+
/>
|
|
154
|
+
) : null}
|
|
155
|
+
</View>
|
|
156
|
+
);
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* In-room footer. Mirrors the web mobile toolbar: mic · camera · speaker ·
|
|
161
|
+
* reactions · overflow menu · leave. Screen sharing is not available on
|
|
162
|
+
* React Native, so the overflow menu has no share entry.
|
|
163
|
+
*/
|
|
164
|
+
export const JamFooter = ({
|
|
165
|
+
onToggleChat,
|
|
166
|
+
onTogglePeople,
|
|
167
|
+
onToggleDetails,
|
|
168
|
+
speakerDeviceId,
|
|
169
|
+
speakerEnabled,
|
|
170
|
+
onSpeakerChange,
|
|
171
|
+
onToggleSpeaker,
|
|
172
|
+
}: JamFooterProps) => {
|
|
173
|
+
const { t } = useTranslation();
|
|
174
|
+
const {
|
|
175
|
+
isModerator,
|
|
176
|
+
isRecording,
|
|
177
|
+
recordingLabel,
|
|
178
|
+
recordingEnabled,
|
|
179
|
+
busy,
|
|
180
|
+
sendReactionEmoji,
|
|
181
|
+
toggleRecording,
|
|
182
|
+
raiseHand,
|
|
183
|
+
} = useFooterControls();
|
|
184
|
+
|
|
185
|
+
const [reactionMenuOpen, setReactionMenuOpen] = useState(false);
|
|
186
|
+
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
|
|
187
|
+
const reactionTone = reactionMenuOpen ? 'active' : 'default';
|
|
188
|
+
|
|
189
|
+
return (
|
|
190
|
+
<View className="relative w-full flex-row items-center justify-between gap-x-2 bg-background/75 px-2 py-3">
|
|
191
|
+
{reactionMenuOpen ? (
|
|
192
|
+
<View className="absolute bottom-20 left-[5%] right-[5%] z-50 rounded-md p-2">
|
|
193
|
+
<JamReactionMenu
|
|
194
|
+
onSelect={(emoji) => void sendReactionEmoji(emoji)}
|
|
195
|
+
/>
|
|
196
|
+
</View>
|
|
197
|
+
) : null}
|
|
198
|
+
{mobileMenuOpen ? (
|
|
199
|
+
<MobileMenu
|
|
200
|
+
isModerator={isModerator}
|
|
201
|
+
recordingEnabled={recordingEnabled}
|
|
202
|
+
isRecording={isRecording}
|
|
203
|
+
recordingLabel={recordingLabel}
|
|
204
|
+
busy={busy}
|
|
205
|
+
onClose={() => setMobileMenuOpen(false)}
|
|
206
|
+
onOpenChat={onToggleChat}
|
|
207
|
+
onOpenPeople={onTogglePeople}
|
|
208
|
+
onOpenDetails={onToggleDetails}
|
|
209
|
+
onRaiseHand={raiseHand}
|
|
210
|
+
onToggleRecording={() => void toggleRecording()}
|
|
211
|
+
/>
|
|
212
|
+
) : null}
|
|
213
|
+
|
|
214
|
+
<JamMicSelector />
|
|
215
|
+
<JamCameraSelector />
|
|
216
|
+
<JamAudioOutputSelector
|
|
217
|
+
speakerDeviceId={speakerDeviceId}
|
|
218
|
+
speakerEnabled={speakerEnabled}
|
|
219
|
+
onSpeakerChange={onSpeakerChange}
|
|
220
|
+
onToggleSpeaker={onToggleSpeaker}
|
|
221
|
+
/>
|
|
222
|
+
|
|
223
|
+
<JamToolbarButton
|
|
224
|
+
title={t('jams.reactions.sendTitle')}
|
|
225
|
+
tone={reactionTone}
|
|
226
|
+
action={() => setReactionMenuOpen((open) => !open)}
|
|
227
|
+
>
|
|
228
|
+
<LaughIcon size={20} className={toneIconClass[reactionTone]} />
|
|
229
|
+
</JamToolbarButton>
|
|
230
|
+
|
|
231
|
+
<JamToolbarButton
|
|
232
|
+
title={t('jams.drawer.jamControls')}
|
|
233
|
+
action={() => setMobileMenuOpen((open) => !open)}
|
|
234
|
+
>
|
|
235
|
+
<CircleEllipsisIcon size={20} className="text-foreground" />
|
|
236
|
+
</JamToolbarButton>
|
|
237
|
+
|
|
238
|
+
<LeaveCloseButton />
|
|
239
|
+
</View>
|
|
240
|
+
);
|
|
241
|
+
};
|