old.martials.no/src/index.tsx

50 lines
1.4 KiB
TypeScript
Raw Normal View History

2022-12-04 17:51:05 +01:00
/* @refresh reload */
2022-12-21 13:56:42 +01:00
import { For, render } from "solid-js/web";
2022-12-04 17:51:05 +01:00
import "./index.css";
import { type Component } from "solid-js";
import Layout from "./components/layout";
2022-12-21 13:56:42 +01:00
import Card from "./components/card";
import type { CardProps } from "./types/interfaces";
import { Link } from "./components/link";
const apiRoot = "https://api.martials.no";
2022-12-21 13:56:42 +01:00
const cards = [
{
title: "API-er",
children: <>
<p>Sjekk ut mine API-er</p>
<ul>
<li>
2022-12-30 18:45:50 +01:00
<Link className={ "text-white" } to={ `${ apiRoot }/simplify-truths` }>
Forenkle sannhetsverdier
</Link>
</li>
</ul>
</>,
to: apiRoot,
2022-12-21 13:56:42 +01:00
},
{
title: "Hjemmeside",
children: <p>Sjekk ut mine andre prosjekter</p>,
to: "https://h600878.github.io/",
}
] satisfies CardProps[];
2022-12-04 17:51:05 +01:00
const HomePage: Component = () => {
return (
2022-12-21 13:56:42 +01:00
<Layout title={ "Velkommen!" }>
<div class={ "flex flex-wrap justify-center mt-10" }>
2022-12-21 13:56:42 +01:00
<For each={ cards }>
{ card =>
<Card title={ card.title } className={ "m-4" } to={ card.to }>{ card.children }</Card>
2022-12-21 13:56:42 +01:00
}
</For>
</div>
</Layout>
2022-12-04 17:51:05 +01:00
);
};
render(() => <HomePage />, document.getElementById("root") as HTMLElement);