💄 Add backgroundColor theme field for Popup
And use it for the onboarding modal Closes #375
This commit is contained in:
@@ -16,6 +16,7 @@ export const OnboardingModal = ({ totalTypebots }: Props) => {
|
|||||||
'/bots/onboarding.json',
|
'/bots/onboarding.json',
|
||||||
'/bots/onboarding-dark.json'
|
'/bots/onboarding-dark.json'
|
||||||
)
|
)
|
||||||
|
const backgroundColor = useColorModeValue('white', '#171923')
|
||||||
const { user, updateUser } = useUser()
|
const { user, updateUser } = useUser()
|
||||||
const [typebot, setTypebot] = useState<Typebot>()
|
const [typebot, setTypebot] = useState<Typebot>()
|
||||||
const confettiCanvaContainer = useRef<HTMLCanvasElement | null>(null)
|
const confettiCanvaContainer = useRef<HTMLCanvasElement | null>(null)
|
||||||
@@ -102,6 +103,9 @@ export const OnboardingModal = ({ totalTypebots }: Props) => {
|
|||||||
prefilledVariables={{
|
prefilledVariables={{
|
||||||
Name: user?.name?.split(' ')[0] ?? undefined,
|
Name: user?.name?.split(' ')[0] ?? undefined,
|
||||||
}}
|
}}
|
||||||
|
theme={{
|
||||||
|
backgroundColor,
|
||||||
|
}}
|
||||||
defaultOpen={isNewUser}
|
defaultOpen={isNewUser}
|
||||||
onAnswer={handleNewAnswer}
|
onAnswer={handleNewAnswer}
|
||||||
onEnd={handleBotEnd}
|
onEnd={handleBotEnd}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@typebot.io/js",
|
"name": "@typebot.io/js",
|
||||||
"version": "0.0.22",
|
"version": "0.0.23",
|
||||||
"description": "Javascript library to display typebots on your website",
|
"description": "Javascript library to display typebots on your website",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
|||||||
@@ -122,6 +122,10 @@ export const Popup = (props: PopupProps) => {
|
|||||||
<div class="flex min-h-full items-center justify-center p-4 text-center sm:p-0">
|
<div class="flex min-h-full items-center justify-center p-4 text-center sm:p-0">
|
||||||
<div
|
<div
|
||||||
class="relative h-[80vh] transform overflow-hidden rounded-lg text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg"
|
class="relative h-[80vh] transform overflow-hidden rounded-lg text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg"
|
||||||
|
style={{
|
||||||
|
'background-color':
|
||||||
|
props.theme?.backgroundColor ?? 'transparent',
|
||||||
|
}}
|
||||||
ref={botContainer}
|
ref={botContainer}
|
||||||
>
|
>
|
||||||
<Bot {...botProps} prefilledVariables={prefilledVariables()} />
|
<Bot {...botProps} prefilledVariables={prefilledVariables()} />
|
||||||
|
|||||||
@@ -2,5 +2,6 @@ export type PopupParams = {
|
|||||||
autoShowDelay?: number
|
autoShowDelay?: number
|
||||||
theme?: {
|
theme?: {
|
||||||
width?: string
|
width?: string
|
||||||
|
backgroundColor?: string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@typebot.io/react",
|
"name": "@typebot.io/react",
|
||||||
"version": "0.0.22",
|
"version": "0.0.23",
|
||||||
"description": "React library to display typebots on your website",
|
"description": "React library to display typebots on your website",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
|
|||||||
Reference in New Issue
Block a user