From 5e4e515cedb2ceb6b8af7999b0f5eb3edefdb3bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Mon, 30 Sep 2024 18:12:18 +0200 Subject: [PATCH] pl-fe: Minor changes to gallery display MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- .../src/features/account-gallery/components/media-item.tsx | 7 ++++--- packages/pl-fe/src/features/account-gallery/index.tsx | 7 +++---- packages/pl-fe/src/features/group/group-gallery.tsx | 5 +++-- .../features/ui/components/panels/group-media-panel.tsx | 5 +++-- .../features/ui/components/panels/profile-media-panel.tsx | 5 +++-- packages/pl-fe/src/styles/components/media-gallery.scss | 2 +- 6 files changed, 17 insertions(+), 14 deletions(-) diff --git a/packages/pl-fe/src/features/account-gallery/components/media-item.tsx b/packages/pl-fe/src/features/account-gallery/components/media-item.tsx index 9721238f2..ddb814385 100644 --- a/packages/pl-fe/src/features/account-gallery/components/media-item.tsx +++ b/packages/pl-fe/src/features/account-gallery/components/media-item.tsx @@ -12,9 +12,10 @@ import type { AccountGalleryAttachment } from 'pl-fe/selectors'; interface IMediaItem { attachment: AccountGalleryAttachment; onOpenMedia: (attachment: AccountGalleryAttachment) => void; + isLast?: boolean; } -const MediaItem: React.FC = ({ attachment, onOpenMedia }) => { +const MediaItem: React.FC = ({ attachment, onOpenMedia, isLast }) => { const { autoPlayGif, displayMedia } = useSettings(); const [visible, setVisible] = useState(displayMedia !== 'hide_all' && !attachment.status?.sensitive || displayMedia === 'show_all'); @@ -66,7 +67,7 @@ const MediaItem: React.FC = ({ attachment, onOpenMedia }) => { src={attachment.preview_url} alt={attachment.description} style={{ objectPosition: `${x}% ${y}%` }} - className='size-full overflow-hidden rounded-lg' + className={clsx('size-full overflow-hidden', { 'rounded-br-md': isLast })} /> ); } else if (['gifv', 'video'].indexOf(attachment.type) !== -1) { @@ -80,7 +81,7 @@ const MediaItem: React.FC = ({ attachment, onOpenMedia }) => { thumbnail = (