Skip to content

Commit

Permalink
Return sort dropdown for registries and preprints discover (#2000)
Browse files Browse the repository at this point in the history
* Return sort dropdown for registries and preprints discover

* Address styling issue for tablet
  • Loading branch information
futa-ikeda authored Sep 18, 2023
1 parent 19494c9 commit 2fcb730
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
9 changes: 8 additions & 1 deletion lib/osf-components/addon/components/search-page/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@
.topbar {
border-bottom: 1px solid $color-text-black;
display: flex;
justify-content: space-between;
align-items: flex-end;
margin: 0 auto;
max-height: 55px;
margin-top: 1rem;
Expand Down Expand Up @@ -200,6 +202,11 @@
}
}

.search-count {
// override RegistriesStyle
font-size: 1.5em;
}

.help-button {
margin-left: 1.2rem;
}
Expand Down Expand Up @@ -401,7 +408,7 @@
gap: 1rem;
}

.topbar {
.flex-column-tablet {
display: flex;
flex-direction: column;
}
Expand Down
28 changes: 14 additions & 14 deletions lib/osf-components/addon/components/search-page/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ as |layout|>
</layout.left>
<layout.main local-class={{if this.showSidePanelToggle 'search-main-mobile' 'search-main'}} data-analytics-scope='Search page main'>
{{#unless this.showSidePanelToggle}}
<div data-test-topbar-wrapper local-class='topbar'>
<div data-test-topbar-wrapper local-class='topbar {{if @showResourceTypeFilter 'flex-column-tablet'}}'>
{{#if @showResourceTypeFilter}}
<nav
data-test-topbar-object-type-nav
Expand All @@ -215,19 +215,6 @@ as |layout|>
{{/each}}
</ul>
</nav>
<div
data-test-topbar-sort-dropdown
local-class='sort-dropdown'
>
<PowerSelect
@options={{this.sortOptions}}
@selected={{this.selectedSortOption}}
@onChange={{action this.updateSort}}
as |sortOption|
>
<p>{{sortOption.display}}</p>
</PowerSelect>
</div>
{{else if this.showResultCountMiddle}}
<p
data-test-middle-search-count
Expand All @@ -236,6 +223,19 @@ as |layout|>
{{t 'search.total-results' count=this.totalResultCount}}
</p>
{{/if}}
<div
data-test-topbar-sort-dropdown
local-class='sort-dropdown'
>
<PowerSelect
@options={{this.sortOptions}}
@selected={{this.selectedSortOption}}
@onChange={{action this.updateSort}}
as |sortOption|
>
<p>{{sortOption.display}}</p>
</PowerSelect>
</div>
</div>
{{/unless}}
{{#if this.search.isRunning}}
Expand Down

0 comments on commit 2fcb730

Please sign in to comment.