Skip to content

Commit

Permalink
Fix filter UI responsiveness and ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
kpuputti committed Mar 25, 2020
1 parent 62a3134 commit eba47bd
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
9 changes: 8 additions & 1 deletion src/components/SearchFilters/SearchFilters.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@

.root {
display: flex;
justify-content: space-between;
flex-direction: column;
background-color: var(--matterColorBright);
}

.filterWrapper {
display: flex;
justify-content: space-between;
position: relative;
}

Expand All @@ -24,6 +29,8 @@
line-height: 20px;
margin-top: 9px;
margin-bottom: 11px;
margin-left: auto;
margin-right: 8px;

/* parent uses flexbox: this defines minimum width for text "6 results" */
flex-basis: 55px;
Expand Down
33 changes: 17 additions & 16 deletions src/components/SearchFilters/SearchFilters.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const SearchFiltersComponent = props => {
} = props;

const hasNoResult = listingsAreLoaded && resultsCount === 0;
const classes = classNames(rootClassName || css.root, { [css.longInfo]: hasNoResult }, className);
const classes = classNames(rootClassName || css.root, className);

const keywordLabel = intl.formatMessage({
id: 'SearchFilters.keywordLabel',
Expand Down Expand Up @@ -197,22 +197,23 @@ const SearchFiltersComponent = props => {

return (
<div className={classes}>
<div className={css.filters}>
{priceFilterElement}
{dateRangeFilterElement}
{keywordFilterElement}
{toggleSearchFiltersPanelButton}
</div>

{sortBy}

{listingsAreLoaded && resultsCount > 0 ? (
<div className={css.searchResultSummary}>
<span className={css.resultsFound}>
<FormattedMessage id="SearchFilters.foundResults" values={{ count: resultsCount }} />
</span>
<div className={css.filterWrapper}>
<div className={css.filters}>
{priceFilterElement}
{dateRangeFilterElement}
{keywordFilterElement}
{toggleSearchFiltersPanelButton}
</div>
) : null}

{listingsAreLoaded && resultsCount > 0 ? (
<div className={css.searchResultSummary}>
<span className={css.resultsFound}>
<FormattedMessage id="SearchFilters.foundResults" values={{ count: resultsCount }} />
</span>
</div>
) : null}
{sortBy}
</div>

{hasNoResult ? (
<div className={css.noSearchResults}>
Expand Down
8 changes: 0 additions & 8 deletions src/components/SortBy/SortByPopup.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
@import '../../marketplace.css';

.root {
display: inline-block;
margin-left: auto;
margin-right: 8px;

&:last-of-type {
padding-right: 0;
}
}

.icon {
Expand Down Expand Up @@ -84,7 +77,6 @@
color: var(--matterColor);
margin-left: 30px;
margin-right: 30px;
margin-bottom: 24px;
}

.menuItem {
Expand Down

0 comments on commit eba47bd

Please sign in to comment.