Skip to content

Commit

Permalink
fix(components): fix margin when there is no icon
Browse files Browse the repository at this point in the history
  • Loading branch information
claire2212 committed Nov 28, 2024
1 parent b667ea0 commit 4d0edd6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/Message/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ export function Message({
return (
<Box $level={level} className={controlledClassName} {...nativeProps}>
{!withoutIcon && <ControlledIcon color={controlledIconColor} />}
<ChildrenContainer>{children}</ChildrenContainer>
<ChildrenContainer $withMargin={!withoutIcon}>{children}</ChildrenContainer>
</Box>
)
}

const ChildrenContainer = styled.div`
margin-left: 8px;
const ChildrenContainer = styled.div<{ $withMargin: boolean }>`
margin-left: ${({ $withMargin }) => ($withMargin ? 8 : 0)}px;
display: flex;
flex-direction: column;
flex: 1;
Expand Down

0 comments on commit 4d0edd6

Please sign in to comment.