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 { StepType, DraggableStepType } from 'models'
import { useStepDnd } from 'contexts/GraphDndContext' import { useStepDnd } from 'contexts/GraphDndContext'
import React, { useEffect, useState } from 'react' import React, { useEffect, useState } from 'react'
@ -8,8 +8,10 @@ import { StepTypeLabel } from './StepTypeLabel'
export const StepCard = ({ export const StepCard = ({
type, type,
onMouseDown, onMouseDown,
isDisabled = false,
}: { }: {
type: DraggableStepType type: DraggableStepType
isDisabled?: boolean
onMouseDown: (e: React.MouseEvent, type: DraggableStepType) => void onMouseDown: (e: React.MouseEvent, type: DraggableStepType) => void
}) => { }) => {
const { draggedStepType } = useStepDnd() const { draggedStepType } = useStepDnd()
@ -22,6 +24,7 @@ export const StepCard = ({
const handleMouseDown = (e: React.MouseEvent) => onMouseDown(e, type) const handleMouseDown = (e: React.MouseEvent) => onMouseDown(e, type)
return ( return (
<Tooltip label="Coming soon!" isDisabled={!isDisabled}>
<Flex pos="relative"> <Flex pos="relative">
<HStack <HStack
borderWidth="1px" borderWidth="1px"
@ -29,13 +32,14 @@ export const StepCard = ({
rounded="lg" rounded="lg"
flex="1" flex="1"
cursor={'grab'} cursor={'grab'}
opacity={isMouseDown ? '0.4' : '1'} opacity={isMouseDown || isDisabled ? '0.4' : '1'}
onMouseDown={handleMouseDown} onMouseDown={handleMouseDown}
bgColor="gray.50" bgColor="gray.50"
px="4" px="4"
py="2" py="2"
_hover={{ shadow: 'md' }} _hover={{ shadow: 'md' }}
transition="box-shadow 200ms" transition="box-shadow 200ms"
pointerEvents={isDisabled ? 'none' : 'auto'}
> >
{!isMouseDown ? ( {!isMouseDown ? (
<> <>
@ -49,6 +53,7 @@ export const StepCard = ({
)} )}
</HStack> </HStack>
</Flex> </Flex>
</Tooltip>
) )
} }

View File

@ -150,7 +150,12 @@ export const StepsSideBar = () => {
</Text> </Text>
<SimpleGrid columns={2} spacing="3"> <SimpleGrid columns={2} spacing="3">
{Object.values(IntegrationStepType).map((type) => ( {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> </SimpleGrid>
</Stack> </Stack>