Skip to content

Commit ff08171

Browse files
authored
fix(deploy): fix button (#1949)
1 parent 36bcd75 commit ff08171

File tree

1 file changed

+9
-25
lines changed
  • apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel-new/components/deploy

1 file changed

+9
-25
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel-new/components/deploy/deploy.tsx

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import { useCallback, useState } from 'react'
44
import { Loader2 } from 'lucide-react'
55
import { Button, Rocket, Tooltip } from '@/components/emcn'
6-
import { cn } from '@/lib/utils'
76
import { DeployModal } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/control-bar/components'
87
import { useCurrentWorkflow } from '@/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-current-workflow'
98
import type { WorkspaceUserPermissions } from '@/hooks/use-user-permissions'
@@ -101,40 +100,25 @@ export function Deploy({ activeWorkflowId, userPermissions, className }: DeployP
101100
return 'Deploy workflow'
102101
}
103102

104-
const buttonContent = (
105-
<>
106-
{isDeploying ? (
107-
<Loader2 className='h-[13px] w-[13px] animate-spin' />
108-
) : (
109-
<Rocket className='h-[13px] w-[13px]' />
110-
)}
111-
{changeDetected ? 'Update' : isDeployed ? 'Active' : 'Deploy'}
112-
</>
113-
)
114-
115103
return (
116104
<>
117105
<Tooltip.Root>
118106
<Tooltip.Trigger asChild>
119-
{isDisabled ? (
120-
<div
121-
className={cn(
122-
'inline-flex h-[32px] items-center justify-center gap-[8px] px-[10px]',
123-
'rounded-md border border-input bg-background font-medium text-sm opacity-50',
124-
'shadow-sm transition-colors'
125-
)}
126-
>
127-
{buttonContent}
128-
</div>
129-
) : (
107+
<span>
130108
<Button
131109
className='h-[32px] gap-[8px] px-[10px]'
132110
variant='active'
133111
onClick={onDeployClick}
112+
disabled={isDisabled}
134113
>
135-
{buttonContent}
114+
{isDeploying ? (
115+
<Loader2 className='h-[13px] w-[13px] animate-spin' />
116+
) : (
117+
<Rocket className='h-[13px] w-[13px]' />
118+
)}
119+
{changeDetected ? 'Update' : isDeployed ? 'Active' : 'Deploy'}
136120
</Button>
137-
)}
121+
</span>
138122
</Tooltip.Trigger>
139123
<Tooltip.Content>{getTooltipText()}</Tooltip.Content>
140124
</Tooltip.Root>

0 commit comments

Comments
 (0)