Skip to content

Commit 3a5586e

Browse files
author
Emre Güdür
committed
MessageListExample fixes, MessageBox status design changes
1 parent fd1091e commit 3a5586e

4 files changed

Lines changed: 17 additions & 10 deletions

File tree

example/components/MessageListExample.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,28 +36,30 @@ function MessageListExample() {
3636
switch (data) {
3737
case 0:
3838
Addmtype = 'photo'
39-
setStatus('sent')
39+
setStatus('waiting')
4040
break
4141
case 1:
4242
Addmtype = 'file'
4343
setStatus('sent')
4444
break
4545
case 2:
4646
Addmtype = 'system'
47-
setStatus('received')
4847
break
4948
case 3:
5049
Addmtype = 'location'
50+
setStatus('received')
5151
break
5252
case 4:
5353
Addmtype = 'spotify'
54+
setStatus('waiting')
5455
break
5556
case 5:
5657
Addmtype = 'meeting'
58+
setStatus('sent')
5759
break
5860
case 6:
5961
Addmtype = 'video'
60-
setStatus('sent')
62+
setStatus('read')
6163
break
6264
case 7:
6365
Addmtype = 'audio'

example/utils/MessageTypes.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const photoMessage: MessageType = {
1616
retracted: false,
1717
text: loremIpsum({ count: 1, units: 'sentences' }),
1818
titleColor: getRandomColor(),
19-
status: 'sent',
19+
status: 'waiting',
2020
data: {
2121
uri: `data:image/png;base64,${photo(150)}`,
2222
status: {
@@ -80,7 +80,7 @@ export const fileMessage: MessageType = {
8080
},
8181
size: '100MB',
8282
},
83-
status: 'read',
83+
status: 'sent',
8484
id: String(Math.random()),
8585
position: token() >= 1 ? 'right' : 'left',
8686
text: loremIpsum({ count: 1, units: 'sentences' }),
@@ -147,7 +147,7 @@ export const spotifyMessage: MessageType = {
147147
copiableDate: true,
148148
retracted: false,
149149
className: '',
150-
status: 'received',
150+
status: 'read',
151151
theme: 'white',
152152
view: 'list',
153153
width: 300,

src/MessageBox/MessageBox.css

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,12 @@
208208
}
209209

210210
.rce-mbox-time {
211+
display: flex;
212+
justify-content: flex-end;
213+
align-items: center;
211214
text-align: right;
212215
color: rgba(0, 0, 0, 0.45);
213216
font-size: 12px;
214-
position: absolute;
215217
right: -4px;
216218
bottom: -5px;
217219
}
@@ -221,7 +223,9 @@
221223
}
222224

223225
.rce-mbox-time-block {
224-
/*position: relative;*/
226+
display: flex;
227+
align-items: center;
228+
justify-content: flex-end;
225229
right: 0;
226230
bottom: 0;
227231
left: 0;
@@ -320,6 +324,7 @@
320324
.rce-mbox-status {
321325
margin-left: 3px;
322326
font-size: 15px;
327+
height: 15px;
323328
}
324329

325330
.rce-mbox-title > .rce-avatar-container {

src/MessageBox/MessageBox.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import Avatar from '../Avatar/Avatar'
1616

1717
import { RiShareForwardFill } from 'react-icons/ri'
1818
import { IoIosDoneAll } from 'react-icons/io'
19-
import { MdAccessTime, MdCheck, MdMessage, MdDelete, MdBlock } from 'react-icons/md'
19+
import { MdAccessTime, MdCheck, MdMessage, MdDelete, MdBlock, MdDoneAll } from 'react-icons/md'
2020

2121
import { format } from 'timeago.js'
2222

@@ -176,7 +176,7 @@ const MessageBox: React.FC<MessageBoxType> = ({ focus = false, notch = true, ...
176176

177177
{props.status === 'received' && <IoIosDoneAll />}
178178

179-
{props.status === 'read' && <IoIosDoneAll color='#4FC3F7' />}
179+
{props.status === 'read' && <MdDoneAll color='#4FC3F7' />}
180180
</span>
181181
)}
182182
</div>

0 commit comments

Comments
 (0)