2
0

chore(editor): ♻️ Revert tables to arrays

Yet another refacto. I improved many many mechanisms on this one including dnd. It is now end 2 end tested 🎉
This commit is contained in:
Baptiste Arnaud
2022-02-04 19:00:08 +01:00
parent 8a350eee6c
commit 524ef0812c
123 changed files with 2998 additions and 3112 deletions

View File

@ -1,3 +1,4 @@
import { NotFoundPage } from 'layouts/NotFoundPage'
import { PublicTypebot } from 'models'
import { GetServerSideProps, GetServerSidePropsContext } from 'next'
import { TypebotPage, TypebotPageProps } from '../layouts/TypebotPage'
@ -12,7 +13,6 @@ export const getServerSideProps: GetServerSideProps = async (
try {
if (!context.req.headers.host) return { props: {} }
typebot = await getTypebotFromUrl(context.req.headers.host)
if (!typebot) return { props: {} }
return {
props: {
typebot,
@ -42,5 +42,6 @@ const getTypebotFromUrl = async (
return (typebot as unknown as PublicTypebot | undefined) ?? undefined
}
const App = (props: TypebotPageProps) => <TypebotPage {...props} />
const App = ({ typebot, ...props }: TypebotPageProps) =>
typebot ? <TypebotPage {...props} typebot={typebot} /> : <NotFoundPage />
export default App