2
0

🦴 Add share page backbone

This commit is contained in:
Baptiste Arnaud
2021-12-23 15:20:21 +01:00
parent 79aede1f3f
commit 9a78a341d2
12 changed files with 217 additions and 4 deletions

View File

@ -56,6 +56,7 @@ const typebotContext = createContext<{
undo: () => void
updateTheme: (theme: Theme) => void
updateSettings: (settings: Settings) => void
updatePublicId: (publicId: string) => void
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
}>({})
@ -284,6 +285,11 @@ export const TypebotContext = ({
setLocalTypebot({ ...localTypebot, settings })
}
const updatePublicId = (publicId: string) => {
if (!localTypebot) return
setLocalTypebot({ ...localTypebot, publicId })
}
return (
<typebotContext.Provider
value={{
@ -301,6 +307,7 @@ export const TypebotContext = ({
undo,
updateTheme,
updateSettings,
updatePublicId,
}}
>
{children}