Skip to content

Commit dba7514

Browse files
authored
improvement(schedule): fix UI bug with schedule modal (#1722)
1 parent e94de1d commit dba7514

File tree

1 file changed

+28
-9
lines changed
  • apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/components/sub-block/components/schedule/components

1 file changed

+28
-9
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/components/sub-block/components/schedule/components/schedule-modal.tsx

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,11 @@ export function ScheduleModal({
318318

319319
return (
320320
<>
321-
<DialogContent className='flex flex-col gap-0 p-0 sm:max-w-[600px]' hideCloseButton>
321+
<DialogContent
322+
className='flex max-h-[90vh] flex-col gap-0 overflow-hidden p-0 sm:max-w-[600px]'
323+
hideCloseButton
324+
onOpenAutoFocus={(e) => e.preventDefault()}
325+
>
322326
<DialogHeader className='border-b px-6 py-4'>
323327
<div className='flex items-center justify-between'>
324328
<DialogTitle className='font-medium text-lg'>Schedule Configuration</DialogTitle>
@@ -329,7 +333,7 @@ export function ScheduleModal({
329333
</div>
330334
</DialogHeader>
331335

332-
<div className='overflow-y-auto px-6 pt-4 pb-6'>
336+
<div className='flex-1 overflow-y-auto px-6 py-6'>
333337
{errorMessage && (
334338
<Alert variant='destructive' className='mb-4'>
335339
<AlertDescription>{errorMessage}</AlertDescription>
@@ -548,7 +552,7 @@ export function ScheduleModal({
548552
</div>
549553
</div>
550554

551-
<DialogFooter className='w-full px-6 pt-0 pb-6'>
555+
<DialogFooter className='border-t px-6 py-4'>
552556
<div className='flex w-full justify-between'>
553557
<div>
554558
{scheduleId && onDelete && (
@@ -558,23 +562,38 @@ export function ScheduleModal({
558562
onClick={openDeleteConfirm}
559563
disabled={isDeleting || isSaving}
560564
size='default'
561-
className='h-10'
565+
className='h-9 rounded-[8px]'
562566
>
563-
<Trash2 className='mr-2 h-4 w-4' />
564-
{isDeleting ? 'Deleting...' : 'Delete Schedule'}
567+
{isDeleting ? (
568+
<div className='mr-2 h-4 w-4 animate-spin rounded-full border-[1.5px] border-current border-t-transparent' />
569+
) : (
570+
<Trash2 className='mr-2 h-4 w-4' />
571+
)}
572+
{isDeleting ? 'Deleting...' : 'Delete'}
565573
</Button>
566574
)}
567575
</div>
568576
<div className='flex gap-2'>
569-
<Button variant='outline' onClick={handleClose} size='default' className='h-10'>
577+
<Button
578+
variant='outline'
579+
onClick={handleClose}
580+
size='default'
581+
className='h-9 rounded-[8px]'
582+
>
570583
Cancel
571584
</Button>
572585
<Button
573586
onClick={handleSave}
574587
disabled={!hasChanges || isSaving}
575-
className={cn('h-10', hasChanges ? 'bg-primary hover:bg-primary/90' : '')}
576-
size='default'
588+
className={cn(
589+
'w-[140px] rounded-[8px]',
590+
hasChanges ? 'bg-primary hover:bg-primary/90' : ''
591+
)}
592+
size='sm'
577593
>
594+
{isSaving && (
595+
<div className='h-4 w-4 animate-spin rounded-full border-[1.5px] border-current border-t-transparent' />
596+
)}
578597
{isSaving ? 'Saving...' : 'Save Changes'}
579598
</Button>
580599
</div>

0 commit comments

Comments
 (0)