1- import React , { ReactElement , ReactNode , RefObject , useEffect , useRef , useState } from 'react' ;
1+ import React , { Children , ReactElement , ReactNode , RefObject , useEffect , useRef , useState } from 'react' ;
22import { createPortal } from 'react-dom' ;
33
44import SortByRow from '../SortByRow' ;
55import { Nullable } from '../../types' ;
66import { EMOJI_MENU_ROOT_ID , MENU_OBSERVING_CLASS_NAME } from '.' ;
77import { APP_LAYOUT_ROOT } from '../../modules/App/const' ;
8+ import { Label , LabelColors , LabelTypography } from '../Label' ;
89
910const defaultParentRect = { x : 0 , y : 0 , left : 0 , top : 0 , height : 0 } ;
1011type SpaceFromTrigger = { x : number , y : number } ;
@@ -96,7 +97,7 @@ export const EmojiListItems = ({
9697 }
9798 setReactionStyle ( reactionStyle ) ;
9899 }
99- } , [ ] ) ;
100+ } , [ children ] ) ;
100101
101102 const rootElement = document . getElementById ( EMOJI_MENU_ROOT_ID ) ;
102103 if ( rootElement ) {
@@ -115,14 +116,26 @@ export const EmojiListItems = ({
115116 top : `${ Math . round ( reactionStyle . top ) } px` ,
116117 } }
117118 >
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+ }
126139 </ ul >
127140 </ div > ,
128141 rootElement ,
0 commit comments