algolia / instantsearch

⚡️ Libraries for building performant and instant search and recommend experiences with Algolia. Compatible with JavaScript, TypeScript, React and Vue.
https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/
MIT License
3.59k stars 503 forks source link

feat(hits): add banner to react instantsearch hits #6170

Closed taylorcjohnson closed 2 months ago

taylorcjohnson commented 2 months ago

Summary

This is the fourth pull request to add support for no-code banners to the Hits widget (RFC). Building on the recent changes to the Hits instantsearch-ui-component it updates the Hits React InstantSearch widget to support a new bannerComponent.

EMERCH-1421

There will be a follow-on PR to update React InstantSearch.

Result

The hits widget tests have been updated to ensure that the new optional banner component is supported. No styling was applied in the examples or to instantsearch.css - that will most likely come in a follow-up PR.

Additionally, the code was tested in the getting-started example codebase (connected to appId: F4T6CUV2AH, index: products in the beta environment - where the test rules with a banner consequence exists).

Getting Started App (no bannerComponent; query: nikon; nikon camera promotion alt text and links to https://www.nikonusa.com/): image

Getting Started App (custom bannerComponent; query nikon): image

Getting Started App (bannerComponent={false}; query nikon): image

codesandbox-ci[bot] commented 2 months ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 1fdb88fbc8c7f0c1738ca41a99202aab6f99ca07:

Sandbox Source
example-instantsearch-getting-started Configuration
example-react-instantsearch-getting-started Configuration
example-react-instantsearch-next-app-dir-example Configuration
example-react-instantsearch-next-routing-example Configuration
example-vue-instantsearch-getting-started Configuration