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/components/Form/Form.tsx | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

(limited to 'src/components/Form/Form.tsx')

diff --git a/src/components/Form/Form.tsx b/src/components/Form/Form.tsx
index dd1bc63..048219c 100644
--- a/src/components/Form/Form.tsx
+++ b/src/components/Form/Form.tsx
@@ -10,10 +10,8 @@ const Form = ({
   submitHandler: any;
   modifier?: string;
 }) => {
-  const classes =
-    modifier !== ''
-      ? `${styles.wrapper} ${styles[`wrapper--${modifier}`]}`
-      : styles.wrapper;
+  const withModifier = modifier ? `wrapper--${modifier}` : '';
+  const classes = `${styles.wrapper} ${withModifier}`;
 
   return (
     <form onSubmit={submitHandler} className={classes}>
-- 
cgit v1.2.3

