Skip to content

Commit

Permalink
fix: Make IconBadge boxed as default (#540)
Browse files Browse the repository at this point in the history
* fix: Make IconBadge boxed as default

* fix: Inline logic

* fix: Fix height
  • Loading branch information
LautaroPetaccio authored May 9, 2024
1 parent d02ed50 commit d1200a9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
11 changes: 9 additions & 2 deletions src/components/IconBadge/IconBadge.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
.dui-icon-badge {
display: inline-flex;
align-items: center;
text-transform: uppercase;
padding: 2px 8px;
border-radius: 5px;
background-color: #37333d;
min-height: 24px;
height: 24px;
}

.dui-icon-badge.inlined {
display: inline-flex;
}

.dui-icon-badge.boxed {
display: flex;
}

.dui-icon-badge.clickable {
Expand Down
7 changes: 5 additions & 2 deletions src/components/IconBadge/IconBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ export const IconBadge = ({
text,
onClick,
className,
children
children,
inline
}: Props) => {
const inlined = inline ? 'inlined' : 'boxed'
const childrenInt = React.useMemo(
() => (
<>
Expand All @@ -29,7 +31,8 @@ export const IconBadge = ({
className={classNames(
'dui-icon-badge',
className,
onClick && 'clickable'
onClick && 'clickable',
inlined
)}
onClick={onClick}
>
Expand Down
1 change: 1 addition & 0 deletions src/components/IconBadge/IconBadge.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export type Props = {
| 'places'
| 'utility'
text?: string
inline?: boolean
onClick?: () => void
children?: React.ReactNode
}

0 comments on commit d1200a9

Please sign in to comment.