Skip to content

Commit aa9eb3b

Browse files
authored
fix: Undo bad merge conflict (#329)
1 parent 8ec4c27 commit aa9eb3b

File tree

1 file changed

+22
-16
lines changed
  • packages/fuselage/src/components/Tag

1 file changed

+22
-16
lines changed

packages/fuselage/src/components/Tag/index.js

+22-16
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,42 @@
11
import PropTypes from 'prop-types';
22
import React from 'react';
33

4-
import { Box } from '../..';
4+
import { prependClassName } from '../../helpers/prependClassName';
55

66
export function Tag({
7+
is: TagName = 'span',
8+
small,
9+
medium,
10+
className,
711
disabled,
8-
round,
9-
variant = 'secondary',
1012
onClick,
13+
variant = 'secondary',
1114
...props
1215
}) {
16+
const modifiers = [
17+
variant,
18+
small && 'small',
19+
medium && 'medium',
20+
disabled && 'disabled',
21+
onClick && 'clickable',
22+
]
23+
.map((modifier) => `rcx-tag--${modifier}`)
24+
.filter(Boolean)
25+
.join(' ');
26+
1327
return (
14-
<Box
15-
is='span'
16-
rcx-tag
17-
rcx-tag--warning={variant === 'warning'}
18-
rcx-tag--secondary={variant === 'secondary'}
19-
rcx-tag--primary={variant === 'primary'}
20-
rcx-tag--danger={variant === 'danger'}
21-
rcx-tag--ghost={variant === 'ghost'}
22-
rcx-tag--disabled={!!disabled}
23-
rcx-tag--round={!!round}
24-
rcx-tag--clickable={!!onClick}
25-
onClick={onClick}
28+
<TagName
29+
className={prependClassName(className, `rcx-tag ${modifiers}`)}
2630
{...props}
2731
/>
2832
);
2933
}
3034

3135
Tag.propTypes = {
36+
small: PropTypes.bool,
37+
medium: PropTypes.bool,
3238
disabled: PropTypes.bool,
33-
round: PropTypes.bool,
39+
onClick: PropTypes.func,
3440
variant: PropTypes.oneOf([
3541
'secondary',
3642
'primary',

0 commit comments

Comments
 (0)