From a284066da523a005bcea39354b4d4d5d70a7f4c1 Mon Sep 17 00:00:00 2001 From: Leonid Pershin Date: Mon, 27 Jul 2026 12:07:26 +0300 Subject: [PATCH] Refactor GalleryPanel and GalleryBrowser for improved layout and scrolling behavior Updated the GalleryPanel component to adjust its height calculation, ensuring it occupies the full screen without causing dual scrollbars. Modified the GalleryBrowser to implement a fixed-size grid layout, enhancing the visual consistency of image tiles across different screen sizes. These changes improve the overall user experience and usability of the image gallery interface. --- frontend/src/features/admin/images/GalleryPanel.tsx | 6 +++++- frontend/src/features/admin/images/ImageGallery.tsx | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/src/features/admin/images/GalleryPanel.tsx b/frontend/src/features/admin/images/GalleryPanel.tsx index ed67384..2eba8ce 100644 --- a/frontend/src/features/admin/images/GalleryPanel.tsx +++ b/frontend/src/features/admin/images/GalleryPanel.tsx @@ -6,10 +6,14 @@ import { GalleryBrowser } from './ImageGallery' * Своего заголовка нет: страница целиком об одном, и её название уже написано в активной вкладке * админки. Страница занимает экран и сама не прокручивается — пагинации у списка нет, а две полосы * прокрутки (внешняя и внутри сетки) мешали бы друг другу. + * + * 14rem — то, что занято над панелью и под ней: шапка сайта, отступы main, заголовок админки + * и строка вкладок. Промахнуться в меньшую сторону безопасно (снизу останется зазор), в большую — + * вернётся вторая полоса прокрутки. */ export function GalleryPanel() { return ( -
+
) diff --git a/frontend/src/features/admin/images/ImageGallery.tsx b/frontend/src/features/admin/images/ImageGallery.tsx index 302776f..122fac6 100644 --- a/frontend/src/features/admin/images/ImageGallery.tsx +++ b/frontend/src/features/admin/images/ImageGallery.tsx @@ -162,7 +162,9 @@ export function GalleryBrowser({

)} {!isLoading && sorted.length > 0 && ( -
+ // Плитки фиксированного размера, а не N колонок на всю ширину: на широком экране пять + // колонок растягивали постеры на треть экрана каждый. +
{sorted.map((img) => (