2
0

🩹 Fix dark mode bg remaining issues

This commit is contained in:
Baptiste Arnaud
2022-12-22 09:59:50 +01:00
parent 9149af7e6b
commit d1b5b6ebe6
8 changed files with 44 additions and 30 deletions

View File

@@ -23,11 +23,7 @@ export const MakeComSettings = ({ block }: Props) => {
return ( return (
<Stack spacing={4}> <Stack spacing={4}>
<Alert <Alert status={webhook?.url ? 'success' : 'info'} rounded="md">
status={webhook?.url ? 'success' : 'info'}
bgColor={webhook?.url ? undefined : 'blue.50'}
rounded="md"
>
<AlertIcon /> <AlertIcon />
{webhook?.url ? ( {webhook?.url ? (
<>Your scenario is correctly configured 🚀</> <>Your scenario is correctly configured 🚀</>

View File

@@ -155,7 +155,7 @@ export const WebhookSettings = ({
return ( return (
<Stack spacing={4}> <Stack spacing={4}>
{provider && ( {provider && (
<Alert status={'info'} bgColor={'blue.50'} rounded="md"> <Alert status={'info'} rounded="md">
<AlertIcon /> <AlertIcon />
<Stack> <Stack>
<Text>Head up to {provider.name} to configure this block:</Text> <Text>Head up to {provider.name} to configure this block:</Text>

View File

@@ -23,11 +23,7 @@ export const ZapierSettings = ({ block }: Props) => {
return ( return (
<Stack spacing={4}> <Stack spacing={4}>
<Alert <Alert status={webhook?.url ? 'success' : 'info'} rounded="md">
status={webhook?.url ? 'success' : 'info'}
bgColor={webhook?.url ? undefined : 'blue.50'}
rounded="md"
>
<AlertIcon /> <AlertIcon />
{webhook?.url ? ( {webhook?.url ? (
<>Your zap is correctly configured 🚀</> <>Your zap is correctly configured 🚀</>

View File

@@ -13,6 +13,7 @@ import {
PopoverArrow, PopoverArrow,
PopoverBody, PopoverBody,
useEventListener, useEventListener,
useColorModeValue,
} from '@chakra-ui/react' } from '@chakra-ui/react'
import { useTypebot } from '@/features/editor' import { useTypebot } from '@/features/editor'
import { import {
@@ -36,6 +37,7 @@ type Props = {
} }
export const ConditionItemNode = ({ item, isMouseOver, indices }: Props) => { export const ConditionItemNode = ({ item, isMouseOver, indices }: Props) => {
const comparisonValueBg = useColorModeValue('gray.200', 'gray.700')
const { typebot, createItem, updateItem } = useTypebot() const { typebot, createItem, updateItem } = useTypebot()
const { openedItemId, setOpenedItemId } = useGraph() const { openedItemId, setOpenedItemId } = useGraph()
const ref = useRef<HTMLDivElement | null>(null) const ref = useRef<HTMLDivElement | null>(null)
@@ -106,7 +108,7 @@ export const ConditionItemNode = ({ item, isMouseOver, indices }: Props) => {
</Text> </Text>
)} )}
{comparison?.value && ( {comparison?.value && (
<Tag bgColor={'gray.200'}> <Tag bgColor={comparisonValueBg}>
<Text noOfLines={1}>{comparison.value}</Text> <Text noOfLines={1}>{comparison.value}</Text>
</Tag> </Tag>
)} )}

View File

@@ -6,6 +6,7 @@ import {
Flex, Flex,
FlexProps, FlexProps,
useColorMode, useColorMode,
useColorModeValue,
useEventListener, useEventListener,
UseToastOptions, UseToastOptions,
VStack, VStack,
@@ -70,7 +71,7 @@ export const PreviewDrawer = () => {
top={`0`} top={`0`}
h={`100%`} h={`100%`}
w={`${width}px`} w={`${width}px`}
bgColor={isDark ? 'gray.900' : 'white'} bgColor={useColorModeValue('white', 'gray.900')}
borderLeftWidth={'1px'} borderLeftWidth={'1px'}
shadow="lg" shadow="lg"
borderLeftRadius={'lg'} borderLeftRadius={'lg'}
@@ -126,7 +127,7 @@ const ResizeHandle = (props: FlexProps & { isDark: boolean }) => {
w="15px" w="15px"
h="50px" h="50px"
borderWidth={'1px'} borderWidth={'1px'}
bgColor={props.isDark ? 'gray.800' : 'white'} bgColor={useColorModeValue('white', 'gray.800')}
cursor={'col-resize'} cursor={'col-resize'}
justifyContent={'center'} justifyContent={'center'}
align={'center'} align={'center'}
@@ -135,11 +136,15 @@ const ResizeHandle = (props: FlexProps & { isDark: boolean }) => {
> >
<Box <Box
w="2px" w="2px"
bgColor={props.isDark ? 'gray.600' : 'gray.300'} bgColor={useColorModeValue('gray.300', 'gray.600')}
h="70%" h="70%"
mr="0.5" mr="0.5"
/> />
<Box w="2px" bgColor={props.isDark ? 'gray.600' : 'gray.300'} h="70%" /> <Box
w="2px"
bgColor={useColorModeValue('gray.300', 'gray.600')}
h="70%"
/>
</Flex> </Flex>
) )
} }

View File

@@ -3,6 +3,7 @@ import {
EditablePreview, EditablePreview,
EditableInput, EditableInput,
Tooltip, Tooltip,
useColorModeValue,
} from '@chakra-ui/react' } from '@chakra-ui/react'
import React, { useState } from 'react' import React, { useState } from 'react'
@@ -14,6 +15,7 @@ export const EditableTypebotName = ({
defaultName, defaultName,
onNewName, onNewName,
}: EditableProps) => { }: EditableProps) => {
const emptyNameBg = useColorModeValue('gray.100', 'gray.700')
const [currentName, setCurrentName] = useState(defaultName) const [currentName, setCurrentName] = useState(defaultName)
const submitNewName = (newName: string) => { const submitNewName = (newName: string) => {
@@ -39,7 +41,7 @@ export const EditableTypebotName = ({
fontSize="14px" fontSize="14px"
minW="30px" minW="30px"
minH="20px" minH="20px"
bgColor={currentName === '' ? 'gray.100' : 'inherit'} bgColor={currentName === '' ? emptyNameBg : 'inherit'}
/> />
<EditableInput fontSize="14px" /> <EditableInput fontSize="14px" />
</Editable> </Editable>

View File

@@ -1,6 +1,14 @@
import { Box, BoxProps, Flex, Text, VStack } from '@chakra-ui/react' import {
Box,
BoxProps,
Flex,
Text,
useColorModeValue,
VStack,
} from '@chakra-ui/react'
import { GlobeIcon, ToolIcon } from '@/components/icons' import { GlobeIcon, ToolIcon } from '@/components/icons'
import { TypebotInDashboard } from '@/features/dashboard' import { TypebotInDashboard } from '@/features/dashboard'
import { EmojiOrImageIcon } from '@/components/EmojiOrImageIcon'
type Props = { type Props = {
typebot: TypebotInDashboard typebot: TypebotInDashboard
@@ -20,25 +28,19 @@ export const TypebotCardOverlay = ({ typebot, ...props }: Props) => {
pointerEvents="none" pointerEvents="none"
borderWidth={1} borderWidth={1}
rounded="md" rounded="md"
bgColor="white" bgColor={useColorModeValue('white', 'gray.700')}
shadow="lg" shadow="lg"
opacity={0.7} opacity={0.7}
{...props} {...props}
> >
<VStack spacing={4}> <VStack spacing={4}>
<Flex <Flex
boxSize="45px"
rounded="full" rounded="full"
justifyContent="center" justifyContent="center"
alignItems="center" alignItems="center"
bgColor={typebot.publishedTypebotId ? 'blue.500' : 'gray.400'} fontSize={'4xl'}
color="white"
> >
{typebot.publishedTypebotId ? ( <EmojiOrImageIcon icon={typebot.icon} boxSize={'35px'} />
<GlobeIcon fill="white" fontSize="20px" />
) : (
<ToolIcon fill="white" fontSize="20px" />
)}
</Flex> </Flex>
<Text>{typebot.name}</Text> <Text>{typebot.name}</Text>
</VStack> </VStack>

View File

@@ -1,4 +1,11 @@
import { VStack, Tag, Text, Tooltip } from '@chakra-ui/react' import {
VStack,
Tag,
Text,
Tooltip,
useColorModeValue,
theme,
} from '@chakra-ui/react'
import { useGraph, useGroupsCoordinates } from '../../providers' import { useGraph, useGroupsCoordinates } from '../../providers'
import { useTypebot } from '@/features/editor' import { useTypebot } from '@/features/editor'
import { useWorkspace } from '@/features/workspace' import { useWorkspace } from '@/features/workspace'
@@ -23,6 +30,10 @@ export const DropOffEdge = ({
groupId, groupId,
onUnlockProPlanClick, onUnlockProPlanClick,
}: Props) => { }: Props) => {
const dropOffColor = useColorModeValue(
theme.colors.red[500],
theme.colors.red[300]
)
const { workspace } = useWorkspace() const { workspace } = useWorkspace()
const { groupsCoordinates } = useGroupsCoordinates() const { groupsCoordinates } = useGroupsCoordinates()
const { sourceEndpoints, graphPosition } = useGraph() const { sourceEndpoints, graphPosition } = useGraph()
@@ -82,7 +93,7 @@ export const DropOffEdge = ({
{ x: labelCoordinates.x - 300, y: labelCoordinates.y }, { x: labelCoordinates.x - 300, y: labelCoordinates.y },
sourceTop ?? 0 sourceTop ?? 0
)} )}
stroke="#e53e3e" stroke={dropOffColor}
strokeWidth="2px" strokeWidth="2px"
markerEnd="url(#red-arrow)" markerEnd="url(#red-arrow)"
fill="none" fill="none"
@@ -98,7 +109,7 @@ export const DropOffEdge = ({
isDisabled={isWorkspaceProPlan} isDisabled={isWorkspaceProPlan}
> >
<VStack <VStack
bgColor={'red.500'} bgColor={dropOffColor}
color="white" color="white"
rounded="md" rounded="md"
p="2" p="2"