diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 2ad30b98ac..56e3dc4598 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -6856,6 +6856,10 @@ "messageformat": "No Links", "description": "Title of the empty state view of media gallery for links tab" }, + "icu:MediaGallery__EmptyState__description--links-2": { + "messageformat": "Links that you send and receive will appear here", + "description": "Description of the empty state view of media gallery for links tab" + }, "icu:MediaGallery__EmptyState__description--documents": { "messageformat": "Links that you send and receive will appear here", "description": "Description of the empty state view of media gallery for links tab" @@ -6864,6 +6868,10 @@ "messageformat": "No Files", "description": "Title of the empty state view of media gallery for files tab" }, + "icu:MediaGallery__EmptyState__description--documents-2": { + "messageformat": "Files that you send and receive will appear here", + "description": "Description of the empty state view of media gallery for files tab" + }, "icu:MediaGallery__EmptyState__description--links": { "messageformat": "Files that you send and receive will appear here", "description": "Description of the empty state view of media gallery for files tab" diff --git a/stylesheets/_modules.scss b/stylesheets/_modules.scss index f9da93b4d1..59c05fb32d 100644 --- a/stylesheets/_modules.scss +++ b/stylesheets/_modules.scss @@ -2464,44 +2464,6 @@ button.ConversationDetails__action-button { margin-inline-start: 16px; } -// Module: Media Gallery - -.module-media-gallery { - display: flex; - flex-direction: column; - flex-grow: 1; - width: 100%; - height: 100%; - outline: none; -} - -.module-media-gallery__content { - flex-grow: 1; - overflow-y: auto; - overflow-x: hidden; - padding: 20px; -} - -.module-media-gallery__scroll-observer { - position: absolute; - bottom: 0; - height: 30px; - - &::after { - content: ''; - height: 1px; // Always show the element to not mess with the height of the scroll area - display: block; - } -} - -.module-media-gallery__sections { - min-width: 0; - - display: flex; - flex-grow: 1; - flex-direction: column; -} - // Module: Message Request Actions .module-message-request-actions { diff --git a/ts/components/conversation/media-gallery/AttachmentSection.dom.tsx b/ts/components/conversation/media-gallery/AttachmentSection.dom.tsx index 5f1558067d..f78b7cadca 100644 --- a/ts/components/conversation/media-gallery/AttachmentSection.dom.tsx +++ b/ts/components/conversation/media-gallery/AttachmentSection.dom.tsx @@ -94,8 +94,8 @@ export function AttachmentSection({ case 'audio': case 'link': return ( -
-

{header}

+
+

{header}

{verified.entries.map(mediaItem => { return ( diff --git a/ts/components/conversation/media-gallery/EmptyState.dom.tsx b/ts/components/conversation/media-gallery/EmptyState.dom.tsx index dab170fe6d..c9d6c7200d 100644 --- a/ts/components/conversation/media-gallery/EmptyState.dom.tsx +++ b/ts/components/conversation/media-gallery/EmptyState.dom.tsx @@ -29,12 +29,12 @@ export function EmptyState({ i18n, tab }: Props): JSX.Element { case TabViews.Documents: title = i18n('icu:MediaGallery__EmptyState__title--documents'); description = i18n( - 'icu:MediaGallery__EmptyState__description--documents' + 'icu:MediaGallery__EmptyState__description--documents-2' ); break; case TabViews.Links: title = i18n('icu:MediaGallery__EmptyState__title--links'); - description = i18n('icu:MediaGallery__EmptyState__description--links'); + description = i18n('icu:MediaGallery__EmptyState__description--links-2'); break; default: throw missingCaseError(tab); diff --git a/ts/components/conversation/media-gallery/LinkPreviewItem.dom.tsx b/ts/components/conversation/media-gallery/LinkPreviewItem.dom.tsx index aec3c95fd3..6c5a677935 100644 --- a/ts/components/conversation/media-gallery/LinkPreviewItem.dom.tsx +++ b/ts/components/conversation/media-gallery/LinkPreviewItem.dom.tsx @@ -64,7 +64,8 @@ export function LinkPreviewItem({
diff --git a/ts/components/conversation/media-gallery/ListItem.dom.tsx b/ts/components/conversation/media-gallery/ListItem.dom.tsx index eff53cb245..1fda151a46 100644 --- a/ts/components/conversation/media-gallery/ListItem.dom.tsx +++ b/ts/components/conversation/media-gallery/ListItem.dom.tsx @@ -124,7 +124,10 @@ export function ListItem({ return ( diff --git a/ts/components/conversation/media-gallery/MediaGallery.dom.tsx b/ts/components/conversation/media-gallery/MediaGallery.dom.tsx index 5baa954569..652219e7b2 100644 --- a/ts/components/conversation/media-gallery/MediaGallery.dom.tsx +++ b/ts/components/conversation/media-gallery/MediaGallery.dom.tsx @@ -1,7 +1,7 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import React, { useEffect, useRef, useCallback } from 'react'; +import React, { Fragment, useEffect, useRef, useCallback } from 'react'; import moment from 'moment'; @@ -133,7 +133,12 @@ function MediaSection({ } const now = Date.now(); - const sections = groupMediaItemsByDate(now, mediaItems).map(section => { + const groupedItems = groupMediaItemsByDate(now, mediaItems); + + const isGrid = mediaItems.at(0)?.type === 'media'; + + const sections = groupedItems.map((section, index) => { + const isLast = index === groupedItems.length - 1; const first = section.mediaItems[0]; const { message } = first; const date = moment(message.receivedAtMs || message.receivedAt); @@ -158,25 +163,24 @@ function MediaSection({ const header = getHeader(); return ( - + + + {!isGrid && !isLast && ( +
+ )} +
); }); - const isGrid = mediaItems.at(0)?.type === 'media'; - return ( -
+
{sections}
); @@ -308,7 +312,11 @@ export function MediaGallery({ ]); return ( -
+
{renderMiniPlayer()} -
+
+
); }} -
); }