noot
This commit is contained in:
parent
676766dbed
commit
71d93ee921
|
@ -1,12 +0,0 @@
|
||||||
import { JSX } from "preact";
|
|
||||||
import { IS_BROWSER } from "$fresh/runtime.ts";
|
|
||||||
|
|
||||||
export function Button(props: JSX.HTMLAttributes<HTMLButtonElement>) {
|
|
||||||
return (
|
|
||||||
<button
|
|
||||||
{...props}
|
|
||||||
disabled={!IS_BROWSER || props.disabled}
|
|
||||||
class="px-2 py-1 border-gray-500 border-2 rounded bg-white hover:bg-gray-200 transition-colors"
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
|
@ -6,7 +6,6 @@ import * as $_page_ts_index from "./routes/[page].ts/index.tsx";
|
||||||
import * as $_404 from "./routes/_404.tsx";
|
import * as $_404 from "./routes/_404.tsx";
|
||||||
import * as $_app from "./routes/_app.tsx";
|
import * as $_app from "./routes/_app.tsx";
|
||||||
import * as $index from "./routes/index.tsx";
|
import * as $index from "./routes/index.tsx";
|
||||||
import * as $Counter from "./islands/Counter.tsx";
|
|
||||||
import * as $MagicPage from "./islands/MagicPage.tsx";
|
import * as $MagicPage from "./islands/MagicPage.tsx";
|
||||||
import type { Manifest } from "$fresh/server.ts";
|
import type { Manifest } from "$fresh/server.ts";
|
||||||
|
|
||||||
|
@ -18,7 +17,6 @@ const manifest = {
|
||||||
"./routes/index.tsx": $index,
|
"./routes/index.tsx": $index,
|
||||||
},
|
},
|
||||||
islands: {
|
islands: {
|
||||||
"./islands/Counter.tsx": $Counter,
|
|
||||||
"./islands/MagicPage.tsx": $MagicPage,
|
"./islands/MagicPage.tsx": $MagicPage,
|
||||||
},
|
},
|
||||||
baseUrl: import.meta.url,
|
baseUrl: import.meta.url,
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
import type { Signal } from "@preact/signals";
|
|
||||||
import { Button } from "../components/Button.tsx";
|
|
||||||
|
|
||||||
interface CounterProps {
|
|
||||||
count: Signal<number>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function Counter(props: CounterProps) {
|
|
||||||
return (
|
|
||||||
<div class="flex gap-8 py-6">
|
|
||||||
<Button onClick={() => props.count.value -= 1}>-1</Button>
|
|
||||||
<p class="text-3xl tabular-nums">{props.count}</p>
|
|
||||||
<Button onClick={() => props.count.value += 1}>+1</Button>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
Loading…
Reference in New Issue