1
- import React , { ReactElement , ReactNode , RefObject , useEffect , useRef , useState } from 'react' ;
1
+ import React , { Children , ReactElement , ReactNode , RefObject , useEffect , useRef , useState } from 'react' ;
2
2
import { createPortal } from 'react-dom' ;
3
3
4
4
import SortByRow from '../SortByRow' ;
5
5
import { Nullable } from '../../types' ;
6
6
import { EMOJI_MENU_ROOT_ID , MENU_OBSERVING_CLASS_NAME } from '.' ;
7
7
import { APP_LAYOUT_ROOT } from '../../modules/App/const' ;
8
+ import { Label , LabelColors , LabelTypography } from '../Label' ;
8
9
9
10
const defaultParentRect = { x : 0 , y : 0 , left : 0 , top : 0 , height : 0 } ;
10
11
type SpaceFromTrigger = { x : number , y : number } ;
@@ -96,7 +97,7 @@ export const EmojiListItems = ({
96
97
}
97
98
setReactionStyle ( reactionStyle ) ;
98
99
}
99
- } , [ ] ) ;
100
+ } , [ children ] ) ;
100
101
101
102
const rootElement = document . getElementById ( EMOJI_MENU_ROOT_ID ) ;
102
103
if ( rootElement ) {
@@ -115,14 +116,26 @@ export const EmojiListItems = ({
115
116
top : `${ Math . round ( reactionStyle . top ) } px` ,
116
117
} }
117
118
>
118
- < SortByRow
119
- className = "sendbird-dropdown__reaction-bar__row"
120
- maxItemCount = { 8 }
121
- itemWidth = { 44 }
122
- itemHeight = { 40 }
123
- >
124
- { children }
125
- </ SortByRow >
119
+ { Children . count ( children ) <= 0
120
+ ? (
121
+ < Label
122
+ className = "sendbird-dropdown__reaction-bar__emptyLabel"
123
+ type = { LabelTypography . BODY_1 }
124
+ color = { LabelColors . ONBACKGROUND_1 }
125
+ >
126
+ Emojis is not loaded yet.
127
+ </ Label >
128
+ ) : (
129
+ < SortByRow
130
+ className = "sendbird-dropdown__reaction-bar__row"
131
+ maxItemCount = { 8 }
132
+ itemWidth = { 44 }
133
+ itemHeight = { 40 }
134
+ >
135
+ { children }
136
+ </ SortByRow >
137
+ )
138
+ }
126
139
</ ul >
127
140
</ div > ,
128
141
rootElement ,
0 commit comments