From e827da7b6bd6da2b22d3b6a92ce8446519f6fdb6 Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Thu, 27 Apr 2023 15:07:08 +0200 Subject: [PATCH] :lipstick: Better toast UI when it doesn't contain details --- apps/builder/src/components/Toast.tsx | 2 +- .../templates/components/ImportTypebotFromFileButton.tsx | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/builder/src/components/Toast.tsx b/apps/builder/src/components/Toast.tsx index 5a47cd431..622d11de3 100644 --- a/apps/builder/src/components/Toast.tsx +++ b/apps/builder/src/components/Toast.tsx @@ -36,7 +36,7 @@ export const Toast = ({ shadow="sm" fontSize="sm" pos="relative" - maxW="450px" + maxW={details ? '450px' : '300px'} > {' '} diff --git a/apps/builder/src/features/templates/components/ImportTypebotFromFileButton.tsx b/apps/builder/src/features/templates/components/ImportTypebotFromFileButton.tsx index 1dd2b85a7..e676f5531 100644 --- a/apps/builder/src/features/templates/components/ImportTypebotFromFileButton.tsx +++ b/apps/builder/src/features/templates/components/ImportTypebotFromFileButton.tsx @@ -26,6 +26,10 @@ export const ImportTypebotFromFileButton = ({ console.error(err) showToast({ description: "Failed to parse the file. Are you sure it's a typebot?", + details: { + content: JSON.stringify(err, null, 2), + lang: 'json', + }, }) } }