Skip to content

Commit

Permalink
fix: Fixed layout issue in the Badge component
Browse files Browse the repository at this point in the history
  • Loading branch information
agrawal-rohit committed Dec 18, 2023
1 parent 3072c26 commit 36d69f6
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions src/components/molecules/badge/withBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,22 +99,24 @@ const withBadge =
// Render the wrapped component with the badge
return (
<Box>
<WrappedComponent
{...(props as P)}
onLayout={onBaseComponentLayoutChange}
/>
<Box alignSelf="flex-start">
<WrappedComponent
{...(props as P)}
onLayout={onBaseComponentLayoutChange}
/>

{!hidden && (
<Badge
{...badgeProps}
onLayout={onBadgeLayoutChange}
position="absolute"
zIndex="overlay"
style={computedPositionWithWebMarginsForBadge}
>
{badgeValue}
</Badge>
)}
{!hidden && (
<Badge
{...badgeProps}
onLayout={onBadgeLayoutChange}
position="absolute"
zIndex="overlay"
style={computedPositionWithWebMarginsForBadge}
>
{badgeValue}
</Badge>
)}
</Box>
</Box>
) as React.ReactElement<P>;
};
Expand Down

1 comment on commit 36d69f6

@vercel
Copy link

@vercel vercel bot commented on 36d69f6 Dec 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

pearl-ui – ./

pearl-ui-git-main-rohit9009.vercel.app
pearl-ui-rohit9009.vercel.app
docs.pearl-ui.dev

Please sign in to comment.