WIP
This commit is contained in:
parent
fc772c62f9
commit
6bff215d4f
13
components/TodoList.tsx
Normal file
13
components/TodoList.tsx
Normal file
|
@ -0,0 +1,13 @@
|
|||
import { Todo, User } from '$models'
|
||||
|
||||
export interface Props {
|
||||
user: User
|
||||
}
|
||||
|
||||
export function TodoList({ user }: Props) {
|
||||
return (
|
||||
<div>
|
||||
<h1>Todo List for {user}</h1>
|
||||
</div>
|
||||
)
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
import { Handlers, PageProps } from '$fresh/server.ts'
|
||||
import { useSignal } from '@preact/signals'
|
||||
import Counter from '../islands/Counter.tsx'
|
||||
import { db, Todo, User } from '$models'
|
||||
import { TodoList } from '../components/TodoList.tsx'
|
||||
|
||||
interface Data {
|
||||
users: User[]
|
||||
|
@ -18,24 +18,14 @@ export const handler: Handlers = {
|
|||
},
|
||||
}
|
||||
|
||||
export default function Home(props: PageProps<Data>) {
|
||||
export default function Home(
|
||||
{ data: { users, unassignedTodos } }: PageProps<Data>,
|
||||
) {
|
||||
const count = useSignal(3)
|
||||
return (
|
||||
<div class='px-4 py-8 mx-auto bg-emerald-950'>
|
||||
<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} />
|
||||
{users.map((u) => <TodoList user={u} />)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue