@@ -8,6 +8,7 @@ import CustomizationPanel from '../../containers/CustomizationPanel';
8
8
import CreationPanel from './CreationPanel' ;
9
9
import ContextManager from '../ContextAPIManager/ContextManager' ;
10
10
import StateManager from '../StateManagement/StateManagement' ;
11
+ import Chatroom from './chatRoom' ;
11
12
import Box from '@mui/material/Box' ;
12
13
import Tree from '../../tree/TreeChart' ;
13
14
import FormControl from '@mui/material/FormControl' ;
@@ -29,6 +30,8 @@ const BottomTabs = (props): JSX.Element => {
29
30
30
31
const state = useSelector ( ( store : RootState ) => store . appState ) ;
31
32
const contextParam = useSelector ( ( store : RootState ) => store . contextSlice ) ;
33
+ const collaborationRoom = useSelector ( ( store : RootState ) => store . roomSlice ) ;
34
+ // {roomCode: '', userName: '', userList: Array(0), userJoined: false}
32
35
33
36
const [ tab , setTab ] = useState ( 0 ) ;
34
37
const classes = useStyles ( ) ;
@@ -57,7 +60,7 @@ const BottomTabs = (props): JSX.Element => {
57
60
zIndex : 1 ,
58
61
borderTop : '2px solid grey'
59
62
} }
60
- onClick = { ( ) => {
63
+ onMouseOver = { ( ) => {
61
64
props . setBottomShow ( true ) ;
62
65
} }
63
66
>
@@ -105,6 +108,11 @@ const BottomTabs = (props): JSX.Element => {
105
108
classes = { { root : classes . tabRoot , selected : classes . tabSelected } }
106
109
label = "State Manager"
107
110
/>
111
+ < Tab
112
+ disableRipple
113
+ classes = { { root : classes . tabRoot , selected : classes . tabSelected } }
114
+ label = "Live Chat"
115
+ />
108
116
</ Tabs >
109
117
< div className = { classes . projectTypeWrapper } >
110
118
< FormControl size = "small" >
@@ -143,6 +151,23 @@ const BottomTabs = (props): JSX.Element => {
143
151
isThemeLight = { props . isThemeLight }
144
152
/>
145
153
) }
154
+ { tab === 6 &&
155
+ ( collaborationRoom . userJoined ? (
156
+ < Chatroom />
157
+ ) : (
158
+ < div
159
+ style = { {
160
+ display : 'flex' ,
161
+ justifyContent : 'center' ,
162
+ alignItems : 'center' ,
163
+ height : '100%'
164
+ } }
165
+ >
166
+ < p style = { { color : 'white' , fontSize : '18px' } } >
167
+ Please join a collaboration room to enable this function
168
+ </ p >
169
+ </ div >
170
+ ) ) }
146
171
</ div >
147
172
</ div >
148
173
) ;
0 commit comments