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

View file

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