🐛 Fix bubble icon file upload
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
import { ColorPicker } from '@/components/ColorPicker'
|
import { ColorPicker } from '@/components/ColorPicker'
|
||||||
import { ImageUploadContent } from '@/components/ImageUploadContent'
|
import { ImageUploadContent } from '@/components/ImageUploadContent'
|
||||||
import { ChevronDownIcon } from '@/components/icons'
|
import { ChevronDownIcon } from '@/components/icons'
|
||||||
|
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
|
||||||
|
import { useWorkspace } from '@/features/workspace/WorkspaceProvider'
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Heading,
|
Heading,
|
||||||
@@ -24,6 +26,8 @@ type Props = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const ButtonThemeSettings = ({ buttonTheme, onChange }: Props) => {
|
export const ButtonThemeSettings = ({ buttonTheme, onChange }: Props) => {
|
||||||
|
const { workspace } = useWorkspace()
|
||||||
|
const { typebot } = useTypebot()
|
||||||
const updateBackgroundColor = (backgroundColor: string) => {
|
const updateBackgroundColor = (backgroundColor: string) => {
|
||||||
onChange({
|
onChange({
|
||||||
...buttonTheme,
|
...buttonTheme,
|
||||||
@@ -76,13 +80,19 @@ export const ButtonThemeSettings = ({ buttonTheme, onChange }: Props) => {
|
|||||||
<Button size="sm">Pick an image</Button>
|
<Button size="sm">Pick an image</Button>
|
||||||
</PopoverTrigger>
|
</PopoverTrigger>
|
||||||
<PopoverContent p="4" w="500px">
|
<PopoverContent p="4" w="500px">
|
||||||
<ImageUploadContent
|
{workspace?.id && typebot?.id && (
|
||||||
onSubmit={(url) => {
|
<ImageUploadContent
|
||||||
updateCustomIconSrc(url)
|
onSubmit={(url) => {
|
||||||
onClose()
|
updateCustomIconSrc(url)
|
||||||
}}
|
onClose()
|
||||||
uploadFileProps={undefined}
|
}}
|
||||||
/>
|
uploadFileProps={{
|
||||||
|
workspaceId: workspace.id,
|
||||||
|
typebotId: typebot.id,
|
||||||
|
fileName: 'bubble-icon',
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</PopoverContent>
|
</PopoverContent>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user