Skip to content

Commit

Permalink
Add canonical header
Browse files Browse the repository at this point in the history
Signed-off-by: Marcos Candeia <[email protected]>
  • Loading branch information
mcandeia committed May 18, 2023
1 parent 9a12163 commit 6702fa6
Show file tree
Hide file tree
Showing 6 changed files with 204 additions and 61 deletions.
19 changes: 19 additions & 0 deletions commerce/types.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import type { ComponentFunc } from "$live/engine/block.ts";

/**
* @title The canonical props of a component.
*/
export type CanonicalProps<T> = T & {
Layout: ComponentFunc<T>;
};

/**
* The default implementation of a canonical component.
* @param the canonical props
*/
export function Canonical<TProps>(
props: CanonicalProps<TProps>,
) {
const { Layout } = props;
return <Layout {...props} />;
}
2 changes: 1 addition & 1 deletion import_map.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"imports": {
"deco-sites/std/": "./",
"$live/": "https://denopkg.com/deco-cx/live@1.3.8/",
"$live/": "https://denopkg.com/deco-cx/live@acd4cddd20437b64c4253d3c4c84face77718347/",
"partytown/": "https://deno.land/x/[email protected]/",
"$fresh/": "https://deno.land/x/[email protected]/",
"preact": "https://esm.sh/[email protected]",
Expand Down
44 changes: 24 additions & 20 deletions live.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,14 @@ import * as $$$1 from "./loaders/vtex/legacy/productDetailsPage.ts";
import * as $$$2 from "./loaders/vtex/legacy/productListingPage.ts";
import * as $$$3 from "./loaders/vtex/legacy/relatedProductsLoader.ts";
import * as $$$4 from "./loaders/vtex/wishlist.ts";
import * as $$$5 from "./loaders/vtex/navbar.ts";
import * as $$$6 from "./loaders/vtex/intelligentSearch/productList.ts";
import * as $$$7 from "./loaders/vtex/intelligentSearch/productDetailsPage.ts";
import * as $$$8 from "./loaders/vtex/intelligentSearch/productListingPage.ts";
import * as $$$9 from "./loaders/vtex/intelligentSearch/suggestions.ts";
import * as $$$10 from "./loaders/vtex/cart.ts";
import * as $$$11 from "./loaders/vtex/user.ts";
import * as $$$5 from "./loaders/vtex/components/myHeader.tsx";
import * as $$$6 from "./loaders/vtex/navbar.ts";
import * as $$$7 from "./loaders/vtex/intelligentSearch/productList.ts";
import * as $$$8 from "./loaders/vtex/intelligentSearch/productDetailsPage.ts";
import * as $$$9 from "./loaders/vtex/intelligentSearch/productListingPage.ts";
import * as $$$10 from "./loaders/vtex/intelligentSearch/suggestions.ts";
import * as $$$11 from "./loaders/vtex/cart.ts";
import * as $$$12 from "./loaders/vtex/user.ts";
import * as $$$$0 from "./routes/404.tsx";
import * as $$$$1 from "./routes/_app.tsx";
import * as $$$$$$$$0 from "./sections/configYourViews.global.tsx";
Expand All @@ -57,9 +58,10 @@ import * as $$$$$$$$3 from "./sections/SEOPLP.tsx";
import * as $$$$$$$$4 from "./sections/configOCC.global.tsx";
import * as $$$$$$$$5 from "./sections/Analytics.tsx";
import * as $$$$$$$$6 from "./sections/configShopify.global.tsx";
import * as $$$$$$$$7 from "./sections/configVNDA.global.tsx";
import * as $$$$$$$$8 from "./sections/configVTEX.global.tsx";
import * as $$$$$$$$9 from "./sections/SEOPDP.tsx";
import * as $$$$$$$$7 from "./sections/Header.tsx";
import * as $$$$$$$$8 from "./sections/configVNDA.global.tsx";
import * as $$$$$$$$9 from "./sections/configVTEX.global.tsx";
import * as $$$$$$$$10 from "./sections/SEOPDP.tsx";
import * as $$$$$$$$$$$0 from "./actions/vtex/notifyme.ts";
import * as $$$$$$$$$$$1 from "./actions/vtex/cart/updateCoupons.ts";
import * as $$$$$$$$$$$2 from "./actions/vtex/cart/updateAttachment.ts";
Expand Down Expand Up @@ -153,17 +155,18 @@ const manifest = {
"loaders": {
"$live/loaders/workflows/events.ts": i1$0,
"$live/loaders/workflows/get.ts": i1$1,
"deco-sites/std/loaders/vtex/cart.ts": $$$10,
"deco-sites/std/loaders/vtex/intelligentSearch/productDetailsPage.ts": $$$7,
"deco-sites/std/loaders/vtex/intelligentSearch/productList.ts": $$$6,
"deco-sites/std/loaders/vtex/intelligentSearch/productListingPage.ts": $$$8,
"deco-sites/std/loaders/vtex/intelligentSearch/suggestions.ts": $$$9,
"deco-sites/std/loaders/vtex/cart.ts": $$$11,
"deco-sites/std/loaders/vtex/components/myHeader.tsx": $$$5,
"deco-sites/std/loaders/vtex/intelligentSearch/productDetailsPage.ts": $$$8,
"deco-sites/std/loaders/vtex/intelligentSearch/productList.ts": $$$7,
"deco-sites/std/loaders/vtex/intelligentSearch/productListingPage.ts": $$$9,
"deco-sites/std/loaders/vtex/intelligentSearch/suggestions.ts": $$$10,
"deco-sites/std/loaders/vtex/legacy/productDetailsPage.ts": $$$1,
"deco-sites/std/loaders/vtex/legacy/productList.ts": $$$0,
"deco-sites/std/loaders/vtex/legacy/productListingPage.ts": $$$2,
"deco-sites/std/loaders/vtex/legacy/relatedProductsLoader.ts": $$$3,
"deco-sites/std/loaders/vtex/navbar.ts": $$$5,
"deco-sites/std/loaders/vtex/user.ts": $$$11,
"deco-sites/std/loaders/vtex/navbar.ts": $$$6,
"deco-sites/std/loaders/vtex/user.ts": $$$12,
"deco-sites/std/loaders/vtex/wishlist.ts": $$$4,
},
"routes": {
Expand All @@ -188,11 +191,12 @@ const manifest = {
"deco-sites/std/sections/configButterCMS.global.tsx": $$$$$$$$1,
"deco-sites/std/sections/configOCC.global.tsx": $$$$$$$$4,
"deco-sites/std/sections/configShopify.global.tsx": $$$$$$$$6,
"deco-sites/std/sections/configVNDA.global.tsx": $$$$$$$$7,
"deco-sites/std/sections/configVTEX.global.tsx": $$$$$$$$8,
"deco-sites/std/sections/configVNDA.global.tsx": $$$$$$$$8,
"deco-sites/std/sections/configVTEX.global.tsx": $$$$$$$$9,
"deco-sites/std/sections/configYourViews.global.tsx": $$$$$$$$0,
"deco-sites/std/sections/Header.tsx": $$$$$$$$7,
"deco-sites/std/sections/SEO.tsx": $$$$$$$$2,
"deco-sites/std/sections/SEOPDP.tsx": $$$$$$$$9,
"deco-sites/std/sections/SEOPDP.tsx": $$$$$$$$10,
"deco-sites/std/sections/SEOPLP.tsx": $$$$$$$$3,
},
"actions": {
Expand Down
12 changes: 12 additions & 0 deletions loaders/vtex/components/myHeader.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import {
Layout,
Props as HeaderProps,
} from "deco-sites/std/sections/Header.tsx";

function MyHeaderLayout({ logo }: HeaderProps) {
return <div>This is a {logo}</div>;
}

export default function MyHeader(): Layout {
return MyHeaderLayout;
}
Loading

0 comments on commit 6702fa6

Please sign in to comment.