Skip to content

Commit

Permalink
[CAI-240] Fix out of bound text for long words (#1218)
Browse files Browse the repository at this point in the history
* fix long words exiting the screen

* add changeset
  • Loading branch information
MarBert authored Oct 31, 2024
1 parent acae444 commit d5d09b6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/smart-chicken-kick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"nextjs-website": patch
---

Fix chat messages with long words from going off the screen
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ const ChatHistoryMessage = ({
component='span'
minWidth='12rem'
fontWeight={600}
sx={{ fontSize: { xs: '1rem', xl: '1.125rem' } }}
sx={{
fontSize: { xs: '1rem', xl: '1.125rem' },
overflowWrap: 'break-word',
}}
>
{sender}
</Typography>
Expand All @@ -92,7 +95,10 @@ const ChatHistoryMessage = ({
marginLeft={'1rem'}
paragraph
width={'100%'}
sx={{ fontSize: { xs: '0.875rem', xl: '1rem' } }}
sx={{
fontSize: { xs: '0.875rem', xl: '1rem' },
overflowWrap: 'break-word',
}}
>
{parsedChatMessage}
</Typography>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ const ChatbotHistoryDetailLayout = ({
</Button>
</DialogActions>
</Dialog>
<Typography variant='h4'>{firstQuery.question}</Typography>
<Typography variant='h4' sx={{ overflowWrap: 'break-word' }}>
{firstQuery.question}
</Typography>
<Stack direction='row' justifyContent='space-between'>
<Typography
component='span'
Expand Down

0 comments on commit d5d09b6

Please sign in to comment.