Skip to content

Commit

Permalink
feat: 🎸 [Adornment] Added badge overlap, defaults to circular
Browse files Browse the repository at this point in the history
  • Loading branch information
luciob committed Jul 15, 2022
1 parent 948188c commit 9895bba
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Adornment/components/Badge/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ const AdornmentBadge: FC<IAdornment> = ({ badge, children, dataCy = DEFAULT_DATA
return <Fragment>{children}</Fragment>;
}

const { color = "default", value, variant = "standard" } = badge;
const { color = "default", overlap = "circular", value, variant = "standard" } = badge;

return (
<MUIBadge badgeContent={value} color={color} data-cy={badgeDataCy} overlap="circular" variant={variant}>
<MUIBadge badgeContent={value} color={color} data-cy={badgeDataCy} overlap={overlap} variant={variant}>
{children}
</MUIBadge>
);
Expand Down
15 changes: 15 additions & 0 deletions src/types/Adornment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,26 @@ export type IAdornmentSubpart = "adornment" | IAdornmentBadgeSubpart | IAdornmen

type IBadgeColor = "default" | "error" | "primary" | "secondary";

type IBadgeOverlap = "circular" | "rectangular";

type IBadgeVariant = "dot" | "standard";

export interface IAdornmentBadge {
/**
* Badge color
*/
color?: IBadgeColor;
/**
* Badge overlap
*/
overlap?: IBadgeOverlap;
/**
* Badge content
*/
value: string;
/**
* Badge variant
*/
variant?: IBadgeVariant;
}

Expand Down

0 comments on commit 9895bba

Please sign in to comment.