2
0

🧑‍💻 Allow for custom 404 system messages

This commit is contained in:
Baptiste Arnaud
2024-02-12 09:18:54 +01:00
parent e05580a5de
commit 5226b06fe1
3 changed files with 26 additions and 2 deletions

View File

@ -312,3 +312,12 @@ The related environment variables are listed here but you are probably not inter
| NEXT_PUBLIC_POSTHOG_HOST | https://app.posthog.com | PostHog API Host |
</Accordion>
<Accordion title="System labels">
| Parameter | Default | Description |
| ------------------------------- | ---------------------------------------- | ----------- |
| NEXT_PUBLIC_VIEWER_404_TITLE | 404 | |
| NEXT_PUBLIC_VIEWER_404_SUBTITLE | The bot you're looking for doesn't exist | |
</Accordion>

View File

@ -1,3 +1,5 @@
import { env } from '@typebot.io/env'
export const NotFoundPage = () => (
<div
style={{
@ -8,7 +10,9 @@ export const NotFoundPage = () => (
flexDirection: 'column',
}}
>
<h1 style={{ fontWeight: 'bold', fontSize: '30px' }}>404</h1>
<h2>The bot you&apos;re looking for doesn&apos;t exist</h2>
<h1 style={{ fontWeight: 'bold', fontSize: '30px' }}>
{env.NEXT_PUBLIC_VIEWER_404_TITLE}
</h1>
<h2>{env.NEXT_PUBLIC_VIEWER_404_SUBTITLE}</h2>
</div>
)

11
packages/env/env.ts vendored
View File

@ -99,6 +99,11 @@ const baseEnv = {
),
NEXT_PUBLIC_ONBOARDING_TYPEBOT_ID: z.string().min(1).optional(),
NEXT_PUBLIC_BOT_FILE_UPLOAD_MAX_SIZE: z.coerce.number().optional(),
NEXT_PUBLIC_VIEWER_404_TITLE: z.string().optional().default('404'),
NEXT_PUBLIC_VIEWER_404_SUBTITLE: z
.string()
.optional()
.default("The bot you're looking for doesn't exist"),
},
runtimeEnv: {
NEXT_PUBLIC_E2E_TEST: getRuntimeVariable('NEXT_PUBLIC_E2E_TEST'),
@ -109,6 +114,12 @@ const baseEnv = {
NEXT_PUBLIC_BOT_FILE_UPLOAD_MAX_SIZE: getRuntimeVariable(
'NEXT_PUBLIC_BOT_FILE_UPLOAD_MAX_SIZE'
),
NEXT_PUBLIC_VIEWER_404_TITLE: getRuntimeVariable(
'NEXT_PUBLIC_VIEWER_404_TITLE'
),
NEXT_PUBLIC_VIEWER_404_SUBTITLE: getRuntimeVariable(
'NEXT_PUBLIC_VIEWER_404_SUBTITLE'
),
},
}
const githubEnv = {