2
0

feat(editor): ️ Show Google Sheets detail

This commit is contained in:
Baptiste Arnaud
2022-04-11 12:59:00 -05:00
parent 18206866b8
commit 4a2c6627c3
6 changed files with 44 additions and 53 deletions

View File

@ -1,5 +1,6 @@
import {
Button,
chakra,
Menu,
MenuButton,
MenuButtonProps,
@ -29,38 +30,37 @@ export const DropdownList = <T,>({
onItemSelect(operator)
}
return (
<>
<Menu isLazy placement="bottom-end" matchWidth>
<MenuButton
as={Button}
rightIcon={<ChevronLeftIcon transform={'rotate(-90deg)'} />}
colorScheme="gray"
isTruncated
justifyContent="space-between"
textAlign="left"
{...props}
>
<Menu isLazy placement="bottom-end" matchWidth>
<MenuButton
as={Button}
rightIcon={<ChevronLeftIcon transform={'rotate(-90deg)'} />}
colorScheme="gray"
justifyContent="space-between"
textAlign="left"
{...props}
>
<chakra.span isTruncated display="block">
{currentItem ?? placeholder}
</MenuButton>
<Portal>
<MenuList maxW="500px" zIndex={1500}>
<Stack maxH={'35vh'} overflowY="scroll" spacing="0">
{items.map((item) => (
<MenuItem
key={item as unknown as string}
maxW="500px"
overflow="hidden"
whiteSpace="nowrap"
textOverflow="ellipsis"
onClick={handleMenuItemClick(item)}
>
{item}
</MenuItem>
))}
</Stack>
</MenuList>
</Portal>
</Menu>
</>
</chakra.span>
</MenuButton>
<Portal>
<MenuList maxW="500px" zIndex={1500}>
<Stack maxH={'35vh'} overflowY="scroll" spacing="0">
{items.map((item) => (
<MenuItem
key={item as unknown as string}
maxW="500px"
overflow="hidden"
whiteSpace="nowrap"
textOverflow="ellipsis"
onClick={handleMenuItemClick(item)}
>
{item}
</MenuItem>
))}
</Stack>
</MenuList>
</Portal>
</Menu>
)
}