From 34d34dbb284b702193e19afd9e796961e054fa45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Tue, 2 Apr 2024 12:37:15 +0100 Subject: [PATCH 1/5] fix: Move back button out of main container --- .../src/pages/Preview/Questions.tsx | 36 ++++++++++--------- .../src/pages/layout/PublicLayout.tsx | 10 +++--- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/editor.planx.uk/src/pages/Preview/Questions.tsx b/editor.planx.uk/src/pages/Preview/Questions.tsx index f9a10c74ec..0870daafb2 100644 --- a/editor.planx.uk/src/pages/Preview/Questions.tsx +++ b/editor.planx.uk/src/pages/Preview/Questions.tsx @@ -130,22 +130,22 @@ const Questions = ({ previewEnvironment }: QuestionsProps) => { const handleSubmit = (id: string): handleSubmit => - (userData) => { - const { - data = undefined, - answers = [], - auto = false, - } = (() => { - try { - const { answers = [], data, auto } = userData as any; - return { answers: answers.filter(Boolean), data, auto }; - } catch (err) { - return {}; - } - })(); - - record(id, { answers, data, auto }); - }; + (userData) => { + const { + data = undefined, + answers = [], + auto = false, + } = (() => { + try { + const { answers = [], data, auto } = userData as any; + return { answers: answers.filter(Boolean), data, auto }; + } catch (err) { + return {}; + } + })(); + + record(id, { answers, data, auto }); + }; const goBack = useCallback(() => { const previous = previousCard(node); @@ -166,7 +166,7 @@ const Questions = ({ previewEnvironment }: QuestionsProps) => { ); return ( - +