@linktr.ee/messaging-react 3.6.1 → 3.6.2-rc-1783305084
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/dist/{Card-d0_xEfdM.cjs → Card-BThi6-oD.cjs} +2 -2
- package/dist/{Card-d0_xEfdM.cjs.map → Card-BThi6-oD.cjs.map} +1 -1
- package/dist/{Card-BrC7mKtr.js → Card-Cz8tanga.js} +2 -2
- package/dist/{Card-BrC7mKtr.js.map → Card-Cz8tanga.js.map} +1 -1
- package/dist/{Card-BuR6mbUu.cjs → Card-DEk34Twe.cjs} +2 -2
- package/dist/{Card-BuR6mbUu.cjs.map → Card-DEk34Twe.cjs.map} +1 -1
- package/dist/{Card-B0lzpuYf.js → Card-DSQclaiH.js} +3 -3
- package/dist/{Card-B0lzpuYf.js.map → Card-DSQclaiH.js.map} +1 -1
- package/dist/{Card-DcUPqd79.cjs → Card-Jc1n2Iqu.cjs} +2 -2
- package/dist/{Card-DcUPqd79.cjs.map → Card-Jc1n2Iqu.cjs.map} +1 -1
- package/dist/{Card-CxS7GNqp.js → Card-NDZLmjxS.js} +2 -2
- package/dist/{Card-CxS7GNqp.js.map → Card-NDZLmjxS.js.map} +1 -1
- package/dist/{LockedThumbnail-BDtKMJjz.cjs → LockedThumbnail-CqcnnPXB.cjs} +2 -2
- package/dist/{LockedThumbnail-BDtKMJjz.cjs.map → LockedThumbnail-CqcnnPXB.cjs.map} +1 -1
- package/dist/{LockedThumbnail-BaDgF8qJ.js → LockedThumbnail-t9fLaFmy.js} +2 -2
- package/dist/{LockedThumbnail-BaDgF8qJ.js.map → LockedThumbnail-t9fLaFmy.js.map} +1 -1
- package/dist/index-CPCX_7gP.cjs +2 -0
- package/dist/index-CPCX_7gP.cjs.map +1 -0
- package/dist/{index-BPfehHDD.js → index-bPlX3Oo5.js} +1885 -1693
- package/dist/index-bPlX3Oo5.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/components/ChannelHeaderRedesign.tsx +231 -0
- package/src/components/ChannelView.stories.tsx +68 -11
- package/src/components/ChannelView.test.tsx +54 -13
- package/src/components/ChannelView.tsx +74 -28
- package/dist/index-BPfehHDD.js.map +0 -1
- package/dist/index-G4pnfm4m.cjs +0 -2
- package/dist/index-G4pnfm4m.cjs.map +0 -1
|
@@ -25,6 +25,7 @@ import { resolveParticipantDisplayName } from '../utils/resolveParticipantDispla
|
|
|
25
25
|
|
|
26
26
|
import { Avatar } from './Avatar'
|
|
27
27
|
import { ChannelActionsMenu } from './ChannelActionsMenu'
|
|
28
|
+
import { ChannelHeaderRedesign } from './ChannelHeaderRedesign'
|
|
28
29
|
import { CustomDateSeparator } from './CustomDateSeparator'
|
|
29
30
|
import { CustomMessage } from './CustomMessage'
|
|
30
31
|
import { CustomMessageActions } from './CustomMessage/CustomMessageActions'
|
|
@@ -464,6 +465,34 @@ const ChannelViewInner: React.FC<{
|
|
|
464
465
|
dmAgentEnabled &&
|
|
465
466
|
currentUserIsAccount === false &&
|
|
466
467
|
participantIsAccount === true
|
|
468
|
+
const hasVisibleMessages = channel.state.messages.some(
|
|
469
|
+
(message) => message.type !== 'deleted'
|
|
470
|
+
)
|
|
471
|
+
const channelBanner = renderChannelBanner ? (
|
|
472
|
+
<React.Fragment key="lt-channel-banner">
|
|
473
|
+
{renderChannelBanner()}
|
|
474
|
+
</React.Fragment>
|
|
475
|
+
) : null
|
|
476
|
+
const redesignedHeader = onParticipantNameClick ? (
|
|
477
|
+
<ChannelHeaderRedesign
|
|
478
|
+
onBack={onBack}
|
|
479
|
+
showBackButton={showBackButton}
|
|
480
|
+
showChannelInfo={showChannelInfo}
|
|
481
|
+
showStarButton={showStarButton}
|
|
482
|
+
dmAgentEnabled={showDmAgentHeader}
|
|
483
|
+
onLeaveConversation={onLeaveConversation}
|
|
484
|
+
onBlockParticipant={onBlockParticipant}
|
|
485
|
+
showDeleteConversation={showDeleteConversation}
|
|
486
|
+
showBlockParticipant={showBlockParticipant}
|
|
487
|
+
showReportParticipant={showReportParticipant}
|
|
488
|
+
onDeleteConversationClick={onDeleteConversationClick}
|
|
489
|
+
onBlockParticipantClick={onBlockParticipantClick}
|
|
490
|
+
onReportParticipantClick={onReportParticipantClick}
|
|
491
|
+
customChannelActions={customChannelActions}
|
|
492
|
+
renderChannelActions={renderChannelActions}
|
|
493
|
+
onParticipantNameClick={onParticipantNameClick}
|
|
494
|
+
/>
|
|
495
|
+
) : null
|
|
467
496
|
|
|
468
497
|
// Prevents all message instances from unmounting when ChannelViewInner re-renders
|
|
469
498
|
const MessageOverride = useCallback(
|
|
@@ -497,41 +526,58 @@ const ChannelViewInner: React.FC<{
|
|
|
497
526
|
>
|
|
498
527
|
<Window>
|
|
499
528
|
{/* Custom Channel Header */}
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
529
|
+
{!onParticipantNameClick && (
|
|
530
|
+
<>
|
|
531
|
+
<div key="lt-channel-header">
|
|
532
|
+
<CustomChannelHeader
|
|
533
|
+
onBack={onBack}
|
|
534
|
+
showBackButton={showBackButton}
|
|
535
|
+
showChannelInfo={showChannelInfo}
|
|
536
|
+
showStarButton={showStarButton}
|
|
537
|
+
dmAgentEnabled={showDmAgentHeader}
|
|
538
|
+
onLeaveConversation={onLeaveConversation}
|
|
539
|
+
onBlockParticipant={onBlockParticipant}
|
|
540
|
+
showDeleteConversation={showDeleteConversation}
|
|
541
|
+
showBlockParticipant={showBlockParticipant}
|
|
542
|
+
showReportParticipant={showReportParticipant}
|
|
543
|
+
onDeleteConversationClick={onDeleteConversationClick}
|
|
544
|
+
onBlockParticipantClick={onBlockParticipantClick}
|
|
545
|
+
onReportParticipantClick={onReportParticipantClick}
|
|
546
|
+
customChannelActions={customChannelActions}
|
|
547
|
+
renderChannelActions={renderChannelActions}
|
|
548
|
+
renderHeaderTitleBadges={renderHeaderTitleBadges}
|
|
549
|
+
/>
|
|
550
|
+
</div>
|
|
551
|
+
{channelBanner}
|
|
552
|
+
</>
|
|
553
|
+
)}
|
|
521
554
|
|
|
522
|
-
{/*
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
555
|
+
{/* Stream only renders MessageList.head when there are messages, so
|
|
556
|
+
empty redesigned channels need the header and banner in normal flow. */}
|
|
557
|
+
{onParticipantNameClick && !hasVisibleMessages && (
|
|
558
|
+
<div className="px-4 @lg:px-6">
|
|
559
|
+
{redesignedHeader}
|
|
560
|
+
{channelBanner}
|
|
561
|
+
</div>
|
|
562
|
+
)}
|
|
528
563
|
|
|
529
564
|
{/* Message List */}
|
|
530
565
|
<div
|
|
531
566
|
key="lt-channel-message-list"
|
|
532
567
|
className="flex-1 overflow-hidden relative"
|
|
533
568
|
>
|
|
534
|
-
<MessageList
|
|
569
|
+
<MessageList
|
|
570
|
+
head={
|
|
571
|
+
onParticipantNameClick && hasVisibleMessages ? (
|
|
572
|
+
<div className="sticky top-0 z-10">
|
|
573
|
+
{redesignedHeader}
|
|
574
|
+
{channelBanner}
|
|
575
|
+
</div>
|
|
576
|
+
) : undefined
|
|
577
|
+
}
|
|
578
|
+
hideDeletedMessages
|
|
579
|
+
hideNewMessageSeparator={false}
|
|
580
|
+
/>
|
|
535
581
|
</div>
|
|
536
582
|
|
|
537
583
|
{renderConversationFooter ? (
|