feat: initial commit.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import type { ComponentChildren } from "preact";
|
||||
|
||||
export interface ButtonProps {
|
||||
id?: string;
|
||||
onClick?: () => void;
|
||||
children?: ComponentChildren;
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
export function Button(props: ButtonProps) {
|
||||
return (
|
||||
<button
|
||||
{...props}
|
||||
class="px-2 py-1 border-gray-500 border-2 rounded-sm bg-white hover:bg-gray-200 transition-colors"
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
const links = [
|
||||
{ href: "/", label: "Home" },
|
||||
{ href: "/sign-in", label: "Sign in" },
|
||||
{ href: "/sign-up", label: "Sign up" },
|
||||
{ href: "/dashboard", label: "Dashboard" },
|
||||
];
|
||||
|
||||
export default function Header() {
|
||||
return (
|
||||
<div class="navbar bg-base-100 shadow-sm">
|
||||
<div class="flex-1">
|
||||
<a class="btn btn-ghost text-xl">daisyUI</a>
|
||||
</div>
|
||||
<div class="flex-none">
|
||||
<ul class="menu menu-horizontal px-1">
|
||||
{links.map((l) => (
|
||||
<li key={l.href}>
|
||||
<a href={l.href}>{l.label}</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
export interface Props {
|
||||
email: string;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
export function SignInForm(props: Props) {
|
||||
return (
|
||||
<form method="post" class="flex flex-col gap-4">
|
||||
<input
|
||||
type="email"
|
||||
name="email"
|
||||
class="input w-full"
|
||||
placeholder="E-Mail"
|
||||
autocomplete="email"
|
||||
value={props.email}
|
||||
/>
|
||||
<input
|
||||
type="password"
|
||||
name="password"
|
||||
class="input w-full"
|
||||
placeholder="Password"
|
||||
autocomplete="current-password"
|
||||
/>
|
||||
{props.error && (
|
||||
<div class="alert alert-error">
|
||||
{props.error}
|
||||
</div>
|
||||
)}
|
||||
<button type="submit" class="btn btn-primary self-start">Sign up</button>
|
||||
</form>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user