Skip to content

Commit

Permalink
Seach OK
Browse files Browse the repository at this point in the history
  • Loading branch information
medmin committed Oct 7, 2019
1 parent 7f701ea commit 8c2cb6b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/posts/SearchContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ import BaseContainer from "./BaseContainer";
import NoPostMessage from "./NoPostMessage";

const SearchContainer = () => {
const { postState } = useContext(PostContext);
if (postState.search.length === 0) {
const {
postState: { search, tags },
} = useContext(PostContext);

if (search.length === 0) {
return <NoPostMessage msg="Posts Not Found" />;
}

return <BaseContainer posts={postState.search} />;
return <BaseContainer posts={search} tags={tags} />;
};

export default SearchContainer;

0 comments on commit 8c2cb6b

Please sign in to comment.