-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #76 from vtex-apps/feature/split-correction-sugges…
…tions-banners Feature/split correction suggestions banners
- Loading branch information
Showing
9 changed files
with
109 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,3 @@ | ||
import { useSearchPage } from "vtex.search-page-context/SearchPageContext"; | ||
import Banner from "./components/Banner"; | ||
import { path } from "ramda"; | ||
|
||
const withBanners = Component => props => { | ||
const { searchQuery } = useSearchPage(); | ||
const banners = | ||
searchQuery.banners || | ||
path(["data", "productSearch", "banners"], searchQuery); | ||
|
||
return <Component {...props} banners={banners} />; | ||
}; | ||
|
||
export default withBanners(Banner); | ||
export default Banner; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,3 @@ | ||
import React from "react"; | ||
import { useSearchPage } from "vtex.search-page-context/SearchPageContext"; | ||
import DidYouMean from "./components/DidYouMean"; | ||
import { path } from "ramda"; | ||
|
||
const withDidYouMeanTerm = Component => () => { | ||
const { searchQuery } = useSearchPage(); | ||
const correction = | ||
searchQuery.correction || | ||
path(["data", "productSearch", "correction"], searchQuery); | ||
|
||
return <Component correction={correction} />; | ||
}; | ||
|
||
export default withDidYouMeanTerm(DidYouMean); | ||
export default DidYouMean; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,3 @@ | ||
import React from "react"; | ||
import { useSearchPage } from "vtex.search-page-context/SearchPageContext"; | ||
import Suggestions from "./components/Suggestions"; | ||
import { path } from "ramda"; | ||
|
||
const withSuggestion = Component => () => { | ||
const { searchQuery } = useSearchPage(); | ||
const suggestion = | ||
searchQuery.suggestion || | ||
path(["data", "productSearch", "suggestion"], searchQuery); | ||
|
||
return <Component suggestion={suggestion} />; | ||
}; | ||
|
||
export default withSuggestion(Suggestions); | ||
export default Suggestions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters