Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix-fallback-body-styling.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
default: patch
---

Fixed the text wrapping behavior of fallback messages.
38 changes: 30 additions & 8 deletions src/app/components/message/content/FallbackContent.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Box, Icon, Icons, Text, as, color, config } from 'folds';

import { BreakWord } from '$styles/Text.css';

const warningStyle = { color: color.Warning.Main, opacity: config.opacity.P300 };
const criticalStyle = { color: color.Critical.Main, opacity: config.opacity.P300 };

Expand All @@ -18,11 +20,21 @@ export const MessageDeletedContent = as<'div', { children?: never; reason?: stri

export const MessageUnsupportedContent = as<'div', { children?: never; body?: string }>(
({ body, ...props }, ref) => (
<Box as="span" alignItems="Center" gap="100" style={criticalStyle} {...props} ref={ref}>
<Box
as="span"
alignItems="Center"
direction="Row"
gap="100"
style={criticalStyle}
{...props}
ref={ref}
>
<Icon size="50" src={Icons.Warning} />
<i>Unsupported message</i>
{body && `: ${body}`}
{!body && ' (no body)'}
<span className={BreakWord} style={{ flex: '1 1 auto', minWidth: 0 }}>
<i>Unsupported message</i>
{body && `: ${body}`}
{!body && ' (no body)'}
</span>
</Box>
)
);
Expand Down Expand Up @@ -51,11 +63,21 @@ export const MessageNotDecryptedContent = as<'div', { children?: never }>(({ ...
// display body of the message if it is available, as it may give some clue about why the message is broken
export const MessageBrokenContent = as<'div', { children?: never; body?: string }>(
({ body, ...props }, ref) => (
<Box as="span" alignItems="Center" gap="100" style={criticalStyle} {...props} ref={ref}>
<Box
as="span"
alignItems="Center"
direction="Row"
gap="100"
style={criticalStyle}
{...props}
ref={ref}
>
<Icon size="50" src={Icons.Warning} />
<i>Broken message</i>
{body && `: ${body}`}
{!body && ' (no body)'}
<span className={BreakWord} style={{ flex: '1 1 auto', minWidth: 0 }}>
<i>Broken message</i>
{body && `: ${body}`}
{!body && ' (no body)'}
</span>
</Box>
)
);
Expand Down
Loading