generated from deco-sites/start
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Marcos Candeia <[email protected]>
- Loading branch information
Showing
6 changed files
with
204 additions
and
61 deletions.
There are no files selected for viewing
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
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} />; | ||
} |
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
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]", | ||
|
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
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
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; | ||
} |
Oops, something went wrong.