diff --git a/stylesheets/components/StoryViewer.scss b/stylesheets/components/StoryViewer.scss index b6da2b2d4014..204828bedef5 100644 --- a/stylesheets/components/StoryViewer.scss +++ b/stylesheets/components/StoryViewer.scss @@ -34,7 +34,6 @@ @include color-svg('../images/icons/v2/x-24.svg', $color-gray-15); } right: 28px; - top: 0; z-index: $z-index-above-above-base; } diff --git a/stylesheets/components/StoryViewsNRepliesModal.scss b/stylesheets/components/StoryViewsNRepliesModal.scss index 38ea5251c4f0..7d7d70c3c46f 100644 --- a/stylesheets/components/StoryViewsNRepliesModal.scss +++ b/stylesheets/components/StoryViewsNRepliesModal.scss @@ -13,6 +13,7 @@ &__replies { flex: 1; + margin: 0 -16px; max-height: 75vh; overflow-y: overlay; @@ -127,7 +128,7 @@ align-items: center; display: flex; justify-content: space-between; - padding: 12px 0; + padding: 12px 16px; &--container { display: flex; diff --git a/ts/components/StoryViewsNRepliesModal.stories.tsx b/ts/components/StoryViewsNRepliesModal.stories.tsx index 3c6583537c56..aab6825001b4 100644 --- a/ts/components/StoryViewsNRepliesModal.stories.tsx +++ b/ts/components/StoryViewsNRepliesModal.stories.tsx @@ -10,6 +10,7 @@ import enMessages from '../../_locales/en/messages.json'; import { IMAGE_JPEG } from '../types/MIME'; import { SendStatus } from '../messages/MessageSendState'; import { StoryViewsNRepliesModal } from './StoryViewsNRepliesModal'; +import { UUID } from '../types/UUID'; import { fakeAttachment } from '../test-both/helpers/fakeAttachment'; import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation'; import { setupI18n } from '../util/setupI18n'; @@ -69,6 +70,9 @@ function getViewsAndReplies() { const p3 = getDefaultConversation(); const p4 = getDefaultConversation(); const p5 = getDefaultConversation(); + const p6 = getDefaultConversation({ + isMe: true, + }); const views = [ { @@ -100,20 +104,52 @@ function getViewsAndReplies() { const replies = [ { - ...p2, + author: p2, body: 'So cute ❤️', + conversationId: p2.id, + id: UUID.generate().toString(), timestamp: Date.now() - 24 * durations.MINUTE, }, { - ...p3, + author: p3, body: "That's awesome", + conversationId: p3.id, + id: UUID.generate().toString(), timestamp: Date.now() - 13 * durations.MINUTE, }, { - ...p4, + author: p3, + body: 'Very awesome', + conversationId: p3.id, + id: UUID.generate().toString(), + timestamp: Date.now() - 13 * durations.MINUTE, + }, + { + author: p3, + body: 'Did I mention how awesome this is?', + conversationId: p3.id, + id: UUID.generate().toString(), + timestamp: Date.now() - 12 * durations.MINUTE, + }, + { + author: p4, + conversationId: p4.id, + id: UUID.generate().toString(), reactionEmoji: '❤️', timestamp: Date.now() - 5 * durations.MINUTE, }, + { + author: p6, + body: 'Thanks everyone!', + conversationId: p6.id, + id: UUID.generate().toString(), + sendStateByConversationId: { + [p1.id]: { + status: SendStatus.Pending, + }, + }, + timestamp: Date.now(), + }, ]; return { diff --git a/ts/components/StoryViewsNRepliesModal.tsx b/ts/components/StoryViewsNRepliesModal.tsx index bcdff61f3665..66294c308593 100644 --- a/ts/components/StoryViewsNRepliesModal.tsx +++ b/ts/components/StoryViewsNRepliesModal.tsx @@ -16,7 +16,7 @@ import { CompositionInput } from './CompositionInput'; import { ContactName } from './conversation/ContactName'; import { EmojiButton } from './emoji/EmojiButton'; import { Emojify } from './conversation/Emojify'; -import { MessageBody } from './conversation/MessageBody'; +import { Message, TextDirection } from './conversation/Message'; import { MessageTimestamp } from './conversation/MessageTimestamp'; import { Modal } from './Modal'; import { Quote } from './conversation/Quote'; @@ -24,8 +24,58 @@ import { ReactionPicker } from './conversation/ReactionPicker'; import { Tabs } from './Tabs'; import { Theme } from '../util/theme'; import { ThemeType } from '../types/Util'; +import { WidthBreakpoint } from './_util'; import { getAvatarColor } from '../types/Colors'; import { getStoryReplyText } from '../util/getStoryReplyText'; +import { shouldNeverBeCalled } from '../util/shouldNeverBeCalled'; + +// Menu is disabled so these actions are inaccessible. We also don't support +// link previews, tap to view messages, attachments, or gifts. Just regular +// text messages and reactions. +const MESSAGE_DEFAULT_PROPS = { + canDeleteForEveryone: false, + canDownload: false, + canReact: false, + canReply: false, + canRetry: false, + canRetryDeleteForEveryone: false, + checkForAccount: shouldNeverBeCalled, + clearSelectedMessage: shouldNeverBeCalled, + containerWidthBreakpoint: WidthBreakpoint.Medium, + deleteMessage: shouldNeverBeCalled, + deleteMessageForEveryone: shouldNeverBeCalled, + displayTapToViewMessage: shouldNeverBeCalled, + doubleCheckMissingQuoteReference: shouldNeverBeCalled, + downloadAttachment: shouldNeverBeCalled, + isBlocked: false, + isMessageRequestAccepted: true, + kickOffAttachmentDownload: shouldNeverBeCalled, + markAttachmentAsCorrupted: shouldNeverBeCalled, + markViewed: shouldNeverBeCalled, + messageExpanded: shouldNeverBeCalled, + openConversation: shouldNeverBeCalled, + openGiftBadge: shouldNeverBeCalled, + openLink: shouldNeverBeCalled, + previews: [], + reactToMessage: shouldNeverBeCalled, + renderAudioAttachment: () =>
, + renderEmojiPicker: () => , + renderReactionPicker: () => , + replyToMessage: shouldNeverBeCalled, + retryDeleteForEveryone: shouldNeverBeCalled, + retrySend: shouldNeverBeCalled, + scrollToQuotedMessage: shouldNeverBeCalled, + showContactDetail: shouldNeverBeCalled, + showContactModal: shouldNeverBeCalled, + showExpiredIncomingTapToViewToast: shouldNeverBeCalled, + showExpiredOutgoingTapToViewToast: shouldNeverBeCalled, + showForwardMessageModal: shouldNeverBeCalled, + showMessageDetail: shouldNeverBeCalled, + showVisualAttachment: shouldNeverBeCalled, + startConversation: shouldNeverBeCalled, + theme: ThemeType.dark, + viewStory: shouldNeverBeCalled, +}; enum Tab { Replies = 'Replies', @@ -79,6 +129,7 @@ export const StoryViewsNRepliesModal = ({ storyPreviewAttachment, views, }: PropsType): JSX.Element | null => { + const containerElementRef = useRef