Skip to content

Commit

Permalink
fix displaying message warning
Browse files Browse the repository at this point in the history
  • Loading branch information
przemvs committed Feb 28, 2024
1 parent 19f3269 commit 4727f52
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,6 @@ export const ContentMessageComponent = ({
/>
)}

{[StatusType.FAILED, StatusType.FEDERATION_ERROR].includes(status) && (
<CompleteFailureToSendWarning
{...(status === StatusType.FEDERATION_ERROR && {unreachableDomain: conversation.domain})}
isMessageFocused={msgFocusState}
onRetry={() => onRetry(message)}
/>
)}

{isAssetMessage && (
<ReadIndicator
message={message}
Expand All @@ -274,6 +266,14 @@ export const ContentMessageComponent = ({
)}
</div>

{[StatusType.FAILED, StatusType.FEDERATION_ERROR].includes(status) && (
<CompleteFailureToSendWarning
{...(status === StatusType.FEDERATION_ERROR && {unreachableDomain: conversation.domain})}
isMessageFocused={msgFocusState}
onRetry={() => onRetry(message)}
/>
)}

{!!reactions.length && (
<MessageReactionsList
reactions={reactions}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const config = Config.getConfig();
export const CompleteFailureToSendWarning = ({isMessageFocused, onRetry, unreachableDomain}: Props) => {
const messageFocusedTabIndex = useMessageFocusedTabIndex(isMessageFocused);
return (
<>
<div className="message-warning">
{unreachableDomain ? (
<p>
<span
Expand Down Expand Up @@ -64,6 +64,6 @@ export const CompleteFailureToSendWarning = ({isMessageFocused, onRetry, unreach
{t('messageCouldNotBeSentRetry')}
</Button>
</div>
</>
</div>
);
};
9 changes: 9 additions & 0 deletions src/style/content/conversation/message-list.less
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,15 @@
outline-offset: 0.4rem;
}

.message-warning {
padding-left: var(--conversation-message-sender-width);
margin-top: 6px;

button {
margin-block: 4px 0;
}
}

// MESSAGE - BODY
.message-body {
position: relative;
Expand Down

0 comments on commit 4727f52

Please sign in to comment.