diff --git a/src/common/NavBar/HorizontalNavBar/SearchBar/SearchBar.js b/src/common/NavBar/HorizontalNavBar/SearchBar/SearchBar.js index 1a7f052ec..6ea755d2c 100644 --- a/src/common/NavBar/HorizontalNavBar/SearchBar/SearchBar.js +++ b/src/common/NavBar/HorizontalNavBar/SearchBar/SearchBar.js @@ -127,53 +127,45 @@ const SearchBar = React.memo(({ className, query, active }) => { } { - historyOpen ? + historyOpen && searchHistory?.items?.length > 0 || localSearch?.items?.length > 0 ?
{ - localSearch.items.length === 0 && searchHistory.items.length === 0 ? -
{ t('Start typing ...') }
+ searchHistory?.items?.length > 0 ? +
+
+
{ t('STREMIO_TV_SEARCH_HISTORY_TITLE') }
+ +
+ { + searchHistory.items.slice(0, 8).map(({ query, deepLinks }, index) => ( + + )) + } +
: null } -
- { - searchHistory?.items?.length > 0 ? -
-
-
{ t('STREMIO_TV_SEARCH_HISTORY_TITLE') }
- -
- { - searchHistory.items.slice(0, 8).map(({ query, deepLinks }, index) => ( - - )) - } + { + localSearch?.items?.length ? +
+
+
{ t('Recommendations') }
- : - null - } - { - localSearch?.items?.length ? -
-
-
{ t('Recommendations') }
-
- { - localSearch.items.map(({ query, deepLinks }, index) => ( - - )) - } -
- : - null - } -
+ { + localSearch.items.map(({ query, deepLinks }, index) => ( + + )) + } +
+ : + null + }
: null diff --git a/src/common/NavBar/HorizontalNavBar/SearchBar/styles.less b/src/common/NavBar/HorizontalNavBar/SearchBar/styles.less index bc7764fd5..d68390346 100644 --- a/src/common/NavBar/HorizontalNavBar/SearchBar/styles.less +++ b/src/common/NavBar/HorizontalNavBar/SearchBar/styles.less @@ -51,12 +51,18 @@ .menu-container { position: absolute; - width: 100%; - height: auto; top: 100%; left: 0; + width: 100%; + height: auto; z-index: 10; padding: 1rem; + margin: 0 auto; + display: flex; + justify-content: center; + align-items: flex-start; + flex-direction: column; + gap: 1.5rem; background-color: var(--modal-background-color); border-radius: var(--border-radius); @@ -83,37 +89,27 @@ } } - .content { + .items { width: 100%; margin: 0 auto; display: flex; justify-content: center; align-items: flex-start; flex-direction: column; - gap: 1.5rem; - .items { + .item { + width: 90%; + color: var(--primary-foreground-color); + text-align: left; + text-decoration: none; + padding: 0.5rem 1rem; + border-radius: var(--border-radius); width: 100%; - margin: 0 auto; - display: flex; - justify-content: center; - align-items: flex-start; - flex-direction: column; - - .item { - width: 90%; - color: var(--primary-foreground-color); - text-align: left; - text-decoration: none; - padding: 0.5rem 1rem; - border-radius: var(--border-radius); - width: 100%; - cursor: pointer; - z-index: 10; - - &:hover { - background-color: var(--secondary-background-color); - } + cursor: pointer; + z-index: 10; + + &:hover { + background-color: var(--secondary-background-color); } } }