11import Identicon from 'identicon.js'
22import loremIpsum from 'lorem-ipsum'
33import React , { useEffect , useState } from 'react'
4- import { FaSquare } from 'react-icons/fa'
5- import { MdOutlineMoreVert } from 'react-icons/md'
4+ import { BsListTask } from 'react-icons/bs'
65import ChatList from '../../src/ChatList/ChatList'
7- import Dropdown from '../../src/Dropdown/Dropdown'
86import SideBar from '../../src/SideBar/SideBar'
7+ import { IChatItemProps } from '../../src/type'
8+
9+ function Test ( params : any ) {
10+ return (
11+ < div className = 'rce-citem-body--bottom-status-icon' onClick = { ( ) => console . log ( 'clicked' ) } >
12+ < span
13+ style = { {
14+ 'fontSize' : '10px' ,
15+ 'position' : 'absolute' ,
16+ 'padding' : '2px' ,
17+ 'right' : '-12px' ,
18+ 'top' : '-6px' ,
19+ 'background' : 'red' ,
20+ 'color' : 'white' ,
21+ 'borderRadius' : '100%' ,
22+ 'width' : '12px' ,
23+ 'height' : '12px' ,
24+ 'textAlign' : 'center' ,
25+ } }
26+ >
27+ { Math . ceil ( Math . random ( ) * 9 ) + 1 }
28+ </ span >
29+ < BsListTask />
30+ </ div >
31+ )
32+ }
933
1034function ChatListExample ( ) {
1135 const photo = ( size : number ) => {
@@ -15,7 +39,7 @@ function ChatListExample() {
1539 } ) . toString ( )
1640 }
1741
18- const [ chatListAray , setChatListAray ] = useState ( [
42+ const [ chatListAray , setChatListAray ] = useState < IChatItemProps [ ] > ( [
1943 {
2044 id : String ( Math . random ( ) ) ,
2145 avatar : `data:image/png;base64,${ photo ( 20 ) } ` ,
@@ -30,50 +54,7 @@ function ChatListExample() {
3054 muted : Math . floor ( ( Math . random ( ) * 10 ) % 2 ) === 1 ,
3155 showMute : Math . floor ( ( Math . random ( ) * 10 ) % 2 ) === 1 ,
3256 showVideoCall : Math . floor ( ( Math . random ( ) * 10 ) % 2 ) === 1 ,
33- dropdownMenu : (
34- < Dropdown
35- onSelect = { ( ) => { } }
36- animationPosition = 'norteast'
37- title = 'Dropdown Title'
38- buttonProps = { {
39- type : 'transparent' ,
40- color : '#cecece' ,
41- icon : {
42- component : < MdOutlineMoreVert /> ,
43- size : 24 ,
44- } ,
45- } }
46- items = { [
47- {
48- icon : {
49- component : < FaSquare /> ,
50- float : 'left' ,
51- color : 'red' ,
52- size : 22 ,
53- } ,
54- text : 'Menu Item' ,
55- } ,
56- {
57- icon : {
58- component : < FaSquare /> ,
59- float : 'left' ,
60- color : 'purple' ,
61- size : 22 ,
62- } ,
63- text : 'Menu Item' ,
64- } ,
65- {
66- icon : {
67- component : < FaSquare /> ,
68- float : 'left' ,
69- color : 'yellow' ,
70- size : 22 ,
71- } ,
72- text : 'Menu Item' ,
73- } ,
74- ] }
75- />
76- ) ,
57+ customStatusComponents : [ Test ] ,
7758 } ,
7859 ] )
7960
@@ -95,50 +76,7 @@ function ChatListExample() {
9576 muted : Math . floor ( ( Math . random ( ) * 10 ) % 2 ) === 1 ,
9677 showMute : Math . floor ( ( Math . random ( ) * 10 ) % 2 ) === 1 ,
9778 showVideoCall : Math . floor ( ( Math . random ( ) * 10 ) % 2 ) === 1 ,
98- dropdownMenu : (
99- < Dropdown
100- onSelect = { ( ) => { } }
101- animationPosition = 'norteast'
102- title = 'Dropdown Title'
103- buttonProps = { {
104- type : 'transparent' ,
105- color : '#cecece' ,
106- icon : {
107- component : < MdOutlineMoreVert /> ,
108- size : 24 ,
109- } ,
110- } }
111- items = { [
112- {
113- icon : {
114- component : < FaSquare /> ,
115- float : 'left' ,
116- color : 'red' ,
117- size : 22 ,
118- } ,
119- text : 'Menu Item' ,
120- } ,
121- {
122- icon : {
123- component : < FaSquare /> ,
124- float : 'left' ,
125- color : 'purple' ,
126- size : 22 ,
127- } ,
128- text : 'Menu Item' ,
129- } ,
130- {
131- icon : {
132- component : < FaSquare /> ,
133- float : 'left' ,
134- color : 'yellow' ,
135- size : 22 ,
136- } ,
137- text : 'Menu Item' ,
138- } ,
139- ] }
140- />
141- ) ,
79+ customStatusComponents : [ Test ] ,
14280 } ,
14381 ] )
14482 } , [ chatListAray ] )
0 commit comments