♻️ Fix eslint warnings
This commit is contained in:
@ -92,7 +92,7 @@ const components = {
|
||||
},
|
||||
}
|
||||
|
||||
export const theme: any = extendTheme({
|
||||
export const theme = extendTheme({
|
||||
fonts,
|
||||
components,
|
||||
colors,
|
||||
|
@ -13,6 +13,7 @@ import {
|
||||
import { setCssVariablesValue } from '@/utils/setCssVariablesValue'
|
||||
|
||||
export type BotProps = {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
typebot: string | any
|
||||
isPreview?: boolean
|
||||
resultId?: string
|
||||
|
@ -103,6 +103,13 @@ const Input = (props: {
|
||||
const getPrefilledValue = () =>
|
||||
props.isInputPrefillEnabled ? props.block.prefilledValue : undefined
|
||||
|
||||
const submitPaymentSuccess = () =>
|
||||
props.onSubmit({
|
||||
value:
|
||||
(props.block.options as PaymentInputOptions).labels.success ??
|
||||
'Success',
|
||||
})
|
||||
|
||||
return (
|
||||
<Switch>
|
||||
<Match when={props.block.type === InputBlockType.TEXT}>
|
||||
@ -182,13 +189,7 @@ const Input = (props: {
|
||||
...props.block.runtimeOptions,
|
||||
} as PaymentInputOptions & RuntimeOptions
|
||||
}
|
||||
onSuccess={() =>
|
||||
props.onSubmit({
|
||||
value:
|
||||
(props.block.options as PaymentInputOptions).labels.success ??
|
||||
'Success',
|
||||
})
|
||||
}
|
||||
onSuccess={submitPaymentSuccess}
|
||||
/>
|
||||
</Match>
|
||||
</Switch>
|
||||
|
@ -8,20 +8,18 @@ export const LiteBadge = (props: Props) => {
|
||||
let liteBadge: HTMLAnchorElement | undefined
|
||||
let observer: MutationObserver | undefined
|
||||
|
||||
onMount(() => {
|
||||
if (!document || !props.botContainer) return
|
||||
observer = new MutationObserver(function (mutations_list) {
|
||||
mutations_list.forEach(function (mutation) {
|
||||
mutation.removedNodes.forEach(function (removed_node) {
|
||||
if (
|
||||
'id' in removed_node &&
|
||||
liteBadge &&
|
||||
removed_node.id == 'lite-badge'
|
||||
)
|
||||
props.botContainer?.append(liteBadge)
|
||||
})
|
||||
const appendBadgeIfNecessary = (mutations: MutationRecord[]) => {
|
||||
mutations.forEach((mutation) => {
|
||||
mutation.removedNodes.forEach((removedNode) => {
|
||||
if ('id' in removedNode && liteBadge && removedNode.id == 'lite-badge')
|
||||
props.botContainer?.append(liteBadge)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
if (!document || !props.botContainer) return
|
||||
observer = new MutationObserver(appendBadgeIfNecessary)
|
||||
observer.observe(props.botContainer, {
|
||||
subtree: false,
|
||||
childList: true,
|
||||
|
Reference in New Issue
Block a user