(imageBubble) Add redirect on image click option

Closes #448
This commit is contained in:
Baptiste Arnaud
2023-04-07 11:30:54 +02:00
parent ee14228ee3
commit e06f8186f6
7 changed files with 121 additions and 26 deletions

View File

@@ -1,6 +1,6 @@
import { ImageUploadContent } from '@/components/ImageUploadContent'
import { AudioBubbleForm } from '@/features/blocks/bubbles/audio/components/AudioBubbleForm'
import { EmbedUploadContent } from '@/features/blocks/bubbles/embed/components/EmbedUploadContent'
import { ImageBubbleSettings } from '@/features/blocks/bubbles/image/components/ImageBubbleSettings'
import { VideoUploadContent } from '@/features/blocks/bubbles/video/components/VideoUploadContent'
import {
Portal,
@@ -46,15 +46,13 @@ export const MediaBubbleContent = ({
block,
onContentChange,
}: Props) => {
const handleImageUrlChange = (url: string) => onContentChange({ url })
switch (block.type) {
case BubbleBlockType.IMAGE: {
return (
<ImageUploadContent
filePath={`typebots/${typebotId}/blocks/${block.id}`}
defaultUrl={block.content?.url}
onSubmit={handleImageUrlChange}
<ImageBubbleSettings
typebotId={typebotId}
block={block}
onContentChange={onContentChange}
/>
)
}