Skip to content
This repository was archived by the owner on Oct 19, 2023. It is now read-only.

Fix: Tag failed propTypes #39

Draft
wants to merge 1 commit into
base: alpha
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/components/Tag/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ const propTypes = {
};
const defaultProps = {
variant: 'primary',
textClassName: false,
};


const variantsTextClassName = {
primary: 'u-textWhite hover:u-textWhite',
primary_subtle: 'u-textPrimary hover:u-textPrimary',
Expand Down Expand Up @@ -69,7 +67,7 @@ const Tag = React.forwardRef(({ className, textClassName, variant, as: Component
'Tag',
'u-flexInline u-alignItemsCenter u-textCenter u-textNoWrap u-roundedMedium u-text200 hover:u-textDecorationNone',
variant && variantsClassName[variant],
((variant === 'primary' || variant === 'accent' || variant === 'primary_subtle' || variant === 'accent_subtle') && textClassName) ? textClassName : variantsTextClassName[variant],
((['primary', 'accent', 'primary_subtle'].includes(variant)) && textClassName) ? textClassName : variantsTextClassName[variant],
className && className
)}
/>
Expand Down