Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
j-Cis committed Jun 18, 2024
1 parent 2e4f39b commit 8a92cb6
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 35 deletions.
12 changes: 6 additions & 6 deletions batch/NavApp.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
const NAVIGATION_LINK: NavigationLink[] = [
{
name: "Fresh2 init",
href: "/",
name: "Accordion with nested Accordion",
href: "/accordion/with-nested-accordion",
},
{
name: "Accordion without nested Accordion",
href: "/accordion/without-nested-accordion",
},
{
name: "Accordion with nested Accordion",
href: "/accordion/with-nested-accordion",
},
{
name: "GitHub",
href: "https://github.com/j-Cis/deno-fresh-error-notworking-nested-islands",
},
{
name: "Fresh2 init (example)",
href: "/fresh-2-init",
}
];

interface NavigationLink {
Expand Down
31 changes: 31 additions & 0 deletions routes/fresh-2-init.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { useSignal } from "@preact/signals";
import { asset } from "@fresh/core/runtime";
import define from "$utils/fresh.ts";
import Layout from "$components/Layout.tsx";
import Counter from "$islands/Counter.tsx";

export default define.page(function Home() {
const count = useSignal(3);

return (
<Layout navShow={true} navActive="/" asideShow={false}>
<div class="px-4 py-8 mx-auto fresh-gradient">
<div class="max-w-screen-md mx-auto flex flex-col items-center justify-center">
<img
class="my-6"
src={asset("/svgs/logo.svg")}
width="128"
height="128"
alt="the Fresh logo: a sliced lemon dripping with juice"
/>
<h1 class="text-4xl font-bold">Welcome to Fresh</h1>
<p class="my-4">
Try updating this message in the
<code class="mx-2">./routes/index.tsx</code> file, and refresh.
</p>
<Counter count={count} />
</div>
</div>
</Layout>
);
})
37 changes: 8 additions & 29 deletions routes/index.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,10 @@
import { useSignal } from "@preact/signals";
import { asset } from "@fresh/core/runtime";
import define from "$utils/fresh.ts";
import Layout from "$components/Layout.tsx";
import Counter from "$islands/Counter.tsx";

export default define.page(function Home() {
const count = useSignal(3);

return (
<Layout navShow={true} navActive="/" asideShow={false}>
<div class="px-4 py-8 mx-auto fresh-gradient">
<div class="max-w-screen-md mx-auto flex flex-col items-center justify-center">
<img
class="my-6"
src={asset("/svgs/logo.svg")}
width="128"
height="128"
alt="the Fresh logo: a sliced lemon dripping with juice"
/>
<h1 class="text-4xl font-bold">Welcome to Fresh</h1>
<p class="my-4">
Try updating this message in the
<code class="mx-2">./routes/index.tsx</code> file, and refresh.
</p>
<Counter count={count} />
</div>
</div>
</Layout>
);
})
export const handler = define.handlers({
GET: (ctx) => {
return new Response("", {
status: 307,
headers: { location: `/accordion/with-nested-accordion` },
});
},
});

0 comments on commit 8a92cb6

Please sign in to comment.