diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-04-08 19:32:58 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-04-08 19:32:58 +0200 |
| commit | 5c75a302c2203cb3ebf31233121026b4775662cf (patch) | |
| tree | efaaeb7805d9f211a5f01f920aaa3609648ddc0b /src/components/atoms/icons/hamburger.tsx | |
| parent | a1e8f1e4426ed3560ce1b76fb73a6969388ed253 (diff) | |
chore(icons): accept a classname as prop
Diffstat (limited to 'src/components/atoms/icons/hamburger.tsx')
| -rw-r--r-- | src/components/atoms/icons/hamburger.tsx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/components/atoms/icons/hamburger.tsx b/src/components/atoms/icons/hamburger.tsx index f081bf7..6716b26 100644 --- a/src/components/atoms/icons/hamburger.tsx +++ b/src/components/atoms/icons/hamburger.tsx @@ -2,6 +2,13 @@ import { FC } from 'react'; import styles from './hamburger.module.scss'; type HamburgerProps = { + /** + * Set additional classnames to the icon. + */ + className?: string; + /** + * Transform hamburger to a close icon when active. + */ isActive: boolean; }; @@ -10,9 +17,9 @@ type HamburgerProps = { * * Render a Hamburger icon. */ -const Hamburger: FC<HamburgerProps> = ({ isActive }) => { +const Hamburger: FC<HamburgerProps> = ({ className = '', isActive }) => { const stateClass = isActive ? `${styles['icon--active']}` : ''; - const iconClasses = `${styles.icon} ${stateClass}`; + const iconClasses = `${styles.icon} ${stateClass} ${className}`; return <span className={iconClasses}></span>; }; |
