@openpeepshq/react 0.6.1 → 0.6.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.
|
@@ -35,6 +35,8 @@ export function FullEvent({ post, occurrence }) {
|
|
|
35
35
|
const event = post.data;
|
|
36
36
|
const contextQuery = openpeepsApi.usePostContext(post.id);
|
|
37
37
|
const jamAttendeesQuery = openpeepsApi.useJamAttendance(post.id);
|
|
38
|
+
const jamStateQuery = openpeepsApi.useJamState(post.id, occurrenceId);
|
|
39
|
+
const jamState = event.jam ? jamStateQuery.data : undefined;
|
|
38
40
|
const canViewRecordings = canAccessJamRecordings(profile, post);
|
|
39
41
|
const recordingsQuery = openpeepsApi.usePostRecordings(post.id, !!event.jam && canViewRecordings);
|
|
40
42
|
const recordingsForbiddenMessage = t('error.jamRecordingForbidden', {
|
|
@@ -92,7 +94,7 @@ export function FullEvent({ post, occurrence }) {
|
|
|
92
94
|
}) })) : null] }), post.groupId && group ? (_jsx("a", { href: `/groups/@${group.handle}`, className: "text-muted-foreground block text-sm hover:underline", children: groupName(group) })) : null] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(ShareMenu, { post: post, menuButton: _jsx("span", { className: "flex size-10 items-center justify-center rounded-md", children: _jsx(Share, { className: "size-4" }) }) }), myEvent ? (_jsx(EventMenu, { post: post, occurrence: occurrenceId, menuButton: _jsx("span", { className: "border-input flex size-10 items-center justify-center rounded-md border", children: _jsx(MoreHorizontal, { className: "size-4" }) }) })) : null] })] }), _jsx("h1", { className: "text-2xl font-bold", children: event.name }), _jsxs("div", { className: "mt-2 flex items-center gap-x-2", children: [_jsx(Avatar, { profile: post.profile, size: 2 }), _jsx("a", { href: `/@${post.profile.handle}`, className: "hover:text-primary text-sm hover:underline", children: t('events.hostedBy', {
|
|
93
95
|
defaultValue: 'Hosted by {{profileName}}',
|
|
94
96
|
profileName: `${profileName(post.profile)}${myEvent ? ' · You' : ''}`,
|
|
95
|
-
}) })] }), times.start ? (_jsx(EventWhenBlock, { iso: times.start, label: t('events.startDate', { defaultValue: 'Starts' }), timeZone: event.timeZone })) : null, times.end ? (_jsx(EventWhenBlock, { iso: times.end, label: t('events.endDate', { defaultValue: 'Ends' }), timeZone: event.timeZone })) : null, _jsx(EventLocation, { post: post, preview: false, occurrence: occurrenceId }), event.recurrence ? (_jsx(EventOccurrenceList, { post: post, postId: post.id, occurrences: upcomingOccurrences, currentOccurrenceId: occurrenceId, recurrenceLabel: recurrenceLabel })) : null, _jsx(EventRsvpButton, { post: post, recurrenceId: occurrenceId }), event.jam && (myEvent || iAmModerator) ? (livekitEnabled ? (_jsx(Button, { variant: "default", className: "mt-2 w-full", action: jamLink, children: t('events.jam.start', { defaultValue: 'Start jam' }) })) : (_jsx("p", { role: "status", className: "text-destructive mt-2 text-sm", children: t('jams.unavailable.message', {
|
|
97
|
+
}) })] }), times.start ? (_jsx(EventWhenBlock, { iso: times.start, label: t('events.startDate', { defaultValue: 'Starts' }), timeZone: event.timeZone })) : null, times.end ? (_jsx(EventWhenBlock, { iso: times.end, label: t('events.endDate', { defaultValue: 'Ends' }), timeZone: event.timeZone })) : null, _jsx(EventLocation, { post: post, preview: false, occurrence: occurrenceId }), event.recurrence ? (_jsx(EventOccurrenceList, { post: post, postId: post.id, occurrences: upcomingOccurrences, currentOccurrenceId: occurrenceId, recurrenceLabel: recurrenceLabel })) : null, _jsx(EventRsvpButton, { post: post, recurrenceId: occurrenceId }), event.jam && (myEvent || iAmModerator) ? (livekitEnabled ? (jamState?.active ? (_jsx(Button, { variant: "default", className: "mt-2 w-full", action: jamLink, children: t('jam.join.submit', { defaultValue: 'Join Jam' }) })) : (_jsx(Button, { variant: "default", className: "mt-2 w-full", action: jamLink, children: t('events.jam.start', { defaultValue: 'Start jam' }) }))) : (_jsx("p", { role: "status", className: "text-destructive mt-2 text-sm", children: t('jams.unavailable.message', {
|
|
96
98
|
defaultValue: 'Jams are unavailable because LiveKit is not connected.',
|
|
97
99
|
}) }))) : null, _jsxs("nav", { "aria-label": t('events.tabs.label', { defaultValue: 'Event sections' }), className: "mt-4 flex flex-wrap gap-2 border-b", children: [event.content ? (_jsx(TabButton, { active: tab === 'description', onClick: () => setTab('description'), children: t('events.tabs.description', { defaultValue: 'Description' }) })) : null, _jsx(TabButton, { active: tab === 'replies', onClick: () => setTab('replies'), children: t('events.tabs.discussion', { defaultValue: 'Discussion' }) }), _jsx(TabButton, { active: tab === 'rsvps', onClick: () => setTab('rsvps'), children: t('events.tabs.rsvps', { defaultValue: 'RSVPs' }) }), showJamAttendeesTab ? (_jsx(TabButton, { active: tab === 'attendees', onClick: () => setTab('attendees'), children: t('events.tabs.jamAttendees', { defaultValue: 'Jam attendees' }) })) : null, event.jam ? (_jsx(TabButton, { active: tab === 'recordings', onClick: () => setTab('recordings'), children: t('events.tabs.recordings', { defaultValue: 'Recordings' }) })) : null] }), tab === 'description' && event.content ? (_jsx(OpenpeepsMarkdown, { source: event.content, mentions: post.mentions })) : null, tab === 'replies' ? (_jsxs(_Fragment, { children: [_jsx(ReplyBox, { post: post }), contextQuery.isLoading ? (_jsx("div", { className: "text-muted-foreground py-4 text-sm", children: _jsx(LoadingSpinner, {}) })) : (descendentThreads.map((thread) => (_jsx(ThreadedFeed, { thread: thread }, thread.id))))] })) : null, tab === 'rsvps' ? (_jsx(EventRsvpList, { post: post, occurrenceId: occurrenceId, occurrences: upcomingOccurrences, currentProfile: profile, canManageRsvps: canManageRsvps, onMessage: (target) => openCreateConversation({
|
|
98
100
|
profiles: [target],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openpeepshq/react",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
"react-i18next": "^15.4.1",
|
|
52
52
|
"simple-icons": "^16.31.0",
|
|
53
53
|
"uuidv7": "^1.0.2",
|
|
54
|
-
"@openpeepshq/
|
|
55
|
-
"@openpeepshq/
|
|
54
|
+
"@openpeepshq/common": "^0.3.2",
|
|
55
|
+
"@openpeepshq/client": "^0.2.1",
|
|
56
56
|
"@openpeepshq/greenscreen": "^0.2.1",
|
|
57
|
-
"@openpeepshq/
|
|
57
|
+
"@openpeepshq/react-ui": "^0.4.1"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"react": "^18.3.0 || ^19.0.0",
|
|
@@ -80,6 +80,8 @@ export function FullEvent({ post, occurrence }: FullEventProps) {
|
|
|
80
80
|
const event = post.data as Event;
|
|
81
81
|
const contextQuery = openpeepsApi.usePostContext(post.id);
|
|
82
82
|
const jamAttendeesQuery = openpeepsApi.useJamAttendance(post.id);
|
|
83
|
+
const jamStateQuery = openpeepsApi.useJamState(post.id, occurrenceId);
|
|
84
|
+
const jamState = event.jam ? jamStateQuery.data : undefined;
|
|
83
85
|
const canViewRecordings = canAccessJamRecordings(profile, post);
|
|
84
86
|
const recordingsQuery = openpeepsApi.usePostRecordings(
|
|
85
87
|
post.id,
|
|
@@ -251,9 +253,15 @@ export function FullEvent({ post, occurrence }: FullEventProps) {
|
|
|
251
253
|
|
|
252
254
|
{event.jam && (myEvent || iAmModerator) ? (
|
|
253
255
|
livekitEnabled ? (
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
256
|
+
jamState?.active ? (
|
|
257
|
+
<Button variant="default" className="mt-2 w-full" action={jamLink}>
|
|
258
|
+
{t('jam.join.submit', { defaultValue: 'Join Jam' })}
|
|
259
|
+
</Button>
|
|
260
|
+
) : (
|
|
261
|
+
<Button variant="default" className="mt-2 w-full" action={jamLink}>
|
|
262
|
+
{t('events.jam.start', { defaultValue: 'Start jam' })}
|
|
263
|
+
</Button>
|
|
264
|
+
)
|
|
257
265
|
) : (
|
|
258
266
|
<p role="status" className="text-destructive mt-2 text-sm">
|
|
259
267
|
{t('jams.unavailable.message', {
|