-
-
Save FlorianRappl/f4bd3014e09e26fd7fbe0f3c385987d8 to your computer and use it in GitHub Desktop.
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
import * as React from "react"; | |
import { PiletApi } from "app-shell"; | |
import { ProductPage } from "./ProductPage"; | |
export function setup(app: PiletApi) { | |
const { Extension } = app; | |
const BasketInfo = () => <Extension name="basket-info" />; | |
const BuyButton = ({ item }) => ( | |
<Extension name="buy-button" params={{ item }} /> | |
); | |
const Recommendations = ({ item }) => ( | |
<Extension name="recommendations" params={{ item }} /> | |
); | |
app.registerPage("/products/:name?", ({ history, match }) => ( | |
<ProductPage | |
name={match.params.name || "porsche"} | |
history={history} | |
BasketInfo={BasketInfo} | |
BuyButton={BuyButton} | |
Recommendations={Recommendations} | |
/> | |
)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment