diff --git a/apps/builder/src/features/blocks/inputs/pictureChoice/components/PictureChoiceItemSettings.tsx b/apps/builder/src/features/blocks/inputs/pictureChoice/components/PictureChoiceItemSettings.tsx index 7ffa3f2a4..2e5f675dd 100644 --- a/apps/builder/src/features/blocks/inputs/pictureChoice/components/PictureChoiceItemSettings.tsx +++ b/apps/builder/src/features/blocks/inputs/pictureChoice/components/PictureChoiceItemSettings.tsx @@ -5,11 +5,10 @@ import { Button, HStack, Popover, - PopoverAnchor, PopoverContent, + PopoverTrigger, Stack, Text, - useDisclosure, } from '@chakra-ui/react' import { ImageUploadContent } from '@/components/ImageUploadContent' @@ -24,12 +23,10 @@ export const PictureChoiceItemSettings = ({ item, onItemChange, }: Props) => { - const { isOpen, onOpen, onClose } = useDisclosure() const updateTitle = (title: string) => onItemChange({ ...item, title }) const updateImage = (pictureSrc: string) => { onItemChange({ ...item, pictureSrc }) - onClose() } const updateDescription = (description: string) => @@ -39,19 +36,25 @@ export const PictureChoiceItemSettings = ({ Image: - - - - - - - + + {({ onClose }) => ( + <> + + + + + { + updateImage(url) + onClose() + }} + excludedTabs={['emoji']} + /> + + + )} { - const { isOpen, onOpen, onClose } = useDisclosure() - const updateBackgroundColor = (backgroundColor: string) => { onChange({ ...buttonTheme, @@ -39,7 +36,6 @@ export const ButtonThemeSettings = ({ buttonTheme, onChange }: Props) => { ...buttonTheme, customIconSrc, }) - onClose() } const updateSize = (size: ButtonTheme['size']) => @@ -73,18 +69,23 @@ export const ButtonThemeSettings = ({ buttonTheme, onChange }: Props) => { Custom icon - - - - - - - + + {({ onClose }) => ( + <> + + + + + { + updateCustomIconSrc(url) + onClose() + }} + filePath={undefined} + /> + + + )}