Added link to simplify truths page, and backlink to home

This commit is contained in:
Martin Berg Alstad 2023-01-18 22:09:18 +01:00
parent a93e082765
commit 1ddbe435b1
5 changed files with 23 additions and 6 deletions

View File

@ -7,7 +7,6 @@ const Footer: Component<SimpleProps> = ({ className }) => {
return (
<footer class={ `text-center py-5 absolute bottom-0 container ${ className }` }>
<p>Kildekode <Link to={ "https://github.com/h600878/martials.no" }>GitHub</Link></p>
<p>Self-hosted on Raspberry Pi 4</p>
</footer>
);
};

View File

@ -1,13 +1,24 @@
/* @refresh reload */
import { type Component } from "solid-js";
import { type Component, Show } from "solid-js";
import type { TitleProps } from "../types/interfaces";
import { Icon } from "solid-heroicons";
import { chevronLeft } from "solid-heroicons/solid";
import { Link } from "./link";
const Header: Component<TitleProps> = ({ className, title }) => {
return (
<header class={ className }>
<h1 class={ "text-center text-cyan-500" }>{ title }</h1>
<div class={"mx-auto w-fit"}>
<div class={ "flex-row-center mx-auto w-fit" }>
<Show when={ typeof location !== "undefined" && location.pathname !== "/" } keyed>
<Link to={ "/" } newTab={ false } title={ "Back to homepage" }>
<Icon path={ chevronLeft } class={ "text-cyan-500" } />
</Link>
</Show>
<h1 class={ "text-center text-cyan-500" }>{ title }</h1>
</div>
<div class={ "mx-auto w-fit" }>
<p>Av Martin Berg Alstad</p>
</div>
</header>

View File

@ -10,9 +10,10 @@ export const Link: Component<LinkProps> = (
className,
id,
newTab = true,
title,
}) => {
return (
<a href={ to } id={ id }
<a href={ to } id={ id } title={ title }
rel={ `${ rel } ${ newTab ? "noreferrer" : undefined }` }
target={ newTab ? "_blank" : undefined }
class={ `link ${ className }` }>

View File

@ -29,6 +29,11 @@ const cards = [
title: "Hjemmeside",
children: <p>Sjekk ut mine andre prosjekter</p>,
to: "https://h600878.github.io/",
},
{
title: "Forenkle sannhetsverdier",
children: <p>Implementering av API</p>,
to: `/simplify-truths.html`,
}
] satisfies CardProps[];

View File

@ -5,6 +5,7 @@ export interface SimpleProps {
className?: string,
style?: JSX.CSSProperties,
id?: string,
title?: string,
}
export interface ChildProps extends SimpleProps {