Fix incorrect overflow

This commit is contained in:
Daniel Flanagan 2024-01-07 16:42:03 -06:00
parent e96b1b8eae
commit 324469259d
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
2 changed files with 11 additions and 6 deletions

View file

@ -9,18 +9,19 @@ export function TodoList(
{ user: { avatarUrl, assignedTodos, name, color } }: Props,
) {
const todoItem = (
{ classList, description }: Pick<Todo, 'description'> & {
classList?: string
{ className, description, hideDone }: Pick<Todo, 'description'> & {
className?: string
hideDone?: boolean
},
) => (
<li
style={`border-color: #${color}`}
class={`${
classList || ''
className || ''
} border-l-4 p-4 rounded drop-shadow-lg bg-white dark:bg-stone-900 flex flex-col`}
>
<span class='text-xl'>{description}</span>
<Button class='mt-2'>Done</Button>
{hideDone ? '' : <Button class='mt-2'>Done</Button>}
</li>
)
return (
@ -38,7 +39,11 @@ export function TodoList(
</button>
<ul class='flex flex-col gap-y-4'>
{assignedTodos.length < 1
? todoItem({ description: 'All clear! 🎉', classList: 'text-center' })
? todoItem({
description: 'All clear! 🎉',
className: 'text-center',
hideDone: true,
})
: assignedTodos.map(todoItem)}
</ul>
</div>

View file

@ -37,7 +37,7 @@ export default function Home(
<h1 class='p-5 border-b-2 border-stone-500/20 text-2xl'>
Todos
</h1>
<ul class='p-4 relative flex'>
<ul class='p-4 relative flex overflow-x-scroll max-w-screen'>
<li>
<TodoList user={unassignedUser} />
</li>