2
0

refactor(♻️ Add defaults everywhere (+ settings page)):

This commit is contained in:
Baptiste Arnaud
2022-01-25 18:19:37 +01:00
parent 21448bcc8a
commit c5aaa323d1
115 changed files with 1436 additions and 720 deletions

View File

@ -4,16 +4,11 @@ import React, { createContext, ReactNode, useContext, useState } from 'react'
const answersContext = createContext<{
answers: Answer[]
addAnswer: (answer: Answer) => void
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
}>({})
export const AnswersContext = ({
children,
typebotId,
}: {
children: ReactNode
typebotId: string
}) => {
export const AnswersContext = ({ children }: { children: ReactNode }) => {
const [answers, setAnswers] = useState<Answer[]>([])
const addAnswer = (answer: Answer) =>

View File

@ -5,6 +5,7 @@ const hostAvatarsContext = createContext<{
lastBubblesTopOffset: number[]
addNewAvatarOffset: () => void
updateLastAvatarOffset: (newOffset: number) => void
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
}>({})

View File

@ -4,6 +4,7 @@ import React, { createContext, ReactNode, useContext, useState } from 'react'
const typebotContext = createContext<{
typebot: PublicTypebot
updateVariableValue: (variableId: string, value: string) => void
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
}>({})