feat: better index css
This commit is contained in:
parent
e6d7020fc8
commit
fae9cc8154
@ -1,25 +1,21 @@
|
||||
import { Head } from "$fresh/runtime.ts";
|
||||
import { useSignal } from "@preact/signals";
|
||||
import {Button} from "../components/Button.tsx";
|
||||
import { PageDescription, get_pages_meta } from "../pages.ts";
|
||||
import { get_pages_meta, PageDescription } from "../pages.ts";
|
||||
import { Handlers, PageProps } from "$fresh/server.ts";
|
||||
|
||||
export const handler: Handlers = {
|
||||
async GET(_req, ctx){
|
||||
const [pages,_] = await get_pages_meta();
|
||||
async GET(_req, ctx) {
|
||||
const [pages, _] = await get_pages_meta();
|
||||
return await ctx.render(pages);
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default function Home({data}: PageProps<PageDescription[]>) {
|
||||
const count = useSignal(3);
|
||||
|
||||
export default function Home({ data }: PageProps<PageDescription[]>) {
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>stock-front</title>
|
||||
</Head>
|
||||
<div class="px-4 py-8 mx-auto bg-[#86efac]">
|
||||
<div class="px-4 py-8 mx-auto bg-[#86efac] min-h-screen">
|
||||
<div class="max-w-screen-md mx-auto flex flex-col items-center justify-center">
|
||||
<img
|
||||
class="my-6"
|
||||
@ -31,14 +27,16 @@ export default function Home({data}: PageProps<PageDescription[]>) {
|
||||
<h1 class="text-4xl font-bold">Stock</h1>
|
||||
<div class="my-4">
|
||||
<ul>
|
||||
{
|
||||
data.map(x=><li class="my-2">
|
||||
<a class="p-2 block hover:bg-gray-300 bg-white rounded" href={`/pages/${encodeURIComponent(x.name)}`}>
|
||||
{data.map((x) => (
|
||||
<li class="my-2">
|
||||
<a
|
||||
class="p-2 block hover:bg-gray-300 bg-white rounded"
|
||||
href={`/pages/${encodeURIComponent(x.name)}`}
|
||||
>
|
||||
{x.name}
|
||||
</a>
|
||||
</li>
|
||||
)
|
||||
}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user