-
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 #9 from nyaomaru/deno-study-7
stydy: add test, change source directory, and refactor
- Loading branch information
Showing
44 changed files
with
346 additions
and
231 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,22 @@ | ||
import { JSX } from "preact"; | ||
import { IS_BROWSER } from "$fresh/runtime.ts"; | ||
|
||
type ButtonProps = { | ||
color?: "primary" | "secondary"; | ||
} & JSX.HTMLAttributes<HTMLButtonElement>; | ||
|
||
export function Button( | ||
{ color = "primary", ...props }: ButtonProps, | ||
) { | ||
return ( | ||
<button | ||
{...props} | ||
disabled={!IS_BROWSER || props.disabled} | ||
class={`px-2 py-1 border-2 rounded ${ | ||
color === "primary" | ||
? "bg-black text-white hover:text-black" | ||
: "bg-white border-gray-500" | ||
} hover:bg-gray-200 transition-colors`} | ||
/> | ||
); | ||
} |
File renamed without changes.
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,20 @@ | ||
type LinkProps = { | ||
text: string; | ||
href: string; | ||
color?: "primary" | "secondary"; | ||
}; | ||
|
||
export function Link({ color = "primary", ...props }: LinkProps) { | ||
return ( | ||
<a class="mx-2" href={props.href}> | ||
<span | ||
class={`align-middle select-none font-sans font-bold text-center uppercase transition-all disabled:opacity-50 disabled:shadow-none disabled:pointer-events-none text-xs py-3 px-6 rounded-lg ${ | ||
color === "primary" ? "bg-gray-900 text-white" : "bg-white text-black" | ||
} shadow-md shadow-gray-900/10 hover:shadow-lg hover:shadow-gray-900/20 focus:opacity-[0.85] focus:shadow-none active:opacity-[0.85] active:shadow-none`} | ||
type="button" | ||
> | ||
{props.text} | ||
</span> | ||
</a> | ||
); | ||
} |
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,8 @@ | ||
#!/usr/bin/env -S deno run -A --watch=static/,routes/ | ||
|
||
import dev from "$fresh/dev.ts"; | ||
import config from "./fresh.config.ts"; | ||
|
||
import "$std/dotenv/load.ts"; | ||
|
||
await dev(import.meta.url, "./main.ts", config); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,37 @@ | ||
import { type PageProps } from "$fresh/server.ts"; | ||
export default function App({ Component }: PageProps) { | ||
return ( | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="author" content="nyaomaru" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<meta | ||
name="description" | ||
content="This fresh sample brought to you by nyaomaru" | ||
/> | ||
<meta name="og:title" content="nyaomaru-deno-sample" /> | ||
<meta property="og:locale" content="ja_JP" key="ogLocale" /> | ||
<meta | ||
property="og:site_name" | ||
content="nyaomaru-deno-sample" | ||
key="ogSiteName" | ||
/> | ||
<meta | ||
name="og:description" | ||
content="This fresh sample brought to you by nyaomaru" | ||
/> | ||
<meta property="og:type" content="website" key="ogType" /> | ||
<meta | ||
name="apple-mobile-web-app-title" | ||
content="nyaomaru-deno-sample" | ||
/> | ||
<title>nyaomaru-deno-sample</title> | ||
<link rel="stylesheet" href="/styles.css" /> | ||
</head> | ||
<body> | ||
<Component /> | ||
</body> | ||
</html> | ||
); | ||
} |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.