From 155f972633c09e0b61ba35912a7eac64c1d54a34 Mon Sep 17 00:00:00 2001 From: Tero Tikkanen Date: Fri, 13 Oct 2023 16:48:22 +0300 Subject: [PATCH] Quickfix/action filters alignment (#193) * Align filter labels properly * Do not wrap filter label tooltips alone * Add contrast to select dropdown hover items --- components/actions/ActionListFilters.tsx | 14 +++++--- components/common/PopoverTip.tsx | 2 +- components/common/SelectDropdown.tsx | 41 +++++++++++++++++------- 3 files changed, 40 insertions(+), 17 deletions(-) diff --git a/components/actions/ActionListFilters.tsx b/components/actions/ActionListFilters.tsx index ef69c864..181db363 100644 --- a/components/actions/ActionListFilters.tsx +++ b/components/actions/ActionListFilters.tsx @@ -168,6 +168,12 @@ const MainCategory = styled.div` } `; +const FilterColumn = styled(Col)` + display: flex; + flex-direction: column; + justify-content: flex-end; +`; + function sortDepthFirst( items: Type[], compareItem: (a: Type, b: Type) => number, @@ -481,7 +487,7 @@ abstract class DefaultFilter ) { const _isMulti = isMulti ?? false; return ( - + onChange={onChange} options={this.options} /> - + ); } } @@ -806,7 +812,7 @@ class ActionNameFilter implements ActionListFilter { t: TFunction ) { return ( - + { currentValue={value} inputRef={this.ref} /> - + ); } } diff --git a/components/common/PopoverTip.tsx b/components/common/PopoverTip.tsx index fab3691f..167fb6a5 100644 --- a/components/common/PopoverTip.tsx +++ b/components/common/PopoverTip.tsx @@ -4,7 +4,7 @@ import { useTranslation } from 'common/i18n'; import { Button, Tooltip } from 'reactstrap'; const InfoButton = styled(Button)` - padding: 0 0.5rem 0.1rem; + padding: 0 0.25rem 0.1rem; line-height: 0.5rem; opacity: 0.5; svg { diff --git a/components/common/SelectDropdown.tsx b/components/common/SelectDropdown.tsx index 4ceda536..693c31da 100644 --- a/components/common/SelectDropdown.tsx +++ b/components/common/SelectDropdown.tsx @@ -2,7 +2,6 @@ import React from 'react'; import Select, { components, DropdownIndicatorProps, - GroupBase, MultiValueProps, Theme as SelectTheme, ValueContainerProps, @@ -11,16 +10,17 @@ import styled from 'styled-components'; import Highlighter from 'react-highlight-words'; import { FormGroup, Label as BSLabel } from 'reactstrap'; import { useTheme, Theme } from 'common/theme'; -import { data } from 'autoprefixer'; import PopoverTip from 'components/common/PopoverTip'; -import { TRUE } from 'sass'; -import { useTranslation } from 'common/i18n'; const Label = styled(BSLabel)` font-weight: ${(props) => props.theme.formLabelFontWeight}; line-height: ${(props) => props.theme.lineHeightSm}; `; +const TooltipWrapper = styled.span` + white-space: nowrap; // Prevents the tooltip from wrapping +`; + function getSelectStyles