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/Icons/Hamburger/Hamburger.tsx | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

(limited to 'src/components/Icons/Hamburger/Hamburger.tsx')

diff --git a/src/components/Icons/Hamburger/Hamburger.tsx b/src/components/Icons/Hamburger/Hamburger.tsx
index 3b9e609..9b39272 100644
--- a/src/components/Icons/Hamburger/Hamburger.tsx
+++ b/src/components/Icons/Hamburger/Hamburger.tsx
@@ -1,13 +1,10 @@
 import styles from './Hamburger.module.scss';
 
 const HamburgerIcon = ({ isActive }: { isActive: boolean }) => {
-  return (
-    <span
-      className={`${styles.icon}${
-        isActive ? ` ${styles['icon--active']}` : ''
-      }`}
-    ></span>
-  );
+  const withModifier = isActive ? ` ${styles['icon--active']}` : '';
+  const iconClasses = `${styles.icon} ${withModifier}`;
+
+  return <span className={iconClasses}></span>;
 };
 
 export default HamburgerIcon;
-- 
cgit v1.2.3

