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/arrow.tsx | |
| parent | a1e8f1e4426ed3560ce1b76fb73a6969388ed253 (diff) | |
chore(icons): accept a classname as prop
Diffstat (limited to 'src/components/atoms/icons/arrow.tsx')
| -rw-r--r-- | src/components/atoms/icons/arrow.tsx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/components/atoms/icons/arrow.tsx b/src/components/atoms/icons/arrow.tsx index f50d117..5f3c460 100644 --- a/src/components/atoms/icons/arrow.tsx +++ b/src/components/atoms/icons/arrow.tsx @@ -1,13 +1,17 @@ -import { FC } from 'react'; +import { VFC } from 'react'; import styles from './arrow.module.scss'; -type ArrowDirection = 'top' | 'right' | 'bottom' | 'left'; +export type ArrowDirection = 'top' | 'right' | 'bottom' | 'left'; -type ArrowProps = { +export type ArrowProps = { + /** + * Set additional classnames to the icon. + */ + className?: string; /** * The arrow direction. Default: right. */ - direction?: ArrowDirection; + direction: ArrowDirection; }; /** @@ -15,9 +19,9 @@ type ArrowProps = { * * Render a svg arrow icon. */ -const Arrow: FC<ArrowProps> = ({ direction = 'right' }) => { +const Arrow: VFC<ArrowProps> = ({ className = '', direction }) => { const directionClass = styles[`icon--${direction}`]; - const classes = `${styles.icon} ${directionClass}`; + const classes = `${styles.icon} ${directionClass} ${className}`; if (direction === 'top') { return ( |
