Skip to content

Commit

Permalink
bug: Fixed a bug where sender name is overflowing in a bot message. (#…
Browse files Browse the repository at this point in the history
…209)

- Fixed a bug where sender name is overflowing in a bot message
  • Loading branch information
liamcho authored May 10, 2024
1 parent aca1030 commit f98f804
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/components/BotMessageWithBodyInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@ const Root = styled.span`
position: relative;
`;

const Sender = styled(Label)`
margin: 0 0 4px 12px;
const Sender = styled.div`
padding: 0 0 4px 12px;
text-align: left;
overflow: hidden;
text-overflow: ellipsis;
width: calc(
100% - 12px - 56px
); // -12 for left margin and -56 for timestamp min width.
`;

const Content = styled.div`
Expand Down Expand Up @@ -93,11 +98,13 @@ export default function BotMessageWithBodyInput(props: Props) {
)}
<BodyContainer>
{displaySender && (
<Sender
type={LabelTypography.CAPTION_2}
color={LabelColors.ONBACKGROUND_2}
>
{botNickname}
<Sender>
<Label
type={LabelTypography.CAPTION_2}
color={LabelColors.ONBACKGROUND_2}
>
{botNickname}
</Label>
</Sender>
)}
<Content>
Expand Down

0 comments on commit f98f804

Please sign in to comment.