Skip to content

Commit 124fe17

Browse files
authored
improvement(toast): widen error toasts and bump line-clamp to 3 (#4370)
1 parent dafeaaa commit 124fe17

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

  • apps/sim/components/emcn/components/toast

apps/sim/components/emcn/components/toast/toast.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ function ToastItem({ toast: t, onDismiss }: { toast: ToastData; onDismiss: (id:
169169
onMouseEnter={hasDuration ? handleMouseEnter : undefined}
170170
onMouseLeave={hasDuration ? handleMouseLeave : undefined}
171171
className={cn(
172-
'pointer-events-auto flex w-[min(100vw-2rem,320px)] flex-col gap-2 overflow-hidden rounded-lg border px-3 py-2.5 shadow-md transition-[transform,opacity]',
172+
'pointer-events-auto flex flex-col gap-2 overflow-hidden rounded-lg border px-3 py-2.5 shadow-md transition-[transform,opacity]',
173+
t.variant === 'error' ? 'w-[min(100vw-2rem,400px)]' : 'w-[min(100vw-2rem,320px)]',
173174
VARIANT_STYLES[t.variant],
174175
exiting
175176
? 'animate-[toast-exit_200ms_ease-in_forwards] motion-reduce:animate-none'
@@ -178,7 +179,12 @@ function ToastItem({ toast: t, onDismiss }: { toast: ToastData; onDismiss: (id:
178179
>
179180
<div className='flex items-start gap-2'>
180181
<div className='min-w-0 flex-1'>
181-
<div className='line-clamp-2 font-medium text-[var(--text-body)] text-small leading-[18px]'>
182+
<div
183+
className={cn(
184+
'font-medium text-[var(--text-body)] text-small leading-[18px]',
185+
t.variant === 'error' ? 'line-clamp-3' : 'line-clamp-2'
186+
)}
187+
>
182188
{t.variant === 'error' && (
183189
<span className='mr-2 mb-0.5 inline-block h-2 w-2 rounded-[2px] bg-[var(--text-error)] align-middle' />
184190
)}

0 commit comments

Comments
 (0)