From ab5e5f4bdf40b5bc1ccf82dc1b4aca94d5171ec3 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Tue, 4 Jan 2022 13:07:15 +0100
Subject: refactor(sharing): avoid nested template literals

This improves readability. I also rename a variable to avoid duplicate
between global scope and useEffect scope.
---
 src/pages/contact.tsx | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'src/pages/contact.tsx')

diff --git a/src/pages/contact.tsx b/src/pages/contact.tsx
index 8e6de7a..3ce6098 100644
--- a/src/pages/contact.tsx
+++ b/src/pages/contact.tsx
@@ -42,7 +42,8 @@ const ContactPage: NextPageWithLayout = () => {
       );
       resetForm();
     } else {
-      const error = `${t`An error occurred:`} ${mail.message}`;
+      const errorPrefix = t`An error occurred:`;
+      const error = `${errorPrefix} ${mail.message}`;
       setStatus(error);
     }
   };
-- 
cgit v1.2.3

