Small fixes, Fix lint, Expand dropdown to have correct style and add icon

This commit is contained in:
Hannah dagemark 2026-09-29 12:28:13 +02:00
commit c1d8ff9049
8 changed files with 70 additions and 27 deletions

View file

@ -1,20 +1,28 @@
import Image from "next/image";
import Referencelink from "@/components/ui/Referencelink";
import RoundedContainer from "@/components/ui/RoundedContainer";
import NavLink from "@/components/ui/NavLink";
export default function Hannah() {
return (
<div className="flex h-full w-full justify-center py-10">
<RoundedContainer slim={false}>
<div className="flex w-full flex-row justify-between">
<Referencelink name={"Projects"} link={"/Hannah/Projects"} />
<Referencelink name={"CV"} link={"/Hannah/CV"} />
<NavLink name={"Projects"} link={"/Hannah/Projects"} />
<NavLink name={"CV"} link={"/Hannah/CV"} />
</div>
<div className="flex w-full flex-col space-y-2 py-10">
<h1 className="text-2xl font-bold">Hi!</h1>
<p>{"I'm Hannah, and I made this website! It's currently very much in it's early stages, but I am actively developing it and soon it'll hopefully contain some good examples of what I do. Besides being a place to display my projects, it also acts as a hub for the different services I've incorporated into our home web ecosystem, or HomeLab."}</p>
<p>{"If you came here from a job application, chances are you'll want to take a look at the Projects tab. As said It's still fairly new, but it'll give you a good example of what I put my time into! Just press the \"Projects\" button if you're interested"}</p>
<p>
{
"I'm Hannah, and I made this website! It's currently very much in it's early stages, but I am actively developing it and soon it'll hopefully contain some good examples of what I do. Besides being a place to display my projects, it also acts as a hub for the different services I've incorporated into our home web ecosystem, or HomeLab."
}
</p>
<p>
{
"If you came here from a job application, chances are you'll want to take a look at the Projects tab. As said It's still fairly new, but it'll give you a good example of what I put my time into! Just press the \"Projects\" button if you're interested"
}
</p>
<p>{"In the meantime, here's a picture of my cat :D"}</p>
<Image
src="/Missy.jpg"
@ -26,5 +34,5 @@ export default function Hannah() {
</div>
</RoundedContainer>
</div>
)
);
}

View file

@ -8,7 +8,14 @@ import RoundedContainer from "@/components/ui/RoundedContainer";
export default function Components() {
return (
<div className="flex flex-col items-center gap-4 w-full h-full">
<div className="flex flex-col items-center gap-4 w-full h-full px-10">
<h1>Dropdown</h1>
<Dropdown title="Dropdown" mode="DARK">
<NavLink name="Home" link="/" />
<NavLink name="Admin" link="/Admin" />
<NavLink name="Hannah" link="/Hannah" />
</Dropdown>
<h1>Button</h1>
<Button
title={"Button"}
@ -49,11 +56,6 @@ export default function Components() {
<p>More Contents</p>
</div>
</RoundedContainer>
<h1>Dropdown</h1>
<Dropdown>
<p>Hello!</p>
</Dropdown>
</div>
);
}

View file

@ -1,11 +1,11 @@
import Image from "next/image";
import Image from "next/image";
import RoundedContainer from "@/components/ui/RoundedContainer";
import RoundedContainer from "@/components/ui/RoundedContainer";
export default function Home() {
return (
<main className="flex items-center justify-center w-full bg-zinc-200 font-sans dark:bg-slate-800">
<RoundedContainer>
<RoundedContainer slim={false}>
<Image
className="dark:invert"
src="/next.svg"
@ -19,7 +19,8 @@ export default function Home() {
Welcome to the Dagemark Server
</h1>
<p className="max-w-md text-lg leading-8 text-zinc-600 dark:text-zinc-400 italic">
Design In Progress, current layout and theme may change, have a good day :D
Design In Progress, current layout and theme may change, have a good
day :D
</p>
</div>
</RoundedContainer>

View file

@ -1,21 +1,25 @@
import { ComponentProps } from "react";
import React from "react";
type ButtonProps = ComponentProps<"button"> & {
title: string;
mode?: "DARK" | "LIGHT";
icon?: React.ReactElement;
};
export default function Button({
title,
mode = "LIGHT",
icon,
...props
}: ButtonProps) {
return (
<button
{...props}
className={`${mode == "LIGHT" ? "bg-slate-400 dark:bg-slate-800 border-slate-800 hover:bg-slate-500" : "bg-gray-400 dark:bg-slate-900 dark:border-slate-900 border-slate-400 hover:bg-slate-600"} border-4 border-double cursor-pointer font-medium py-2 px-4 rounded-lg shadow-md transition duration-200 ease-in-out`}
className={`${mode == "LIGHT" ? "bg-slate-400 dark:bg-slate-800 border-slate-800 hover:bg-slate-500" : "bg-gray-400 dark:bg-slate-900 dark:border-slate-900 border-slate-400 hover:bg-slate-600"} flex flex-row items-center border-4 border-double cursor-pointer font-medium py-2 px-4 rounded-lg shadow-md transition duration-200 ease-in-out`}
>
{title}
{icon}
</button>
);
}

View file

@ -1,19 +1,47 @@
import { useState } from "react";
import Button from "./Button";
import React from "react";
import { ArrowRightIcon } from "@heroicons/react/24/outline";
export default function Dropdown({ children }: { children: React.ReactNode }) {
import Button from "./Button";
import RoundedContainer from "./RoundedContainer";
export default function Dropdown({
title,
mode,
children,
}: {
title?: string;
mode?: "DARK" | "LIGHT";
children: React.ReactNode;
}) {
const [dropped, setDropped] = useState<boolean>(false);
const [degrees, setDegrees] = useState<number>(0);
return (
<div>
<Button
title="Drop down"
mode="DARK"
title={title ? title : ""}
mode={mode}
onClick={() => {
setDropped(!dropped);
if (degrees < 90) {
setDegrees(90);
} else {
setDegrees(0);
}
}}
></Button>
{dropped && <div>{children}</div>}
icon={
<ArrowRightIcon
className={`size-4 transition-transform rotate-${degrees}`}
/>
}
/>
<RoundedContainer
slim={true}
className={`${!dropped && "invisible"} absolute z-10 flex flex-col gap-2 transition-discrete duration-150 ease-out`}
>
{children}
</RoundedContainer>
</div>
);
}

View file

@ -18,7 +18,7 @@ export default function Form({
<form action={action}>
<RoundedContainer slim={false}>
{children}
<Button title={submitText} type="submit"></Button>
<Button title={submitText} type="submit" />
</RoundedContainer>
</form>
</div>

View file

@ -4,14 +4,16 @@ export default function RoundedContainer({
children,
slim = true,
direction = "column",
className,
}: {
children: React.ReactNode;
slim?: boolean;
direction?: "column" | "row";
className?: string;
}) {
return (
<div
className={`flex ${slim ? "max-w-6xl" : "max-w-3xl"} rounded-4xl ${direction == "column" ? "flex-col" : "flex-row"} items-center py-8 px-8 bg-gray-400 dark:bg-slate-900 sm:items-start`}
className={`flex ${slim ? "max-w-6xl py-3 px-3" : "max-w-3xl py-6 px-6"} rounded-2xl ${direction == "column" ? "flex-col" : "flex-row"} items-center bg-gray-400 dark:bg-slate-900 sm:items-start ${className}`}
>
{children}
</div>

View file

@ -1,7 +1,5 @@
import { RequestInit } from "next/dist/server/web/spec-extension/request";
import logger from "../logging/logger";
const FRONTEND_URL = process.env.NEXT_PUBLIC_FRONTEND_URL;
export async function cmFetch<T>(