Skip to content

Commit

Permalink
♻️ Fix eslint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Feb 23, 2023
1 parent 889e6a4 commit be4c8e0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion apps/landing-page/lib/chakraTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const components = {
},
}

export const theme: any = extendTheme({
export const theme = extendTheme({
fonts,
components,
colors,
Expand Down
1 change: 1 addition & 0 deletions packages/js/src/components/Bot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 8 additions & 7 deletions packages/js/src/components/InputChatBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}>
Expand Down Expand Up @@ -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>
Expand Down
22 changes: 10 additions & 12 deletions packages/js/src/components/LiteBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit be4c8e0

Please sign in to comment.