From 975343d2e9ba0e1a1ea59f60636690cb2ea2719b Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Tue, 1 Jun 2021 08:55:15 +1000 Subject: [PATCH] Make multiset mode buttons more obvious (#1435) --- .../src/components/Changelog/versions/v080.md | 1 + ui/v2.5/src/components/Shared/MultiSet.tsx | 66 ++++++++----------- ui/v2.5/src/index.scss | 10 +++ 3 files changed, 38 insertions(+), 39 deletions(-) diff --git a/ui/v2.5/src/components/Changelog/versions/v080.md b/ui/v2.5/src/components/Changelog/versions/v080.md index 91cbbc69b..c702f8137 100644 --- a/ui/v2.5/src/components/Changelog/versions/v080.md +++ b/ui/v2.5/src/components/Changelog/versions/v080.md @@ -7,6 +7,7 @@ * Added [DLNA server](/settings?tab=dlna). ([#1364](https://github.com/stashapp/stash/pull/1364)) ### 🎨 Improvements +* Make multi-set mode buttons more obvious in multi-edit dialog. ([#1435](https://github.com/stashapp/stash/pull/1435)) * Filter modifiers and sort by options are now sorted alphabetically. ([#1406](https://github.com/stashapp/stash/pull/1406)) * Add `CreatedAt` and `UpdatedAt` (and `FileModTime` where applicable) to API objects. ([#1421](https://github.com/stashapp/stash/pull/1421)) * Add Studios Performer filter criterion. ([#1405](https://github.com/stashapp/stash/pull/1405)) diff --git a/ui/v2.5/src/components/Shared/MultiSet.tsx b/ui/v2.5/src/components/Shared/MultiSet.tsx index c99d63cd3..ffcc0d8b0 100644 --- a/ui/v2.5/src/components/Shared/MultiSet.tsx +++ b/ui/v2.5/src/components/Shared/MultiSet.tsx @@ -1,8 +1,7 @@ import * as React from "react"; import * as GQL from "src/core/generated-graphql"; -import { Button, InputGroup } from "react-bootstrap"; -import { Icon } from "src/components/Shared"; +import { Button, ButtonGroup } from "react-bootstrap"; import { FilterSelect } from "./Select"; type ValidTypes = @@ -23,25 +22,20 @@ interface IMultiSetProps { const MultiSet: React.FunctionComponent = ( props: IMultiSetProps ) => { + const modes = [ + GQL.BulkUpdateIdMode.Set, + GQL.BulkUpdateIdMode.Add, + GQL.BulkUpdateIdMode.Remove, + ]; + function onUpdate(items: ValidTypes[]) { props.onUpdate(items); } - function getModeIcon() { - switch (props.mode) { + function getModeText(mode: GQL.BulkUpdateIdMode) { + switch (mode) { case GQL.BulkUpdateIdMode.Set: - return "pencil-alt"; - case GQL.BulkUpdateIdMode.Add: - return "plus"; - case GQL.BulkUpdateIdMode.Remove: - return "times"; - } - } - - function getModeText() { - switch (props.mode) { - case GQL.BulkUpdateIdMode.Set: - return "Set"; + return "Overwrite"; case GQL.BulkUpdateIdMode.Add: return "Add"; case GQL.BulkUpdateIdMode.Remove: @@ -49,31 +43,25 @@ const MultiSet: React.FunctionComponent = ( } } - function nextMode() { - switch (props.mode) { - case GQL.BulkUpdateIdMode.Set: - return GQL.BulkUpdateIdMode.Add; - case GQL.BulkUpdateIdMode.Add: - return GQL.BulkUpdateIdMode.Remove; - case GQL.BulkUpdateIdMode.Remove: - return GQL.BulkUpdateIdMode.Set; - } + function renderModeButton(mode: GQL.BulkUpdateIdMode) { + return ( + + ); } return ( - - - - - +
+ + {modes.map((m) => renderModeButton(m))} + = ( onSelect={onUpdate} ids={props.ids ?? []} /> - +
); }; diff --git a/ui/v2.5/src/index.scss b/ui/v2.5/src/index.scss index 9efb57a8e..f52059cf4 100755 --- a/ui/v2.5/src/index.scss +++ b/ui/v2.5/src/index.scss @@ -631,3 +631,13 @@ div.dropdown-menu { border-color: inherit; box-shadow: inherit; } + +.button-group-above { + .btn:first-child { + border-bottom-left-radius: 0; + } + + .btn:last-child { + border-bottom-right-radius: 0; + } +}