Skip to content

Commit

Permalink
feat: props labelProductClick sent to controller
Browse files Browse the repository at this point in the history
  • Loading branch information
rjinfinite authored and GuiHash committed Mar 25, 2024
1 parent 09d0063 commit 996da03
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/REACT_INTEGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ function App() {
| onChangeScene | | Callback on scene change, it receives the `new scene` as argument (it will also be triggered at the load of the scene) |
| onLoadScene | | Callback on scene load, it receives the `initial scene` as argument |
| onProductClick ![beta] | | Callback on product CTA click, it receives the `product` as argument |
| labelProductClick ![beta] | | Label of product CTA (required, together with onProductClick, for the CTA to appear on the card) |
| onChangeSelectedProductLocation | | Callback when a location is opened (marker clicked) or closed, it receives the `currentProduct` as argument (or nothing when closed) |

### Produt focus props
Expand Down
1 change: 1 addition & 0 deletions packages/display-js/src/lib/embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const oEmbedParameters = [
*/
export function getOEmbedParameters(element, defaults = {}) {
const params = { ...defaults }

for (const param of oEmbedParameters) {
const value = element.getAttribute(`data-hubstairs-${param}`)
const camelParam = kebabToCamel(param)
Expand Down
3 changes: 3 additions & 0 deletions packages/display-react/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ function Display(
language,
initialProductsMode,
initialProducts,
labelProductClick,
},
controller,
) {
Expand Down Expand Up @@ -86,6 +87,7 @@ function Display(
language,
initialProductsMode,
initialProducts,
labelProductClick,
})

if (onReadyStable.current || onErrorStable.current) {
Expand Down Expand Up @@ -150,6 +152,7 @@ function Display(
language,
initialProductsMode,
initialProducts,
labelProductClick,
])

return <div ref={displayRef} />
Expand Down

0 comments on commit 996da03

Please sign in to comment.