-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from nyaomaru/deno-study
study: layout and routes
- Loading branch information
Showing
8 changed files
with
62 additions
and
42 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
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,10 @@ | ||
import { PageProps } from "$fresh/server.ts"; | ||
|
||
export default function Layout({ Component, state }: PageProps) { | ||
// do something with state here | ||
return ( | ||
<div class="px-4 py-8 mx-auto bg-cyan-300 h-screen"> | ||
<Component /> | ||
</div> | ||
); | ||
} |
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
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,12 +1,18 @@ | ||
import { PageProps } from "$fresh/server.ts"; | ||
import { PageProps, RouteConfig } from "$fresh/server.ts"; | ||
|
||
export const config: RouteConfig = { | ||
skipInheritedLayouts: true, | ||
}; | ||
|
||
export default function GreetPage(props: PageProps) { | ||
const { name } = props.params; | ||
return ( | ||
<main> | ||
<div class="px-4 py-8 mx-auto bg-cyan-300 h-screen"> | ||
<p>Greetings to you, {name}!</p> | ||
</div> | ||
<p>Greetings to you, {name}!</p> | ||
<p> | ||
This page is <em>not</em>{" "} | ||
applied layout because I want to check ignore layout config. | ||
</p> | ||
</main> | ||
); | ||
} |
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