Skip to content

Commit b1d259b

Browse files
committed
add bottom tabs change
1 parent 156ded8 commit b1d259b

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

app/src/components/bottom/BottomTabs.tsx

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import CustomizationPanel from '../../containers/CustomizationPanel';
88
import CreationPanel from './CreationPanel';
99
import ContextManager from '../ContextAPIManager/ContextManager';
1010
import StateManager from '../StateManagement/StateManagement';
11+
import Chatroom from './chatRoom';
1112
import Box from '@mui/material/Box';
1213
import Tree from '../../tree/TreeChart';
1314
import FormControl from '@mui/material/FormControl';
@@ -29,6 +30,8 @@ const BottomTabs = (props): JSX.Element => {
2930

3031
const state = useSelector((store: RootState) => store.appState);
3132
const contextParam = useSelector((store: RootState) => store.contextSlice);
33+
const collaborationRoom = useSelector((store: RootState) => store.roomSlice);
34+
// {roomCode: '', userName: '', userList: Array(0), userJoined: false}
3235

3336
const [tab, setTab] = useState(0);
3437
const classes = useStyles();
@@ -57,7 +60,7 @@ const BottomTabs = (props): JSX.Element => {
5760
zIndex: 1,
5861
borderTop: '2px solid grey'
5962
}}
60-
onClick={() => {
63+
onMouseOver={() => {
6164
props.setBottomShow(true);
6265
}}
6366
>
@@ -105,6 +108,11 @@ const BottomTabs = (props): JSX.Element => {
105108
classes={{ root: classes.tabRoot, selected: classes.tabSelected }}
106109
label="State Manager"
107110
/>
111+
<Tab
112+
disableRipple
113+
classes={{ root: classes.tabRoot, selected: classes.tabSelected }}
114+
label="Live Chat"
115+
/>
108116
</Tabs>
109117
<div className={classes.projectTypeWrapper}>
110118
<FormControl size="small">
@@ -143,6 +151,23 @@ const BottomTabs = (props): JSX.Element => {
143151
isThemeLight={props.isThemeLight}
144152
/>
145153
)}
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+
))}
146171
</div>
147172
</div>
148173
);

0 commit comments

Comments
 (0)