From 42fde9bc9f66b5fb15b3c2437f80fd8eee658ebf Mon Sep 17 00:00:00 2001 From: CJ <72030708+Teda1@users.noreply.github.com> Date: Mon, 6 Mar 2023 15:21:29 -0600 Subject: [PATCH] Add divider to gallery tab (#3508) --- .../Galleries/GalleryDetails/Gallery.tsx | 19 +++++++-- ui/v2.5/src/components/Galleries/styles.scss | 39 ++++++++++++++++++- ui/v2.5/src/docs/en/Changelog/v0200.md | 1 + 3 files changed, 54 insertions(+), 5 deletions(-) diff --git a/ui/v2.5/src/components/Galleries/GalleryDetails/Gallery.tsx b/ui/v2.5/src/components/Galleries/GalleryDetails/Gallery.tsx index dc508ad15..651ef066c 100644 --- a/ui/v2.5/src/components/Galleries/GalleryDetails/Gallery.tsx +++ b/ui/v2.5/src/components/Galleries/GalleryDetails/Gallery.tsx @@ -1,4 +1,4 @@ -import { Tab, Nav, Dropdown } from "react-bootstrap"; +import { Button, Tab, Nav, Dropdown } from "react-bootstrap"; import React, { useEffect, useMemo, useState } from "react"; import { useParams, useHistory, Link } from "react-router-dom"; import { FormattedMessage, useIntl } from "react-intl"; @@ -40,6 +40,8 @@ export const GalleryPage: React.FC = ({ gallery }) => { const Toast = useToast(); const intl = useIntl(); + const [collapsed, setCollapsed] = useState(false); + const [activeTabKey, setActiveTabKey] = useState("gallery-details-panel"); const activeRightTabKey = tab === "images" || tab === "add" ? tab : "images"; const setActiveRightTabKey = (newTab: string | null) => { @@ -73,6 +75,10 @@ export const GalleryPage: React.FC = ({ gallery }) => { } }; + function getCollapseButtonText() { + return collapsed ? ">" : "<"; + } + async function onRescan() { if (!gallery || !path) { return; @@ -285,7 +291,7 @@ export const GalleryPage: React.FC = ({ gallery }) => { {title} {maybeRenderDeleteDialog()} -
+
{gallery.studio && (

@@ -302,7 +308,14 @@ export const GalleryPage: React.FC = ({ gallery }) => {

{renderTabs()}
-
{renderRightTabs()}
+
+ +
+
+ {renderRightTabs()} +
); }; diff --git a/ui/v2.5/src/components/Galleries/styles.scss b/ui/v2.5/src/components/Galleries/styles.scss index 1ee4ee152..7aa1bf052 100644 --- a/ui/v2.5/src/components/Galleries/styles.scss +++ b/ui/v2.5/src/components/Galleries/styles.scss @@ -63,11 +63,46 @@ $galleryTabWidth: 450px; flex: 0 0 $galleryTabWidth; max-width: $galleryTabWidth; overflow: auto; + + &.collapsed { + display: none; + } + } + + .gallery-divider { + flex: 0 0 15px; + max-width: 15px; + + button { + background-color: transparent; + border: 0; + color: $link-color; + cursor: pointer; + font-size: 10px; + font-weight: 800; + height: 100%; + line-height: 100%; + padding: 0; + text-align: center; + width: 100%; + + &:active:not(:hover), + &:focus:not(:hover) { + background-color: transparent; + border: 0; + box-shadow: none; + } + } } .gallery-container { - flex: 0 0 calc(100% - #{$galleryTabWidth}); - max-width: calc(100% - #{$galleryTabWidth}); + flex: 0 0 calc(100% - #{$galleryTabWidth} - 15px); + max-width: calc(100% - #{$galleryTabWidth} - 15px); + + &.expanded { + flex: 0 0 calc(100% - 15px); + max-width: calc(100% - 15px); + } } } diff --git a/ui/v2.5/src/docs/en/Changelog/v0200.md b/ui/v2.5/src/docs/en/Changelog/v0200.md index 2d5913e66..b73117145 100644 --- a/ui/v2.5/src/docs/en/Changelog/v0200.md +++ b/ui/v2.5/src/docs/en/Changelog/v0200.md @@ -10,6 +10,7 @@ * Added toggleable favorite button to Performer cards. ([#3369](https://github.com/stashapp/stash/pull/3369)) ### 🎨 Improvements +* Added collapsible divider to Gallery page. ([#3508](https://github.com/stashapp/stash/pull/3508)) * Overhauled and improved HLS streaming. ([#3274](https://github.com/stashapp/stash/pull/3274)) ### 🐛 Bug fixes