major: import Fresh 2.0 code (#2449)

🎉
This commit is contained in:
Marvin Hagemeister
2024-05-24 09:40:08 +02:00
committed by GitHub
parent 990357629e
commit 287929e4d2
958 changed files with 15794 additions and 28287 deletions
+11 -15
View File
@@ -1,26 +1,22 @@
import { PageSection } from "$fresh/www/components/PageSection.tsx";
import { DemoBox } from "$fresh/www/components/homepage/DemoBox.tsx";
import { Head } from "$fresh/runtime.ts";
import { Handlers, PageProps } from "$fresh/server.ts";
import { PageSection } from "../components/PageSection.tsx";
import { DemoBox } from "../components/homepage/DemoBox.tsx";
import { df } from "../utils/state.ts";
export const handler: Handlers = {
GET(req, ctx) {
const url = new URL(req.url);
export const handler = df.defineHandlers({
GET(ctx) {
const url = new URL(ctx.req.url);
const search = new URLSearchParams(url.search);
const vote = search.get("vote");
return ctx.render({ vote });
return { data: { vote } };
},
};
});
export default function ThanksForSubscribing(
props: PageProps & { vote?: string },
export default df.definePage<typeof handler>(function ThanksForSubscribing(
props,
) {
const vote = props?.data?.vote ? props.data.vote.replaceAll(/-/g, " ") : null;
return (
<>
<Head>
<meta name="robots" content="noindex" />
</Head>
<PageSection>
<DemoBox>
<div class="space-y-2">
@@ -67,4 +63,4 @@ export default function ThanksForSubscribing(
</PageSection>
</>
);
}
});