2
0

💄 (editor) Fix some overflow issues with long variable names

This commit is contained in:
Baptiste Arnaud
2023-03-06 16:56:55 +01:00
parent 26e5d9c282
commit f527df82dd
4 changed files with 38 additions and 36 deletions

View File

@ -12,6 +12,7 @@ import {
PopoverAnchor,
Portal,
Tag,
Text,
} from '@chakra-ui/react'
import { EditIcon, PlusIcon, TrashIcon } from '@/components/icons'
import { useTypebot } from '@/features/editor/providers/TypebotProvider/TypebotProvider'
@ -210,7 +211,9 @@ export const VariableSearchInput = ({
>
Create
<Tag colorScheme="orange" ml="1">
{inputValue}
<Text noOfLines={0} display="block">
{inputValue}
</Text>
</Tag>
</Button>
)}
@ -240,7 +243,10 @@ export const VariableSearchInput = ({
}
transition="none"
>
{item.name}
<Text noOfLines={0} display="block" pr="2">
{item.name}
</Text>
<HStack>
<IconButton
icon={<EditIcon />}

View File

@ -15,7 +15,7 @@ export const WithVariableContent = ({ block }: Props) => {
)?.name
return (
<Text>
<Text w="calc(100% - 25px)">
Collect{' '}
<chakra.span
bgColor="orange.400"

View File

@ -29,9 +29,7 @@ const Cell = ({
py="2"
borderWidth={rowIndex === 0 ? '0 1px 1px 1px' : '1px'}
borderColor={useColorModeValue('gray.200', 'gray.700')}
whiteSpace="nowrap"
wordBreak="normal"
overflow="hidden"
whiteSpace="pre-wrap"
pos="relative"
style={{
minWidth: size,

View File

@ -78,36 +78,34 @@ export const ColumnSettings = ({
return (
<Stack>
<Stack>
<Text fontWeight="semibold" fontSize="sm">
Shown in table:
</Text>
<DndContext
sensors={sensors}
collisionDetection={closestCenter}
onDragStart={handleDragStart}
onDragEnd={handleDragEnd}
<Text fontWeight="semibold" fontSize="sm">
Shown in table:
</Text>
<DndContext
sensors={sensors}
collisionDetection={closestCenter}
onDragStart={handleDragStart}
onDragEnd={handleDragEnd}
>
<SortableContext
items={columnOrder}
strategy={verticalListSortingStrategy}
>
<SortableContext
items={columnOrder}
strategy={verticalListSortingStrategy}
>
{sortedHeader.map((header) => (
<SortableColumns
key={header.id}
header={header}
onEyeClick={onEyeClick}
hiddenHeaders={hiddenHeaders}
/>
))}
</SortableContext>
<Portal>
<DragOverlay dropAnimation={{ duration: 0 }}>
{draggingColumnId ? <Flex /> : null}
</DragOverlay>
</Portal>
</DndContext>
</Stack>
{sortedHeader.map((header) => (
<SortableColumns
key={header.id}
header={header}
onEyeClick={onEyeClick}
hiddenHeaders={hiddenHeaders}
/>
))}
</SortableContext>
<Portal>
<DragOverlay dropAnimation={{ duration: 0 }}>
{draggingColumnId ? <Flex /> : null}
</DragOverlay>
</Portal>
</DndContext>
</Stack>
)
}
@ -147,7 +145,7 @@ const SortableColumns = ({
opacity={isDragging || isHidden ? 0.5 : 1}
{...attributes}
>
<HStack>
<HStack overflow="hidden">
<IconButton
size="sm"
cursor="grab"