@linktr.ee/messaging-react 1.11.3 → 1.11.4
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/package.json
CHANGED
|
@@ -424,14 +424,10 @@ const ChannelViewInner: React.FC<{
|
|
|
424
424
|
renderMessageInputActions,
|
|
425
425
|
onLeaveConversation,
|
|
426
426
|
onBlockParticipant,
|
|
427
|
-
CustomChannelEmptyState = ChannelEmptyState,
|
|
428
427
|
}) => {
|
|
429
428
|
const { channel } = useChannelStateContext()
|
|
430
429
|
const [showInfo, setShowInfo] = useState(false)
|
|
431
430
|
|
|
432
|
-
// Check if channel has messages - using context to reactively subscribe to message updates
|
|
433
|
-
const hasMessages = (channel?.state?.messages?.length ?? 0) > 0
|
|
434
|
-
|
|
435
431
|
// Get participant info for info dialog
|
|
436
432
|
const participant = React.useMemo(() => {
|
|
437
433
|
const members = Object.values(channel.state.members || {})
|
|
@@ -481,13 +477,6 @@ const ChannelViewInner: React.FC<{
|
|
|
481
477
|
hideNewMessageSeparator={false}
|
|
482
478
|
messageActions={[]}
|
|
483
479
|
/>
|
|
484
|
-
|
|
485
|
-
{/* Show custom empty state when no messages */}
|
|
486
|
-
{!hasMessages && CustomChannelEmptyState && (
|
|
487
|
-
<div className="absolute inset-0 w-full h-full">
|
|
488
|
-
<CustomChannelEmptyState />
|
|
489
|
-
</div>
|
|
490
|
-
)}
|
|
491
480
|
</div>
|
|
492
481
|
|
|
493
482
|
{/* Message Input */}
|
|
@@ -530,7 +519,11 @@ export const ChannelView: React.FC<ChannelViewProps> = ({
|
|
|
530
519
|
className
|
|
531
520
|
)}
|
|
532
521
|
>
|
|
533
|
-
<Channel
|
|
522
|
+
<Channel
|
|
523
|
+
channel={channel}
|
|
524
|
+
MessageSystem={CustomSystemMessage}
|
|
525
|
+
EmptyStateIndicator={CustomChannelEmptyState}
|
|
526
|
+
>
|
|
534
527
|
<ChannelViewInner
|
|
535
528
|
onBack={onBack}
|
|
536
529
|
showBackButton={showBackButton}
|
|
@@ -3,15 +3,4 @@ import React from 'react'
|
|
|
3
3
|
/**
|
|
4
4
|
* Empty state component shown when a channel has no messages
|
|
5
5
|
*/
|
|
6
|
-
export const ChannelEmptyState: React.FC = () =>
|
|
7
|
-
<div className="messaging-channel-empty-state flex items-center justify-center h-full p-8 text-balance">
|
|
8
|
-
<div className="text-center max-w-sm">
|
|
9
|
-
<h2 className="font-semibold text-charcoal mb-2">No messages yet 👀</h2>
|
|
10
|
-
|
|
11
|
-
<p className="text-stone text-xs">
|
|
12
|
-
Share to social media to generate more conversations
|
|
13
|
-
</p>
|
|
14
|
-
</div>
|
|
15
|
-
</div>
|
|
16
|
-
)
|
|
17
|
-
|
|
6
|
+
export const ChannelEmptyState: React.FC = () => null
|