Unverified Commit aa9eb3be authored by Guilherme Gazzo's avatar Guilherme Gazzo Committed by GitHub
Browse files

fix: Undo bad merge conflict (#329)

parent 8ec4c27e
import PropTypes from 'prop-types';
import React from 'react';
import { Box } from '../..';
import { prependClassName } from '../../helpers/prependClassName';
export function Tag({
is: TagName = 'span',
small,
medium,
className,
disabled,
round,
variant = 'secondary',
onClick,
variant = 'secondary',
...props
}) {
const modifiers = [
variant,
small && 'small',
medium && 'medium',
disabled && 'disabled',
onClick && 'clickable',
]
.map((modifier) => `rcx-tag--${modifier}`)
.filter(Boolean)
.join(' ');
return (
<Box
is='span'
rcx-tag
rcx-tag--warning={variant === 'warning'}
rcx-tag--secondary={variant === 'secondary'}
rcx-tag--primary={variant === 'primary'}
rcx-tag--danger={variant === 'danger'}
rcx-tag--ghost={variant === 'ghost'}
rcx-tag--disabled={!!disabled}
rcx-tag--round={!!round}
rcx-tag--clickable={!!onClick}
onClick={onClick}
<TagName
className={prependClassName(className, `rcx-tag ${modifiers}`)}
{...props}
/>
);
}
Tag.propTypes = {
small: PropTypes.bool,
medium: PropTypes.bool,
disabled: PropTypes.bool,
round: PropTypes.bool,
onClick: PropTypes.func,
variant: PropTypes.oneOf([
'secondary',
'primary',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment