Skip to content

Commit

Permalink
feat: add str-chat__simple-message--error-failed class to str-chat__m…
Browse files Browse the repository at this point in the history
…essage-inner
  • Loading branch information
MartinCupela committed Aug 2, 2022
1 parent 6e6fce5 commit a5f8f94
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions src/components/Message/MessageSimple.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ const MessageSimpleWithContext = <

const showMetadata = !groupedByUser || endOfGroup;
const showReplyCountButton = !threadList && !!message.reply_count;
const allowRetry = message.status === 'failed' && message.errorStatusCode !== 403;

const rootClassName = clsx(
'str-chat__message str-chat__message-simple',
Expand Down Expand Up @@ -134,18 +135,12 @@ const MessageSimpleWithContext = <
/>
)}
<div
className='str-chat__message-inner'
className={clsx('str-chat__message-inner', {
'str-chat__simple-message--error-failed': allowRetry,
})}
data-testid='message-inner'
onClick={
message.status === 'failed' && message.errorStatusCode !== 403
? () => handleRetry(message)
: undefined
}
onKeyUp={
message.status === 'failed' && message.errorStatusCode !== 403
? () => handleRetry(message)
: undefined
}
onClick={allowRetry ? () => handleRetry(message) : undefined}
onKeyUp={allowRetry ? () => handleRetry(message) : undefined}
>
<MessageOptions />
<div className='str-chat__message-reactions-host'>
Expand Down

0 comments on commit a5f8f94

Please sign in to comment.