From 7c3c58bd11837f83ce72397369e0e5c5be75a5c8 Mon Sep 17 00:00:00 2001 From: futa-ikeda <51409893+futa-ikeda@users.noreply.github.com> Date: Fri, 6 Oct 2023 15:23:42 -0400 Subject: [PATCH] Result counts (#2017) * Show results counts for mobile preprint/registry discover page * Grammar for result counts --- lib/osf-components/addon/components/search-page/component.ts | 2 +- lib/osf-components/addon/components/search-page/styles.scss | 5 +++++ translations/en-us.yml | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/osf-components/addon/components/search-page/component.ts b/lib/osf-components/addon/components/search-page/component.ts index 59e37fa09ed..599ad7be219 100644 --- a/lib/osf-components/addon/components/search-page/component.ts +++ b/lib/osf-components/addon/components/search-page/component.ts @@ -149,7 +149,7 @@ export default class SearchPage extends Component { } get showResultCountLeft() { - return this.totalResultCount && this.args.showResourceTypeFilter; + return this.totalResultCount && (this.args.showResourceTypeFilter || this.showSidePanelToggle); } get selectedSortOption() { diff --git a/lib/osf-components/addon/components/search-page/styles.scss b/lib/osf-components/addon/components/search-page/styles.scss index 3bf1fbb862b..5cdee65cfc4 100644 --- a/lib/osf-components/addon/components/search-page/styles.scss +++ b/lib/osf-components/addon/components/search-page/styles.scss @@ -67,6 +67,11 @@ width: 195px; } } + + .search-count { + // override RegistriesStyle + font-size: 1.5em; + } } .search-main-mobile { diff --git a/translations/en-us.yml b/translations/en-us.yml index 43e0a9ede47..99c02c3ec78 100644 --- a/translations/en-us.yml +++ b/translations/en-us.yml @@ -233,7 +233,7 @@ search: textbox-placeholder: 'Enter search term(s) here' search-button-label: 'Search' search-help-label: 'Help tutorial' - total-results: '{count} results' + total-results: '{count} {count, plural, one {result} other {results} }' no-results: 'No results found' resource-type: search-by: 'Search by object type'