-
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 #27 from nyaomaru/add-test
Add test
- Loading branch information
Showing
12 changed files
with
157 additions
and
43 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,58 @@ | ||
import { JSX } from "preact"; | ||
|
||
type HeadingProps = { | ||
variant: "h1" | "h2" | "h3" | "h4" | "h5" | "h6"; | ||
text: string; | ||
} & JSX.HTMLAttributes<HTMLHeadingElement>; | ||
|
||
export function Heading({ variant, text, ...props }: HeadingProps) { | ||
if (variant === "h1") { | ||
return ( | ||
<h1 {...props} class="text-5xl font-bold text-gray-800"> | ||
{text} | ||
</h1> | ||
); | ||
} | ||
|
||
if (variant === "h2") { | ||
return ( | ||
<h2 {...props} class="text-3xl font-semibold text-gray-800"> | ||
{text} | ||
</h2> | ||
); | ||
} | ||
|
||
if (variant === "h3") { | ||
return ( | ||
<h3 {...props} class="text-2xl"> | ||
{text} | ||
</h3> | ||
); | ||
} | ||
|
||
if (variant === "h4") { | ||
return ( | ||
<h4 {...props} class="text-xl"> | ||
{text} | ||
</h4> | ||
); | ||
} | ||
|
||
if (variant === "h5") { | ||
return ( | ||
<h5 {...props}> | ||
{text} | ||
</h5> | ||
); | ||
} | ||
|
||
if (variant === "h6") { | ||
return ( | ||
<h6 {...props}> | ||
{text} | ||
</h6> | ||
); | ||
} | ||
|
||
return <div></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
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,11 +1,15 @@ | ||
import { defineRoute } from "$fresh/server.ts"; | ||
import { Heading } from "#src/components/Heading.tsx"; | ||
import { PageLayout } from "#src/components/PageLayout.tsx"; | ||
import { MapIsland } from "#src/islands/MapIsland.tsx"; | ||
|
||
export default defineRoute((_req, _ctx) => { | ||
return ( | ||
<PageLayout> | ||
<MapIsland /> | ||
<Heading variant="h1" text={"Map"}></Heading> | ||
<div class="mt-4"> | ||
<MapIsland /> | ||
</div> | ||
</PageLayout> | ||
); | ||
}); |
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
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