aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/Buttons/ButtonLink/ButtonLink.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-01-04 13:07:15 +0100
committerArmand Philippot <git@armandphilippot.com>2022-01-04 13:32:04 +0100
commitab5e5f4bdf40b5bc1ccf82dc1b4aca94d5171ec3 (patch)
treed5b26588c08cbc3aac1f281aa848e68c522eabcd /src/components/Buttons/ButtonLink/ButtonLink.tsx
parent1856796cef0989b10030906c9b1383d44800fb00 (diff)
refactor(sharing): avoid nested template literals
This improves readability. I also rename a variable to avoid duplicate between global scope and useEffect scope.
Diffstat (limited to 'src/components/Buttons/ButtonLink/ButtonLink.tsx')
-rw-r--r--src/components/Buttons/ButtonLink/ButtonLink.tsx6
1 files changed, 3 insertions, 3 deletions
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 ? (
<a className={classes} href={target}>