From ab5e5f4bdf40b5bc1ccf82dc1b4aca94d5171ec3 Mon Sep 17 00:00:00 2001 From: Armand Philippot 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/Buttons/ButtonLink/ButtonLink.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/components/Buttons/ButtonLink') diff --git a/src/components/Buttons/ButtonLink/ButtonLink.tsx b/src/components/Buttons/ButtonLink/ButtonLink.tsx index a2f75f2..3e78440 100644 --- a/src/components/Buttons/ButtonLink/ButtonLink.tsx +++ b/src/components/Buttons/ButtonLink/ButtonLink.tsx @@ -16,9 +16,9 @@ const ButtonLink = ({ isExternal?: boolean; hasIcon?: boolean; }) => { - const classes = `${styles.btn} ${styles.link} ${styles[`link--${position}`]}${ - hasIcon ? ` ${styles['link--icon']}` : '' - }`; + const positionModifier = `link--${position}`; + const iconModifier = hasIcon ? ` ${styles['link--icon']}` : ''; + const classes = `${styles.btn} ${styles.link} ${styles[positionModifier]}${iconModifier}`; return isExternal ? ( -- cgit v1.2.3