[CORL-619] update search results copy (#2606)

* update search results copy

* fix: removed unused messages
This commit is contained in:
Tessa Thornton
2019-10-01 20:43:50 +00:00
committed by Wyatt Johnson
parent d0df6bc849
commit 6dbc724f31
6 changed files with 73 additions and 113 deletions
@@ -109,7 +109,23 @@ const Bar: FunctionComponent<Props> = ({ title, options, onSearch }) => {
</Group>
</Localized>
)}
{searchOptions.length > 0 && (
{searchOptions.length === 1 && (
<Group
title={
<>
<Icon>search</Icon>{" "}
<Localized id="moderate-searchBar-searchResults">
<span>Search results</span>
</Localized>
</>
}
id="moderate-searchBar-search"
light
>
{searchOptions}
</Group>
)}
{searchOptions.length > 1 && (
<Group
title={
<>
@@ -13,7 +13,7 @@ import { ModerateSearchBarContainer_story as ModerationQueuesData } from "coral-
import { useEffectWhenChanged } from "coral-framework/hooks";
import { useFetch, withFragmentContainer } from "coral-framework/lib/relay";
import { PropTypesOf } from "coral-framework/types";
import { Spinner } from "coral-ui/components";
import { Flex, Spinner } from "coral-ui/components";
import { blur } from "coral-ui/helpers";
import {
ListBoxOptionClickOrEnterHandler,
@@ -174,9 +174,13 @@ function useSearchOptions(
nextSearchOptions.push({
element: (
<Option>
<Localized id="moderate-searchBar-noResults">
<span>No results</span>
</Localized>
<Flex justifyContent="center">
<Localized id="moderate-searchBar-noStories">
<span>
We could not find any stories matching your criteria
</span>
</Localized>
</Flex>
</Option>
),
group: "SEARCH",
@@ -109,7 +109,10 @@ describe("all stories", () => {
// Ensure no results message is shown.
await wait(() =>
within(searchBar).getByText("No results", { exact: false })
within(searchBar).getByText(
"We could not find any stories matching your criteria",
{ exact: false }
)
);
});