2
0

🛂 Temporarily disable Make.com

This commit is contained in:
Baptiste Arnaud
2022-04-29 19:13:34 -07:00
parent 7b4dc47f11
commit cff5ec67de
2 changed files with 39 additions and 29 deletions

View File

@ -1,4 +1,4 @@
import { Flex, HStack, StackProps, Text } from '@chakra-ui/react'
import { Flex, HStack, StackProps, Text, Tooltip } from '@chakra-ui/react'
import { StepType, DraggableStepType } from 'models'
import { useStepDnd } from 'contexts/GraphDndContext'
import React, { useEffect, useState } from 'react'
@ -8,8 +8,10 @@ import { StepTypeLabel } from './StepTypeLabel'
export const StepCard = ({
type,
onMouseDown,
isDisabled = false,
}: {
type: DraggableStepType
isDisabled?: boolean
onMouseDown: (e: React.MouseEvent, type: DraggableStepType) => void
}) => {
const { draggedStepType } = useStepDnd()
@ -22,33 +24,36 @@ export const StepCard = ({
const handleMouseDown = (e: React.MouseEvent) => onMouseDown(e, type)
return (
<Flex pos="relative">
<HStack
borderWidth="1px"
borderColor="gray.200"
rounded="lg"
flex="1"
cursor={'grab'}
opacity={isMouseDown ? '0.4' : '1'}
onMouseDown={handleMouseDown}
bgColor="gray.50"
px="4"
py="2"
_hover={{ shadow: 'md' }}
transition="box-shadow 200ms"
>
{!isMouseDown ? (
<>
<StepIcon type={type} />
<StepTypeLabel type={type} />
</>
) : (
<Text color="white" userSelect="none">
Placeholder
</Text>
)}
</HStack>
</Flex>
<Tooltip label="Coming soon!" isDisabled={!isDisabled}>
<Flex pos="relative">
<HStack
borderWidth="1px"
borderColor="gray.200"
rounded="lg"
flex="1"
cursor={'grab'}
opacity={isMouseDown || isDisabled ? '0.4' : '1'}
onMouseDown={handleMouseDown}
bgColor="gray.50"
px="4"
py="2"
_hover={{ shadow: 'md' }}
transition="box-shadow 200ms"
pointerEvents={isDisabled ? 'none' : 'auto'}
>
{!isMouseDown ? (
<>
<StepIcon type={type} />
<StepTypeLabel type={type} />
</>
) : (
<Text color="white" userSelect="none">
Placeholder
</Text>
)}
</HStack>
</Flex>
</Tooltip>
)
}

View File

@ -150,7 +150,12 @@ export const StepsSideBar = () => {
</Text>
<SimpleGrid columns={2} spacing="3">
{Object.values(IntegrationStepType).map((type) => (
<StepCard key={type} type={type} onMouseDown={handleMouseDown} />
<StepCard
key={type}
type={type}
onMouseDown={handleMouseDown}
isDisabled={type === IntegrationStepType.MAKE_COM}
/>
))}
</SimpleGrid>
</Stack>