This commit is contained in:
Daniel Flanagan 2024-08-23 23:39:15 -05:00
parent c83d31f6ae
commit 1a3c11ebf0
2 changed files with 42 additions and 21 deletions

View file

@ -5,10 +5,10 @@ export default function App({ Component }: PageProps) {
<head>
<meta charset='utf-8' />
<meta name='viewport' content='width=device-width, initial-scale=1.0' />
<title>bank</title>
<title>Bank</title>
<link rel='stylesheet' href='/styles.css' />
</head>
<body class='bg-bg text-text'>
<body class='bg-bg text-text min-w-full min-h-dvh'>
<Component />
</body>
</html>

View file

@ -1,25 +1,46 @@
import { useSignal } from '@preact/signals'
import Counter from '../islands/Counter.tsx'
import { VNode } from 'https://esm.sh/v128/preact@10.19.6/src/index.js'
import { JSX } from 'preact'
interface Budget {
name: string
target: number
buffer?: number
}
interface IconButtonProps {
text: string
icon: string
}
function IconButton(
{ icon, text, ...props }:
& IconButtonProps
& JSX.HTMLAttributes<HTMLAnchorElement>,
) {
return (
<a
href='#'
class='p-2 flex flex-col flex-1 bg-bg justify-center items-center text-center'
{...props}
>
<i>{icon}</i>
<span>{text}</span>
</a>
)
}
export default function Home() {
const count = useSignal(3)
return (
<div class='px-4 py-8 mx-auto'>
<div class='max-w-screen-md mx-auto flex flex-col items-center justify-center'>
<img
class='my-6'
src='/logo.svg'
width='128'
height='128'
alt='the Fresh logo: a sliced lemon dripping with juice'
/>
<h1 class='text-4xl font-bold'>Welcome to Fresh</h1>
<p class='my-4'>
Try updating this message in the
<code class='mx-2'>./routes/index.tsx</code> file, and refresh.
</p>
<Counter count={count} />
</div>
<div class='flex flex-col sm:flex-row min-h-full'>
<main class='p-2'>
This is the main content
</main>
<nav class='w-full mt-auto sm:ml-auto flex flex-1 bg-mantle gap-1 p-1'>
<IconButton text='Some Text' icon='Some Icon' />
<IconButton text='Some Text' icon='Some Icon' />
<IconButton text='Some Text' icon='Some Icon' />
</nav>
</div>
)
}