@openpeepshq/rn-components 0.7.0 → 0.7.1
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 +289 -0
- package/src/components/resources/ResourceLibrary.tsx +371 -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,760 @@
|
|
|
1
|
+
import React, { useMemo, useRef, useState } from 'react';
|
|
2
|
+
import { useOpenpeeps, useServerInfo } from '@openpeepshq/react';
|
|
3
|
+
import {
|
|
4
|
+
MoreVerticalIcon,
|
|
5
|
+
ShareIcon,
|
|
6
|
+
DownloadIcon,
|
|
7
|
+
Trash2Icon,
|
|
8
|
+
MapPinIcon,
|
|
9
|
+
LinkIcon,
|
|
10
|
+
PhoneCallIcon,
|
|
11
|
+
Link2Icon,
|
|
12
|
+
SendIcon,
|
|
13
|
+
PencilIcon,
|
|
14
|
+
FlagIcon,
|
|
15
|
+
} from '../../../icons/index';
|
|
16
|
+
import {
|
|
17
|
+
DropdownMenu,
|
|
18
|
+
DropdownMenuContent,
|
|
19
|
+
DropdownMenuGroup,
|
|
20
|
+
DropdownMenuItem,
|
|
21
|
+
DropdownMenuTrigger,
|
|
22
|
+
} from '../../../ui/dropdown-menu';
|
|
23
|
+
import { ThemedText } from '../../../ui/themed-text';
|
|
24
|
+
import { Image, TouchableOpacity, View } from 'react-native';
|
|
25
|
+
|
|
26
|
+
import {
|
|
27
|
+
Event,
|
|
28
|
+
PublicPost,
|
|
29
|
+
Profile,
|
|
30
|
+
Group,
|
|
31
|
+
GroupData,
|
|
32
|
+
buildThreads,
|
|
33
|
+
type JamRecording,
|
|
34
|
+
} from '@openpeepshq/common';
|
|
35
|
+
import { ProfileAvatar } from '../../../profile/Avatar';
|
|
36
|
+
import { ProfileFromId } from '../../../profile/ProfileFromId';
|
|
37
|
+
import { Button } from '../../../ui/button';
|
|
38
|
+
import { UpdatingDate } from '../../../custom/date/updating-date';
|
|
39
|
+
import { VideoPlayer } from '../../pieces/VideoPlayer';
|
|
40
|
+
import { profileName, truncateText } from '../../../../lib/utils';
|
|
41
|
+
import { useNavigation } from '@react-navigation/native';
|
|
42
|
+
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
|
|
43
|
+
import { MainStackParamList } from '../../../navigation/types/index';
|
|
44
|
+
import { groupName } from '../../../../lib/utils';
|
|
45
|
+
import { BASE_URL } from '../../../../lib/constants';
|
|
46
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from '../../../ui/tabs';
|
|
47
|
+
import Clipboard from '@react-native-clipboard/clipboard';
|
|
48
|
+
import Toast from 'react-native-toast-message';
|
|
49
|
+
import { useNewConversationStore } from '../../../../stores/useNewConversationStore';
|
|
50
|
+
import { BottomSheetModal } from '@gorhom/bottom-sheet';
|
|
51
|
+
import { useTranslation } from 'react-i18next';
|
|
52
|
+
import {
|
|
53
|
+
canManageEventRsvps,
|
|
54
|
+
countYesRsvps,
|
|
55
|
+
isCapacityEvent,
|
|
56
|
+
} from '../../../../lib/utils';
|
|
57
|
+
import { bottomSheetPresent } from '../../../../lib/bottom-sheet-ref';
|
|
58
|
+
import {
|
|
59
|
+
canAccessJamRecordings,
|
|
60
|
+
canModerateJam,
|
|
61
|
+
canViewJamAttendees,
|
|
62
|
+
defaultRsvpRecurrenceId,
|
|
63
|
+
effectiveEventTimes,
|
|
64
|
+
eventTimeZoneOptions,
|
|
65
|
+
formatEventClockTime,
|
|
66
|
+
formatEventRecurrence,
|
|
67
|
+
listRsvpOccurrences,
|
|
68
|
+
} from '@openpeepshq/common/lib';
|
|
69
|
+
import { ThemedView } from '../../../ui/themed-view';
|
|
70
|
+
import { EventOccurrenceList } from '../../pieces/EventOccurrenceList';
|
|
71
|
+
import { EventRsvpList } from '../../pieces/EventRsvpList';
|
|
72
|
+
|
|
73
|
+
import {
|
|
74
|
+
EventMenu,
|
|
75
|
+
EventRsvpButton,
|
|
76
|
+
ReplyBox,
|
|
77
|
+
ShareMenu,
|
|
78
|
+
ThreadedFeed,
|
|
79
|
+
useNewPostModal,
|
|
80
|
+
} from '../../index';
|
|
81
|
+
import { ReportProfileOrPostModal } from '../../../profile/index';
|
|
82
|
+
import { OpenpeepsMarkdown } from '../../../markdown/index';
|
|
83
|
+
import { downloadDocument } from '../../../../lib/downloadFile';
|
|
84
|
+
import { useControlledSheet } from '../../../../hooks/use-controlled-sheet';
|
|
85
|
+
import { BaseSheet, SheetFooter } from '../../../custom/modals/common';
|
|
86
|
+
export interface FullEventProps {
|
|
87
|
+
post: PublicPost;
|
|
88
|
+
occurrence?: string;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export const FullEvent: React.FC<FullEventProps> = ({ post, occurrence }) => {
|
|
92
|
+
const { t } = useTranslation();
|
|
93
|
+
const { currentProfile, openpeepsApi } = useOpenpeeps();
|
|
94
|
+
const navigation =
|
|
95
|
+
useNavigation<NativeStackNavigationProp<MainStackParamList>>();
|
|
96
|
+
const { openNewPost } = useNewPostModal();
|
|
97
|
+
const [tabValue, setTabValue] = React.useState(
|
|
98
|
+
(post?.data as Event)?.content ? 'description' : 'discussions'
|
|
99
|
+
);
|
|
100
|
+
const { setContt } = useNewConversationStore();
|
|
101
|
+
|
|
102
|
+
const group = useMemo(() => post?.group as Group, [post]);
|
|
103
|
+
const event = useMemo(() => post?.data as Event, [post]);
|
|
104
|
+
|
|
105
|
+
const canManageRsvps = canManageEventRsvps(currentProfile, post);
|
|
106
|
+
const slotsLeft =
|
|
107
|
+
isCapacityEvent(event) &&
|
|
108
|
+
event.maxAttendees !== undefined &&
|
|
109
|
+
(!event.recurrence || occurrence)
|
|
110
|
+
? event.maxAttendees - countYesRsvps(post, occurrence)
|
|
111
|
+
: null;
|
|
112
|
+
const rsvpManage = openpeepsApi.rsvpManageAction();
|
|
113
|
+
const times = effectiveEventTimes(
|
|
114
|
+
event,
|
|
115
|
+
occurrence ??
|
|
116
|
+
(event?.recurrence ? defaultRsvpRecurrenceId(event) : undefined)
|
|
117
|
+
);
|
|
118
|
+
const tz = eventTimeZoneOptions(event?.timeZone);
|
|
119
|
+
const recurrenceLabel = event?.recurrence
|
|
120
|
+
? formatEventRecurrence(event.recurrence, t, event.start)
|
|
121
|
+
: '';
|
|
122
|
+
const upcomingOccurrences = event?.recurrence
|
|
123
|
+
? listRsvpOccurrences(event)
|
|
124
|
+
: [];
|
|
125
|
+
|
|
126
|
+
const jamLink = occurrence
|
|
127
|
+
? `${BASE_URL}/events/${post?.id}/jam?occurrence=${encodeURIComponent(occurrence)}`
|
|
128
|
+
: `${BASE_URL}/events/${post?.id}/jam`;
|
|
129
|
+
|
|
130
|
+
const onRepostToFeed = () =>
|
|
131
|
+
openNewPost({
|
|
132
|
+
initialContent: `Join our event happening at ${BASE_URL}/post/${post?.id}`,
|
|
133
|
+
});
|
|
134
|
+
const onSendToMessage = () => {
|
|
135
|
+
setContt(`Join our event happening at ${BASE_URL}/post/${post?.id}`);
|
|
136
|
+
navigation.navigate('SelectPrivateMessageMembers');
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
const serverInfo = useServerInfo();
|
|
140
|
+
const livekitEnabled = serverInfo.jams.livekit.enabled;
|
|
141
|
+
const myEvent = currentProfile?.id === post?.profile?.id;
|
|
142
|
+
const iAmModerator = canModerateJam(currentProfile, post);
|
|
143
|
+
const canExportAttendees = canViewJamAttendees(currentProfile, post);
|
|
144
|
+
const canViewRecordings = canAccessJamRecordings(currentProfile, post);
|
|
145
|
+
const jamAttendeesQuery = openpeepsApi.useJamAttendance(post.id);
|
|
146
|
+
const jamStateQuery = openpeepsApi.useJamState(post.id, occurrence);
|
|
147
|
+
const jamState = event.jam ? jamStateQuery.data : undefined;
|
|
148
|
+
const recordingsQuery = openpeepsApi.usePostRecordings(
|
|
149
|
+
post.id,
|
|
150
|
+
!!event.jam && canViewRecordings
|
|
151
|
+
);
|
|
152
|
+
const showJamAttendeesTab =
|
|
153
|
+
!!event.jam && canExportAttendees && jamAttendeesQuery.isSuccess;
|
|
154
|
+
|
|
155
|
+
let postContextQuery = openpeepsApi.usePostContext(post.id);
|
|
156
|
+
|
|
157
|
+
let descendentThreads = useMemo(
|
|
158
|
+
() =>
|
|
159
|
+
(postContextQuery.data &&
|
|
160
|
+
buildThreads(postContextQuery.data.descendants)) ||
|
|
161
|
+
[],
|
|
162
|
+
[postContextQuery.data]
|
|
163
|
+
);
|
|
164
|
+
|
|
165
|
+
const eventScope = useMemo(() => {
|
|
166
|
+
if (post?.visibility === 'public') {
|
|
167
|
+
return t('events.public');
|
|
168
|
+
}
|
|
169
|
+
if (post?.groupId) {
|
|
170
|
+
return t('events.group');
|
|
171
|
+
}
|
|
172
|
+
if (post?.visibility === 'direct') {
|
|
173
|
+
return t('events.private');
|
|
174
|
+
}
|
|
175
|
+
return t('events.community');
|
|
176
|
+
}, [post?.groupId, post?.visibility, t]);
|
|
177
|
+
|
|
178
|
+
return (
|
|
179
|
+
<ThemedView className="flex-1 relative px-4 pb-4">
|
|
180
|
+
<View className="w-full aspect-video mx-auto overflow-hidden rounded-md">
|
|
181
|
+
<Image
|
|
182
|
+
source={
|
|
183
|
+
event?.image
|
|
184
|
+
? { uri: event?.image }
|
|
185
|
+
: require('../../../../assets/images/event-placeholder.png')
|
|
186
|
+
}
|
|
187
|
+
className="w-full h-full"
|
|
188
|
+
resizeMode="cover"
|
|
189
|
+
/>
|
|
190
|
+
</View>
|
|
191
|
+
|
|
192
|
+
<View className="w-full flex-row items-center gap-x-2 py-4">
|
|
193
|
+
<View className="flex-1">
|
|
194
|
+
<View className="flex flex-row gap-x-4">
|
|
195
|
+
<View className="px-3 py-1 bg-surface rounded-lg mb-3">
|
|
196
|
+
<ThemedText>{eventScope}</ThemedText>
|
|
197
|
+
</View>
|
|
198
|
+
{slotsLeft !== null ? (
|
|
199
|
+
<View className="px-3 py-1 bg-surface rounded-lg mb-3">
|
|
200
|
+
<ThemedText>
|
|
201
|
+
{slotsLeft <= 0
|
|
202
|
+
? t('events.noSpotsAvailable')
|
|
203
|
+
: t('events.slotsLeft', { count: slotsLeft })}
|
|
204
|
+
</ThemedText>
|
|
205
|
+
</View>
|
|
206
|
+
) : null}
|
|
207
|
+
</View>
|
|
208
|
+
{post?.groupId && (
|
|
209
|
+
<View>
|
|
210
|
+
<ThemedText className="text-xl text-muted-foreground">
|
|
211
|
+
{groupName(group as GroupData)}
|
|
212
|
+
</ThemedText>
|
|
213
|
+
</View>
|
|
214
|
+
)}
|
|
215
|
+
</View>
|
|
216
|
+
<View className="flex">
|
|
217
|
+
<DropdownMenu>
|
|
218
|
+
<DropdownMenuTrigger asChild className="px-2">
|
|
219
|
+
<ShareIcon className="text-foreground" />
|
|
220
|
+
</DropdownMenuTrigger>
|
|
221
|
+
<DropdownMenuContent className=" mt-1">
|
|
222
|
+
<DropdownMenuGroup>
|
|
223
|
+
<DropdownMenuItem
|
|
224
|
+
className="flex-row gap-x-2 items-center"
|
|
225
|
+
onPress={onRepostToFeed}
|
|
226
|
+
>
|
|
227
|
+
<PencilIcon className="text-muted-foreground" size={18} />
|
|
228
|
+
<ThemedText>Repost to feed</ThemedText>
|
|
229
|
+
</DropdownMenuItem>
|
|
230
|
+
<DropdownMenuItem
|
|
231
|
+
className="flex-row gap-x-2 items-center"
|
|
232
|
+
onPress={onSendToMessage}
|
|
233
|
+
>
|
|
234
|
+
<SendIcon className="text-muted-foreground" size={18} />
|
|
235
|
+
<ThemedText>Send in a message</ThemedText>
|
|
236
|
+
</DropdownMenuItem>
|
|
237
|
+
<DropdownMenuItem
|
|
238
|
+
className="flex-row gap-x-2 items-center"
|
|
239
|
+
onPress={() => {
|
|
240
|
+
Clipboard.setString(jamLink);
|
|
241
|
+
Toast.show({
|
|
242
|
+
type: 'success',
|
|
243
|
+
text1: 'Link copied to clipboard',
|
|
244
|
+
});
|
|
245
|
+
}}
|
|
246
|
+
>
|
|
247
|
+
<Link2Icon className="text-muted-foreground" size={18} />
|
|
248
|
+
<ThemedText>Copy link</ThemedText>
|
|
249
|
+
</DropdownMenuItem>
|
|
250
|
+
</DropdownMenuGroup>
|
|
251
|
+
</DropdownMenuContent>
|
|
252
|
+
</DropdownMenu>
|
|
253
|
+
</View>
|
|
254
|
+
</View>
|
|
255
|
+
<ThemedText className="text-xl font-semibold mb-2">
|
|
256
|
+
{event?.name || 'Untitled Event'}
|
|
257
|
+
</ThemedText>
|
|
258
|
+
<View className="flex-row items-center gap-x-2 mt-2">
|
|
259
|
+
<ProfileAvatar profile={post?.profile as Profile} className="size-6" />
|
|
260
|
+
<ThemedText className="text-muted-foreground">
|
|
261
|
+
Hosted by
|
|
262
|
+
{currentProfile?.id === post?.profile?.id
|
|
263
|
+
? ' You'
|
|
264
|
+
: ` ${profileName(post?.profile)}`}
|
|
265
|
+
</ThemedText>
|
|
266
|
+
</View>
|
|
267
|
+
{times.start && (
|
|
268
|
+
<View className="mt-8 flex-row gap-x-4">
|
|
269
|
+
<View className="border-foreground/20 border-[0.5px] rounded-md px-3 py-1">
|
|
270
|
+
<ThemedText className="text-center">
|
|
271
|
+
{new Date(times.start).toLocaleString('en-US', {
|
|
272
|
+
month: 'short',
|
|
273
|
+
...tz,
|
|
274
|
+
})}
|
|
275
|
+
</ThemedText>
|
|
276
|
+
<ThemedText className="text-center ">
|
|
277
|
+
{new Date(times.start).toLocaleString('en-US', {
|
|
278
|
+
day: 'numeric',
|
|
279
|
+
...tz,
|
|
280
|
+
})}
|
|
281
|
+
</ThemedText>
|
|
282
|
+
</View>
|
|
283
|
+
<View>
|
|
284
|
+
<ThemedText className="text-xl">
|
|
285
|
+
{new Date(times.start).toLocaleDateString('en-US', {
|
|
286
|
+
weekday: 'long',
|
|
287
|
+
month: 'long',
|
|
288
|
+
day: 'numeric',
|
|
289
|
+
...tz,
|
|
290
|
+
})}
|
|
291
|
+
</ThemedText>
|
|
292
|
+
<ThemedText className="text-muted-foreground mt-2">
|
|
293
|
+
{formatEventClockTime(times.start, {
|
|
294
|
+
timeZone: event?.timeZone,
|
|
295
|
+
locale: 'en-US',
|
|
296
|
+
})}
|
|
297
|
+
{times.end
|
|
298
|
+
? ` - ${formatEventClockTime(times.end, {
|
|
299
|
+
timeZone: event?.timeZone,
|
|
300
|
+
locale: 'en-US',
|
|
301
|
+
})}`
|
|
302
|
+
: ''}
|
|
303
|
+
{tz.timeZone ? ` (${tz.timeZone})` : ''}
|
|
304
|
+
</ThemedText>
|
|
305
|
+
</View>
|
|
306
|
+
</View>
|
|
307
|
+
)}
|
|
308
|
+
<View className="mt-8 flex-row gap-x-4">
|
|
309
|
+
<View className="border-foreground/20 border-[0.5px] flex items-center justify-center rounded-md px-4 py-1">
|
|
310
|
+
{event?.physicalLocation ? (
|
|
311
|
+
<MapPinIcon className="text-muted-foreground my-3" size={18} />
|
|
312
|
+
) : event?.jam ? (
|
|
313
|
+
<PhoneCallIcon className="text-muted-foreground" size={18} />
|
|
314
|
+
) : event?.url ? (
|
|
315
|
+
<LinkIcon className="text-muted-foreground" size={18} />
|
|
316
|
+
) : null}
|
|
317
|
+
</View>
|
|
318
|
+
<View>
|
|
319
|
+
{event?.physicalLocation ? (
|
|
320
|
+
<>
|
|
321
|
+
<ThemedText className="text-xl">
|
|
322
|
+
{event?.physicalLocation.text ||
|
|
323
|
+
t('events.location.physical', {
|
|
324
|
+
defaultValue: 'Physical Location',
|
|
325
|
+
})}
|
|
326
|
+
</ThemedText>
|
|
327
|
+
</>
|
|
328
|
+
) : event?.jam ? (
|
|
329
|
+
<>
|
|
330
|
+
<ThemedText className="text-xl">
|
|
331
|
+
{t('events.location.jam', { defaultValue: 'Jam Event' })}
|
|
332
|
+
</ThemedText>
|
|
333
|
+
<ThemedText className="text-muted-foreground mt-2">
|
|
334
|
+
{truncateText(jamLink, 30)}
|
|
335
|
+
</ThemedText>
|
|
336
|
+
</>
|
|
337
|
+
) : event?.url ? (
|
|
338
|
+
<>
|
|
339
|
+
<ThemedText className="text-xl">
|
|
340
|
+
{t('events.location.external', {
|
|
341
|
+
defaultValue: 'External Event',
|
|
342
|
+
})}
|
|
343
|
+
</ThemedText>
|
|
344
|
+
<ThemedText className="text-muted-foreground mt-2">
|
|
345
|
+
{truncateText(event?.url, 40)}
|
|
346
|
+
</ThemedText>
|
|
347
|
+
</>
|
|
348
|
+
) : null}
|
|
349
|
+
</View>
|
|
350
|
+
</View>
|
|
351
|
+
{event?.recurrence ? (
|
|
352
|
+
<EventOccurrenceList
|
|
353
|
+
post={post as PublicPost}
|
|
354
|
+
postId={post.id}
|
|
355
|
+
occurrences={upcomingOccurrences}
|
|
356
|
+
currentOccurrenceId={occurrence}
|
|
357
|
+
recurrenceLabel={recurrenceLabel}
|
|
358
|
+
/>
|
|
359
|
+
) : null}
|
|
360
|
+
<EventRsvpButton post={post as PublicPost} recurrenceId={occurrence} />
|
|
361
|
+
{event.jam && (myEvent || iAmModerator) ? (
|
|
362
|
+
livekitEnabled ? (
|
|
363
|
+
jamState?.active ? (
|
|
364
|
+
<Button
|
|
365
|
+
className="mt-2 w-full"
|
|
366
|
+
onPress={() =>
|
|
367
|
+
navigation.navigate('JamSession', {
|
|
368
|
+
jamId: post.id,
|
|
369
|
+
occurrence: occurrence,
|
|
370
|
+
})
|
|
371
|
+
}
|
|
372
|
+
>
|
|
373
|
+
<ThemedText numberOfLines={1}>
|
|
374
|
+
{t('jam.join.submit', { defaultValue: 'Join Jam' })}
|
|
375
|
+
</ThemedText>
|
|
376
|
+
</Button>
|
|
377
|
+
) : (
|
|
378
|
+
<Button
|
|
379
|
+
className="mt-2 w-full"
|
|
380
|
+
onPress={() =>
|
|
381
|
+
navigation.navigate('JamSession', {
|
|
382
|
+
jamId: post.id,
|
|
383
|
+
occurrence: occurrence,
|
|
384
|
+
})
|
|
385
|
+
}
|
|
386
|
+
>
|
|
387
|
+
<ThemedText numberOfLines={1}>
|
|
388
|
+
{t('events.jam.start', { defaultValue: 'Start jam' })}
|
|
389
|
+
</ThemedText>
|
|
390
|
+
</Button>
|
|
391
|
+
)
|
|
392
|
+
) : (
|
|
393
|
+
<ThemedText className="mt-2 text-sm text-destructive">
|
|
394
|
+
{t('jams.unavailable.message', {
|
|
395
|
+
defaultValue:
|
|
396
|
+
'Jams are unavailable because LiveKit is not connected.',
|
|
397
|
+
})}
|
|
398
|
+
</ThemedText>
|
|
399
|
+
)
|
|
400
|
+
) : null}
|
|
401
|
+
<Tabs
|
|
402
|
+
onValueChange={setTabValue}
|
|
403
|
+
value={tabValue}
|
|
404
|
+
className="mx-auto mt-5 w-full flex-col gap-1.5"
|
|
405
|
+
>
|
|
406
|
+
<TabsList className="w-full flex-row flex-wrap rounded-none border-b border-muted bg-transparent p-0 px-1">
|
|
407
|
+
{event?.content ? (
|
|
408
|
+
<TabsTrigger
|
|
409
|
+
value="description"
|
|
410
|
+
onPress={() => setTabValue('description')}
|
|
411
|
+
className={
|
|
412
|
+
tabValue === 'description' ? 'border-b-2 border-foreground' : ''
|
|
413
|
+
}
|
|
414
|
+
>
|
|
415
|
+
<ThemedText>
|
|
416
|
+
{t('events.tabs.description', { defaultValue: 'Description' })}
|
|
417
|
+
</ThemedText>
|
|
418
|
+
</TabsTrigger>
|
|
419
|
+
) : null}
|
|
420
|
+
<TabsTrigger
|
|
421
|
+
value="discussions"
|
|
422
|
+
className={
|
|
423
|
+
tabValue === 'discussions' ? 'border-b-2 border-foreground' : ''
|
|
424
|
+
}
|
|
425
|
+
onPress={() => setTabValue('discussions')}
|
|
426
|
+
>
|
|
427
|
+
<ThemedText>
|
|
428
|
+
{t('events.tabs.discussion', { defaultValue: 'Discussion' })}
|
|
429
|
+
</ThemedText>
|
|
430
|
+
</TabsTrigger>
|
|
431
|
+
<TabsTrigger
|
|
432
|
+
value="rsvps"
|
|
433
|
+
className={
|
|
434
|
+
tabValue === 'rsvps' ? 'border-b-2 border-foreground' : ''
|
|
435
|
+
}
|
|
436
|
+
onPress={() => setTabValue('rsvps')}
|
|
437
|
+
>
|
|
438
|
+
<ThemedText>
|
|
439
|
+
{t('events.tabs.rsvps', { defaultValue: 'RSVPs' })}
|
|
440
|
+
</ThemedText>
|
|
441
|
+
</TabsTrigger>
|
|
442
|
+
{showJamAttendeesTab ? (
|
|
443
|
+
<TabsTrigger
|
|
444
|
+
value="attendees"
|
|
445
|
+
className={
|
|
446
|
+
tabValue === 'attendees' ? 'border-b-2 border-foreground' : ''
|
|
447
|
+
}
|
|
448
|
+
onPress={() => setTabValue('attendees')}
|
|
449
|
+
>
|
|
450
|
+
<ThemedText>
|
|
451
|
+
{t('events.tabs.jamAttendees', {
|
|
452
|
+
defaultValue: 'Jam attendees',
|
|
453
|
+
})}
|
|
454
|
+
</ThemedText>
|
|
455
|
+
</TabsTrigger>
|
|
456
|
+
) : null}
|
|
457
|
+
{event.jam ? (
|
|
458
|
+
<TabsTrigger
|
|
459
|
+
value="recordings"
|
|
460
|
+
className={
|
|
461
|
+
tabValue === 'recordings' ? 'border-b-2 border-foreground' : ''
|
|
462
|
+
}
|
|
463
|
+
onPress={() => setTabValue('recordings')}
|
|
464
|
+
>
|
|
465
|
+
<ThemedText>
|
|
466
|
+
{t('events.tabs.recordings', { defaultValue: 'Recordings' })}
|
|
467
|
+
</ThemedText>
|
|
468
|
+
</TabsTrigger>
|
|
469
|
+
) : null}
|
|
470
|
+
</TabsList>
|
|
471
|
+
{event?.content ? (
|
|
472
|
+
<TabsContent value="description" className="p-0">
|
|
473
|
+
<OpenpeepsMarkdown source={event.content} linkPreviewMode="none" />
|
|
474
|
+
</TabsContent>
|
|
475
|
+
) : null}
|
|
476
|
+
<TabsContent value="discussions" className="flex-1 p-0">
|
|
477
|
+
<ReplyBox post={post} />
|
|
478
|
+
{descendentThreads.map((thread) => (
|
|
479
|
+
<ThreadedFeed key={thread.id} thread={thread} />
|
|
480
|
+
))}
|
|
481
|
+
</TabsContent>
|
|
482
|
+
<TabsContent value="rsvps" className="px-0 py-4">
|
|
483
|
+
<EventRsvpList
|
|
484
|
+
post={post as PublicPost}
|
|
485
|
+
occurrenceId={occurrence}
|
|
486
|
+
occurrences={upcomingOccurrences}
|
|
487
|
+
canManageRsvps={canManageRsvps}
|
|
488
|
+
onManage={(response, profileId, recurrenceId) =>
|
|
489
|
+
rsvpManage({ response, recurrenceId }, { id: post.id, profileId })
|
|
490
|
+
}
|
|
491
|
+
/>
|
|
492
|
+
</TabsContent>
|
|
493
|
+
{showJamAttendeesTab ? (
|
|
494
|
+
<TabsContent value="attendees" className="px-0 py-4">
|
|
495
|
+
{jamAttendeesQuery.data?.length ? (
|
|
496
|
+
jamAttendeesQuery.data.map((attendee) => (
|
|
497
|
+
<View
|
|
498
|
+
key={attendee.id}
|
|
499
|
+
className="flex-row items-center justify-between py-2"
|
|
500
|
+
>
|
|
501
|
+
<ProfileFromId id={attendee.profileId} />
|
|
502
|
+
<UpdatingDate date={attendee.createdAt} />
|
|
503
|
+
</View>
|
|
504
|
+
))
|
|
505
|
+
) : (
|
|
506
|
+
<ThemedText className="py-4 text-sm text-muted-foreground">
|
|
507
|
+
{t('events.noAttendees', { defaultValue: 'No attendees yet.' })}
|
|
508
|
+
</ThemedText>
|
|
509
|
+
)}
|
|
510
|
+
</TabsContent>
|
|
511
|
+
) : null}
|
|
512
|
+
{event.jam ? (
|
|
513
|
+
<TabsContent value="recordings" className="px-0 py-4">
|
|
514
|
+
{!canViewRecordings ? (
|
|
515
|
+
<ThemedText className="py-4 text-center text-sm text-muted-foreground">
|
|
516
|
+
{t('error.jamRecordingForbidden', {
|
|
517
|
+
defaultValue:
|
|
518
|
+
"You don't have permission to view recordings for this jam.",
|
|
519
|
+
})}
|
|
520
|
+
</ThemedText>
|
|
521
|
+
) : recordingsQuery.isLoading ? (
|
|
522
|
+
<ThemedText className="py-4 text-sm text-muted-foreground">
|
|
523
|
+
{t('common.loading', { defaultValue: 'Loading…' })}
|
|
524
|
+
</ThemedText>
|
|
525
|
+
) : recordingsQuery.data?.length ? (
|
|
526
|
+
recordingsQuery.data.map((recording: JamRecording) => (
|
|
527
|
+
<JamRecordingItem
|
|
528
|
+
key={recording.id}
|
|
529
|
+
post={post}
|
|
530
|
+
recording={recording}
|
|
531
|
+
canManage={canViewRecordings}
|
|
532
|
+
/>
|
|
533
|
+
))
|
|
534
|
+
) : (
|
|
535
|
+
<ThemedText className="py-4 text-sm text-muted-foreground">
|
|
536
|
+
{t('events.noRecordings', {
|
|
537
|
+
defaultValue: 'No recordings yet.',
|
|
538
|
+
})}
|
|
539
|
+
</ThemedText>
|
|
540
|
+
)}
|
|
541
|
+
</TabsContent>
|
|
542
|
+
) : null}
|
|
543
|
+
</Tabs>
|
|
544
|
+
</ThemedView>
|
|
545
|
+
);
|
|
546
|
+
};
|
|
547
|
+
|
|
548
|
+
const JamRecordingItem = ({
|
|
549
|
+
post,
|
|
550
|
+
recording,
|
|
551
|
+
canManage,
|
|
552
|
+
}: {
|
|
553
|
+
post: PublicPost;
|
|
554
|
+
recording: JamRecording;
|
|
555
|
+
canManage: boolean;
|
|
556
|
+
}) => {
|
|
557
|
+
const { t } = useTranslation();
|
|
558
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
559
|
+
const [confirmOpen, setConfirmOpen] = useState(false);
|
|
560
|
+
const confirmSheetRef = useControlledSheet(confirmOpen);
|
|
561
|
+
|
|
562
|
+
const attachment = recording.attachment;
|
|
563
|
+
const publishReply = openpeepsApi.publishRecordingReplyAction({
|
|
564
|
+
id: post.id,
|
|
565
|
+
recordingId: recording.id,
|
|
566
|
+
});
|
|
567
|
+
const deleteRecording = openpeepsApi.deleteRecordingAction({
|
|
568
|
+
id: post.id,
|
|
569
|
+
recordingId: recording.id,
|
|
570
|
+
});
|
|
571
|
+
|
|
572
|
+
const handleDelete = async () => {
|
|
573
|
+
try {
|
|
574
|
+
await deleteRecording();
|
|
575
|
+
setConfirmOpen(false);
|
|
576
|
+
Toast.show({
|
|
577
|
+
type: 'success',
|
|
578
|
+
text1: t('events.deleteRecordingSuccess', {
|
|
579
|
+
defaultValue: 'Recording deleted',
|
|
580
|
+
}),
|
|
581
|
+
});
|
|
582
|
+
} catch {
|
|
583
|
+
Toast.show({
|
|
584
|
+
type: 'error',
|
|
585
|
+
text1: t('events.deleteRecordingError', {
|
|
586
|
+
defaultValue: 'Failed to delete recording',
|
|
587
|
+
}),
|
|
588
|
+
});
|
|
589
|
+
}
|
|
590
|
+
};
|
|
591
|
+
|
|
592
|
+
return (
|
|
593
|
+
<View className="flex-col gap-2 py-4">
|
|
594
|
+
<UpdatingDate date={recording.createdAt} />
|
|
595
|
+
{recording.status === 'completed' && attachment ? (
|
|
596
|
+
<>
|
|
597
|
+
<VideoPlayer
|
|
598
|
+
attachment={attachment}
|
|
599
|
+
autoPlay={false}
|
|
600
|
+
className="aspect-video w-full rounded-md"
|
|
601
|
+
/>
|
|
602
|
+
<TouchableOpacity
|
|
603
|
+
onPress={() => downloadDocument(attachment.url)}
|
|
604
|
+
className="self-start"
|
|
605
|
+
>
|
|
606
|
+
<View className="flex-row items-center gap-1">
|
|
607
|
+
<DownloadIcon size={16} className="text-foreground" />
|
|
608
|
+
<ThemedText className="text-sm text-primary underline">
|
|
609
|
+
{t('events.downloadRecording', {
|
|
610
|
+
defaultValue: 'Download recording',
|
|
611
|
+
})}
|
|
612
|
+
</ThemedText>
|
|
613
|
+
</View>
|
|
614
|
+
</TouchableOpacity>
|
|
615
|
+
</>
|
|
616
|
+
) : (
|
|
617
|
+
<ThemedText className="text-sm text-muted-foreground">
|
|
618
|
+
{recording.status === 'active'
|
|
619
|
+
? t('events.recordingInProgress', {
|
|
620
|
+
defaultValue: 'Recording in progress…',
|
|
621
|
+
})
|
|
622
|
+
: t('events.recordingProcessing', {
|
|
623
|
+
defaultValue: 'Processing recording…',
|
|
624
|
+
})}
|
|
625
|
+
</ThemedText>
|
|
626
|
+
)}
|
|
627
|
+
<View className="flex-row flex-wrap items-center gap-2">
|
|
628
|
+
{canManage && recording.status === 'completed' && attachment ? (
|
|
629
|
+
recording.replyPostId ? (
|
|
630
|
+
<ThemedText className="text-sm text-muted-foreground">
|
|
631
|
+
{t('events.recordingReplyPosted', {
|
|
632
|
+
defaultValue: 'Posted to discussion',
|
|
633
|
+
})}
|
|
634
|
+
</ThemedText>
|
|
635
|
+
) : (
|
|
636
|
+
<Button
|
|
637
|
+
variant="outline"
|
|
638
|
+
className="self-start"
|
|
639
|
+
onPress={async () => {
|
|
640
|
+
try {
|
|
641
|
+
await publishReply();
|
|
642
|
+
Toast.show({
|
|
643
|
+
type: 'success',
|
|
644
|
+
text1: t('events.postRecordingReplySuccess', {
|
|
645
|
+
defaultValue: 'Recording posted to discussion',
|
|
646
|
+
}),
|
|
647
|
+
});
|
|
648
|
+
} catch {
|
|
649
|
+
Toast.show({
|
|
650
|
+
type: 'error',
|
|
651
|
+
text1: t('events.postRecordingReplyError', {
|
|
652
|
+
defaultValue: 'Failed to post recording to discussion',
|
|
653
|
+
}),
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
}}
|
|
657
|
+
>
|
|
658
|
+
<ThemedText className="font-semibold">
|
|
659
|
+
{t('events.postRecordingReply', {
|
|
660
|
+
defaultValue: 'Post to discussion',
|
|
661
|
+
})}
|
|
662
|
+
</ThemedText>
|
|
663
|
+
</Button>
|
|
664
|
+
)
|
|
665
|
+
) : null}
|
|
666
|
+
{canManage &&
|
|
667
|
+
recording.status !== 'active' &&
|
|
668
|
+
recording.status !== 'requested' ? (
|
|
669
|
+
<>
|
|
670
|
+
<Button
|
|
671
|
+
variant="outline"
|
|
672
|
+
className="self-start"
|
|
673
|
+
onPress={() => setConfirmOpen(true)}
|
|
674
|
+
>
|
|
675
|
+
<View className="flex-row items-center gap-1">
|
|
676
|
+
<Trash2Icon size={16} className="text-foreground" />
|
|
677
|
+
<ThemedText className="font-semibold">
|
|
678
|
+
{t('events.deleteRecording', {
|
|
679
|
+
defaultValue: 'Delete recording',
|
|
680
|
+
})}
|
|
681
|
+
</ThemedText>
|
|
682
|
+
</View>
|
|
683
|
+
</Button>
|
|
684
|
+
<BaseSheet
|
|
685
|
+
ref={confirmSheetRef}
|
|
686
|
+
onDismiss={() => setConfirmOpen(false)}
|
|
687
|
+
>
|
|
688
|
+
<View className="flex-1 p-4">
|
|
689
|
+
<ThemedText className="mb-6 text-center text-xl font-semibold">
|
|
690
|
+
{t('events.deleteRecording', {
|
|
691
|
+
defaultValue: 'Delete recording',
|
|
692
|
+
})}
|
|
693
|
+
</ThemedText>
|
|
694
|
+
<ThemedText className="mb-6 text-center text-base text-muted-foreground">
|
|
695
|
+
{t('events.deleteRecordingConfirm', {
|
|
696
|
+
defaultValue: 'Delete this recording permanently?',
|
|
697
|
+
})}
|
|
698
|
+
</ThemedText>
|
|
699
|
+
<SheetFooter
|
|
700
|
+
onCancel={() => setConfirmOpen(false)}
|
|
701
|
+
cancelText={t('common.cancel')}
|
|
702
|
+
onConfirm={() => void handleDelete()}
|
|
703
|
+
confirmText={t('events.deleteRecording', {
|
|
704
|
+
defaultValue: 'Delete recording',
|
|
705
|
+
})}
|
|
706
|
+
confirmVariant="destructive"
|
|
707
|
+
/>
|
|
708
|
+
</View>
|
|
709
|
+
</BaseSheet>
|
|
710
|
+
</>
|
|
711
|
+
) : null}
|
|
712
|
+
</View>
|
|
713
|
+
</View>
|
|
714
|
+
);
|
|
715
|
+
};
|
|
716
|
+
|
|
717
|
+
export const FullEventActions: React.FC<{
|
|
718
|
+
post: PublicPost;
|
|
719
|
+
occurrence?: string;
|
|
720
|
+
}> = ({ post, occurrence }) => {
|
|
721
|
+
const { currentProfile } = useOpenpeeps();
|
|
722
|
+
const reportPostModalRef = useRef<BottomSheetModal>(null);
|
|
723
|
+
const { t } = useTranslation();
|
|
724
|
+
const myEvent = currentProfile?.id === post?.profile?.id;
|
|
725
|
+
|
|
726
|
+
return (
|
|
727
|
+
<View className="flex-row items-center">
|
|
728
|
+
<ShareMenu post={post} />
|
|
729
|
+
{myEvent ? (
|
|
730
|
+
<EventMenu post={post} occurrence={occurrence} />
|
|
731
|
+
) : (
|
|
732
|
+
<>
|
|
733
|
+
<DropdownMenu>
|
|
734
|
+
<DropdownMenuTrigger asChild className="px-2">
|
|
735
|
+
<MoreVerticalIcon className="text-foreground" />
|
|
736
|
+
</DropdownMenuTrigger>
|
|
737
|
+
<DropdownMenuContent className="mt-1">
|
|
738
|
+
<DropdownMenuGroup>
|
|
739
|
+
<DropdownMenuItem
|
|
740
|
+
className="flex-row gap-x-2 items-center"
|
|
741
|
+
onPress={() => bottomSheetPresent(reportPostModalRef)}
|
|
742
|
+
>
|
|
743
|
+
<FlagIcon className="text-destructive" size={18} />
|
|
744
|
+
<ThemedText className="text-destructive">
|
|
745
|
+
{t('common.actions.reportPost')}
|
|
746
|
+
</ThemedText>
|
|
747
|
+
</DropdownMenuItem>
|
|
748
|
+
</DropdownMenuGroup>
|
|
749
|
+
</DropdownMenuContent>
|
|
750
|
+
</DropdownMenu>
|
|
751
|
+
<ReportProfileOrPostModal
|
|
752
|
+
ref={reportPostModalRef}
|
|
753
|
+
post={post}
|
|
754
|
+
reportType="post"
|
|
755
|
+
/>
|
|
756
|
+
</>
|
|
757
|
+
)}
|
|
758
|
+
</View>
|
|
759
|
+
);
|
|
760
|
+
};
|