From 585fca48b0113b409d08022b05fe93fcbb51e3d7 Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 18 Feb 2022 14:16:05 +0100 Subject: [PATCH] refactor(Discover): use modal to display filters instead of Filters component --- src/routes/Discover/Discover.js | 26 ++----------- src/routes/Discover/styles.less | 69 ++++++++++++--------------------- 2 files changed, 29 insertions(+), 66 deletions(-) diff --git a/src/routes/Discover/Discover.js b/src/routes/Discover/Discover.js index 100bb40c6..f87f70d84 100644 --- a/src/routes/Discover/Discover.js +++ b/src/routes/Discover/Discover.js @@ -9,7 +9,6 @@ const { AddonDetailsModal, Button, MainNavBars, MetaItem, Image, MetaPreview, Mu const useDiscover = require('./useDiscover'); const useSelectableInputs = require('./useSelectableInputs'); const styles = require('./styles'); -const { Filters } = require('stremio/common'); const Discover = ({ urlParams, queryParams }) => { const { core } = useServices(); @@ -107,9 +106,6 @@ const Discover = ({ urlParams, queryParams }) => { : } - - { renderMultiselectsInputs() } - : null @@ -194,24 +190,10 @@ const Discover = ({ urlParams, queryParams }) => { { inputsModalOpen && discover.defaultRequest ? - - {selectInputs.map(({ title, isRequired, options, selected, renderLabelText, onSelect }, index) => ( -
-
- {title} - {isRequired ? '*' : null} -
- -
- ))} + +
+ { renderMultiselectsInputs() } +
: null diff --git a/src/routes/Discover/styles.less b/src/routes/Discover/styles.less index cbce005c8..60485c864 100644 --- a/src/routes/Discover/styles.less +++ b/src/routes/Discover/styles.less @@ -18,6 +18,11 @@ pagination-label: label; } +:import('~stremio/common/ModalDialog/styles.less') { + selectable-inputs-modal-container: modal-dialog-container; + selectable-inputs-modal-content: modal-dialog-content; +} + .discover-container { width: 100%; height: 100%; @@ -39,7 +44,7 @@ flex: none; align-self: stretch; display: flex; - flex-direction: row; + flex-direction: row-reverse; padding: 1.5rem; overflow: visible; @@ -79,7 +84,6 @@ justify-content: center; width: 3.5rem; height: 3.5rem; - margin-left: 1.5rem; background-color: @color-background; .filter-icon { @@ -246,48 +250,25 @@ } } -.selectable-inputs-modal-container { - .selectable-input-container { - display: flex; - flex-direction: row; - align-items: center; +.selectable-inputs-modal { + .selectable-inputs-modal-container { + overflow: visible; - &:not(:last-child) { - margin-bottom: 1rem; - } + .selectable-inputs-modal-content { + overflow-y: visible !important; + overflow: visible; - .select-input-label { - flex: none; - width: 10rem; - max-height: 2.4em; - margin-right: 1.5rem; - font-size: 1.1rem; - color: @color-background-dark2-90; - } + .selectable-input-container { + display: flex; + gap: 1em; + flex-direction: column; + overflow: visible; - .select-input { - flex: none; - width: 15rem; - height: 3.5rem; - background-color: @color-surface-light2; - - &:hover, &:focus { - background-color: @color-surface-light3; + .select-input { + height: 3.5em; + } } - - &:focus { - outline-color: @color-background-dark2; - } - - .multiselect-label { - font-weight: normal; - color: @color-background-dark2-90; - } - - .multiselect-icon { - fill: @color-background-dark2-90; - } - } + } } } @@ -470,6 +451,10 @@ display: none; } + .filter-container { + display: flex; + } + .spacing { display: none; } @@ -477,10 +462,6 @@ .pagination-input { margin-left: 0; } - - .filters { - display: block; - } } .meta-items-container {