@@ -6,16 +6,17 @@ import FilterModal from '@components/pages/document/components/FilterModal'
66import NotificationModal from './notificationPanel/mobile/NotificationModal'
77import ChatContainerMobile from './pages/document/components/chat/ChatContainerMobile'
88import useKeyboardHeight from '@hooks/useKeyboardHeight'
9+ import { EmojiPanel } from './chat/components/EmojiPanel'
10+ import { CHAT_OPEN } from '@services/eventsHub'
911
1012const BottomSheet = ( ) => {
11- const { activeSheet, closeSheet } = useSheetStore ( )
13+ const { activeSheet, closeSheet, sheetData } = useSheetStore ( )
1214 const chatRoom = useChatStore ( ( state ) => state . chatRoom )
1315 const closeChatRoom = useChatStore ( ( state ) => state . closeChatRoom )
1416 const destroyChatRoom = useChatStore ( ( state ) => state . destroyChatRoom )
1517 const setSheetContainerRef = useSheetStore ( ( state ) => state . setSheetContainerRef )
1618 const { height : keyboardHeight } = useKeyboardHeight ( )
1719 const { deviceDetect } = useStore ( ( state ) => state . settings )
18-
1920 const isDeviceIOS = useMemo ( ( ) => {
2021 return deviceDetect ?. os ( ) === 'iOS'
2122 } , [ deviceDetect ] )
@@ -37,6 +38,12 @@ const BottomSheet = () => {
3738 return < NotificationModal />
3839 case 'filters' :
3940 return < FilterModal />
41+ case 'emojiPicker' :
42+ return (
43+ < EmojiPanel variant = "mobile" >
44+ < EmojiPanel . Selector />
45+ </ EmojiPanel >
46+ )
4047 default :
4148 return null
4249 }
@@ -53,7 +60,13 @@ const BottomSheet = () => {
5360 return {
5461 id : 'chatroom_sheet' ,
5562 detent : 'full-height' as SheetProps [ 'detent' ] ,
56- disableScrollLocking : true
63+ disableScrollLocking : true ,
64+ disableDrag : true
65+ }
66+ case 'emojiPicker' :
67+ return {
68+ id : 'emoji_picker_sheet' ,
69+ detent : 'content-height' as SheetProps [ 'detent' ]
5770 }
5871 default :
5972 return {
@@ -73,9 +86,7 @@ const BottomSheet = () => {
7386 return {
7487 style : {
7588 paddingBottom : isDeviceIOS ? keyboardHeight : 0
76- } ,
77- disableDrag : true ,
78- disableScrollLocking : true
89+ }
7990 }
8091 default :
8192 return { }
@@ -86,12 +97,21 @@ const BottomSheet = () => {
8697 if ( activeSheet === 'chatroom' ) {
8798 closeChatRoom ( )
8899 destroyChatRoom ( )
100+ } else if ( activeSheet === 'emojiPicker' && sheetData . chatRoomState ) {
101+ const { headingId } = sheetData . chatRoomState
102+ closeSheet ( )
103+ setTimeout ( ( ) => {
104+ PubSub . publish ( CHAT_OPEN , {
105+ headingId : headingId ,
106+ focusEditor : true ,
107+ clearSheetState : true
108+ } )
109+ } , 100 )
110+ } else {
111+ closeSheet ( )
89112 }
90- closeSheet ( )
91113 }
92114
93- if ( ! activeSheet ) return null
94-
95115 return (
96116 < Sheet
97117 className = "bottom-sheet"
0 commit comments