Skip to content

Instantly share code, notes, and snippets.

@FlorianRappl
Created November 7, 2019 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FlorianRappl/f4bd3014e09e26fd7fbe0f3c385987d8 to your computer and use it in GitHub Desktop.
Save FlorianRappl/f4bd3014e09e26fd7fbe0f3c385987d8 to your computer and use it in GitHub Desktop.
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