Wunderbar: re-arrange static buttons to the top
## Issue 7075 Move "explore tags" to a stable position ## Changes Move the buttons in the suggestions popup to the top row so that it's position won't be constantly changing depending on the number of results.
This commit is contained in:
parent
2899ce5f9a
commit
939d26801a
2 changed files with 23 additions and 10 deletions
|
@ -321,16 +321,6 @@ export default function WunderBarSuggestions(props: Props) {
|
|||
className={classnames('wunderbar__suggestions', { 'wunderbar__suggestions--mobile': isMobile })}
|
||||
>
|
||||
<ComboboxList>
|
||||
{uriFromQueryIsValid && !noTopSuggestion ? <WunderbarTopSuggestion query={nameFromQuery} /> : null}
|
||||
|
||||
<div className="wunderbar__label">{__('Search Results')}</div>
|
||||
|
||||
{showPlaceholder && term.length > LIGHTHOUSE_MIN_CHARACTERS ? <Spinner type="small" /> : null}
|
||||
|
||||
{!showPlaceholder && results
|
||||
? results.slice(0, isMobile ? 20 : 5).map((uri) => <WunderbarSuggestion key={uri} uri={uri} />)
|
||||
: null}
|
||||
|
||||
{!noBottomLinks && (
|
||||
<div className="wunderbar__bottom-links">
|
||||
<ComboboxOption value={term} className="wunderbar__more-results">
|
||||
|
@ -344,6 +334,18 @@ export default function WunderBarSuggestions(props: Props) {
|
|||
</ComboboxOption>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<hr className="wunderbar__top-separator" />
|
||||
|
||||
{uriFromQueryIsValid && !noTopSuggestion ? <WunderbarTopSuggestion query={nameFromQuery} /> : null}
|
||||
|
||||
<div className="wunderbar__label">{__('Search Results')}</div>
|
||||
|
||||
{showPlaceholder && term.length > LIGHTHOUSE_MIN_CHARACTERS ? <Spinner type="small" /> : null}
|
||||
|
||||
{!showPlaceholder && results
|
||||
? results.slice(0, isMobile ? 20 : 5).map((uri) => <WunderbarSuggestion key={uri} uri={uri} />)
|
||||
: null}
|
||||
</ComboboxList>
|
||||
</ComboboxPopover>
|
||||
)}
|
||||
|
|
|
@ -264,6 +264,17 @@
|
|||
:first-child {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.wunderbar__more-results {
|
||||
margin-top: 0;
|
||||
margin-left: var(--spacing-xxs);
|
||||
margin-bottom: 0;
|
||||
|
||||
@media (min-width: $breakpoint-small) {
|
||||
margin-top: var(--spacing-xxs);
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[data-reach-combobox-option] {
|
||||
|
|
Loading…
Add table
Reference in a new issue