Skip to content
Open
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ import { MessageBox } from 'react-chat-elements'
| forwarded | none | boolean | message forward icon |
| replyButton | none | boolean | message reply icon |
| removeButton | none | boolean | message remove icon |
| status | none | string | message status info (waiting, sent, received, read) |
| status | none | string | message status info (waiting, sent, received, read, error) |
| notch | true | boolean | message box notch |
| avatar | none | url | message box avatar url |
| renderAddCmp | none | function (component) | adding custom components to message box |
Expand Down
2 changes: 1 addition & 1 deletion example/components/MessageListExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function MessageListExample() {
break
case 1:
Addmtype = 'file'
setStatus('sent')
setStatus('error')
break
case 2:
Addmtype = 'system'
Expand Down
2 changes: 1 addition & 1 deletion example/utils/MessageTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const fileMessage: MessageType = {
},
size: '100MB',
},
status: 'sent',
status: 'error',
statusTitle: token() >= 5 ? 'Desktop' : 'Mobile',
id: String(Math.random()),
position: token() >= 1 ? 'right' : 'left',
Expand Down
4 changes: 3 additions & 1 deletion src/MessageBox/MessageBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import Avatar from '../Avatar/Avatar'

import { RiShareForwardFill } from 'react-icons/ri'
import { IoIosDoneAll } from 'react-icons/io'
import { MdAccessTime, MdCheck, MdMessage, MdDelete, MdBlock, MdDoneAll } from 'react-icons/md'
import { MdAccessTime, MdCheck, MdMessage, MdDelete, MdBlock, MdDoneAll, MdError } from 'react-icons/md'
import { TiArrowForward } from 'react-icons/ti'

import { format } from 'timeago.js'
Expand Down Expand Up @@ -193,6 +193,8 @@ const MessageBox: React.FC<MessageBoxType> = ({ focus = false, notch = true, sty
{props.status === 'received' && <IoIosDoneAll />}

{props.status === 'read' && <MdDoneAll color='#4FC3F7' />}

{props.status === 'error' && <MdError color='#FF0B0B' />}
</span>
)}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/type.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export interface IMessage {
forwarded: boolean
replyButton: boolean
removeButton: boolean
status: 'waiting' | 'sent' | 'received' | 'read'
status: 'waiting' | 'sent' | 'received' | 'read' | 'error'
statusTitle?: string
notch: boolean
copiableDate?: boolean
Expand Down