Skip to content

Commit cbef150

Browse files
authored
Merge pull request #35 from oslabs-beta/jon-chatUI
Update chat and video meeting UI & change tab icons to dynamic
2 parents 5cca29a + 48921ba commit cbef150

File tree

11 files changed

+225
-121
lines changed

11 files changed

+225
-121
lines changed

app/src/components/bottom/BottomTabs.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -78,47 +78,47 @@ const BottomTabs = (props): JSX.Element => {
7878
<Tab
7979
disableRipple
8080
classes={{ root: classes.tabRoot, selected: classes.tabSelected }}
81-
label="Creation Panel"
81+
label="Live Chat"
8282
onClick={showBottomPanel}
8383
sx={{ borderTop: '2px solid #191919' }}
8484
/>
8585
<Tab
8686
disableRipple
8787
classes={{ root: classes.tabRoot, selected: classes.tabSelected }}
88-
label="Customization"
88+
label="Creation Panel"
8989
onClick={showBottomPanel}
9090
sx={{ borderTop: '2px solid #191919' }}
9191
/>
9292
<Tab
9393
disableRipple
9494
classes={{ root: classes.tabRoot, selected: classes.tabSelected }}
95-
label="CSS Editor"
95+
label="Customization"
9696
onClick={showBottomPanel}
9797
sx={{ borderTop: '2px solid #191919' }}
9898
/>
9999
<Tab
100100
disableRipple
101101
classes={{ root: classes.tabRoot, selected: classes.tabSelected }}
102-
label="Component Tree"
102+
label="CSS Editor"
103103
onClick={showBottomPanel}
104104
sx={{ borderTop: '2px solid #191919' }}
105105
/>
106106
<Tab
107107
disableRipple
108108
classes={{ root: classes.tabRoot, selected: classes.tabSelected }}
109-
label="Context Manager"
109+
label="Component Tree"
110110
onClick={showBottomPanel}
111111
/>
112112
<Tab
113113
disableRipple
114114
classes={{ root: classes.tabRoot, selected: classes.tabSelected }}
115-
label="State Manager"
115+
label="Context Manager"
116116
onClick={showBottomPanel}
117117
/>
118118
<Tab
119119
disableRipple
120120
classes={{ root: classes.tabRoot, selected: classes.tabSelected }}
121-
label="Live Chat"
121+
label="State Manager"
122122
onClick={showBottomPanel}
123123
/>
124124
</Tabs>
@@ -155,19 +155,19 @@ const BottomTabs = (props): JSX.Element => {
155155
</div>
156156
</Box>
157157
<div className="tab-content">
158-
{tab === 0 && <CreationPanel isThemeLight={isThemeLight} />}
159-
{tab === 1 && <CustomizationPanel isThemeLight={isThemeLight} />}
160-
{tab === 2 && <StylesEditor theme={theme} setTheme={setTheme} />}
161-
{tab === 3 && <Tree data={components} />}
162-
{tab === 4 && <ContextManager theme={theme} setTheme={setTheme} />}
163-
{tab === 5 && (
158+
{tab === 0 && <Chatroom />}
159+
{tab === 1 && <CreationPanel isThemeLight={isThemeLight} />}
160+
{tab === 2 && <CustomizationPanel isThemeLight={isThemeLight} />}
161+
{tab === 3 && <StylesEditor theme={theme} setTheme={setTheme} />}
162+
{tab === 4 && <Tree data={components} />}
163+
{tab === 5 && <ContextManager theme={theme} setTheme={setTheme} />}
164+
{tab === 6 && (
164165
<StateManager
165166
theme={theme}
166167
setTheme={setTheme}
167168
isThemeLight={isThemeLight}
168169
/>
169170
)}
170-
{tab === 6 && <Chatroom />}
171171
</div>
172172
</div>
173173
</MeetingProvider>

app/src/components/bottom/ChatRoom.tsx

Lines changed: 90 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { useSelector } from 'react-redux';
33
import { RootState } from '../../redux/store';
44
import { emitEvent } from '../../helperFunctions/socket';
55
import Videomeeting from './VideoMeeting';
6+
import { Send } from '@mui/icons-material';
67

78
const Chatroom = (props): JSX.Element => {
89
const { userName, roomCode, messages, userJoinCollabRoom } = useSelector(
@@ -12,40 +13,43 @@ const Chatroom = (props): JSX.Element => {
1213
const [inputContent, setInputContent] = useState('');
1314

1415
const wrapperStyles = {
15-
border: `2px solid #f2fbf8`,
16-
borderRadius: '8px',
17-
width: '75%',
16+
border: '1px solid #31343A',
17+
borderRadius: '15px',
18+
width: '70%',
1819
height: '100%',
19-
display: 'column',
20-
padding: '20px',
21-
backgroundColor: '#42464C',
20+
display: 'flex',
21+
flexDirection: 'column',
22+
alignSelf: 'center',
23+
padding: '12px 20px',
24+
backgroundColor: '#1B1B1B',
2225
overflow: 'auto'
2326
};
2427

2528
const inputContainerStyles = {
2629
width: '100%',
27-
paddingLeft: '30px',
30+
paddingLeft: '20px',
2831
paddingTop: '10px',
2932
display: 'flex',
3033
justifyContent: 'center'
3134
};
3235

3336
const inputStyles = {
34-
width: '75%',
35-
padding: '10px',
36-
border: 'none',
37-
borderRadius: '5px',
38-
backgroundColor: '#333333',
39-
color: 'white'
37+
width: '72%',
38+
padding: '10px 12px',
39+
borderRadius: '50px',
40+
backgroundColor: '#1B1B1B',
41+
color: 'white',
42+
border: '1px solid #31343A',
43+
marginLeft: '28px'
4044
};
4145

4246
const buttonStyles = {
43-
padding: '10px',
47+
padding: '5px 7px',
4448
marginLeft: '10px',
4549
backgroundColor: '#0671E3',
4650
color: 'white',
4751
border: 'none',
48-
borderRadius: '5px',
52+
borderRadius: '50%',
4953
cursor: 'pointer'
5054
};
5155

@@ -62,10 +66,30 @@ const Chatroom = (props): JSX.Element => {
6266

6367
const handleMessageContainerStyle = (message: object) => {
6468
if (message['type'] === 'activity') {
65-
return { color: 'yellow' };
69+
return {
70+
color: '#E8E9EB',
71+
fontSize: '12px',
72+
alignSelf: 'center',
73+
margin: '3px 0'
74+
};
6675
} else {
67-
if (message['userName'] === userName) return { color: '#66C4EB' };
68-
return { color: 'white' };
76+
if (message['userName'] === userName)
77+
return {
78+
alignSelf: 'end',
79+
padding: '8px 15px',
80+
backgroundColor: '#0671E3',
81+
borderRadius: '15.5px',
82+
margin: '3px 0',
83+
maxWidth: '300px'
84+
};
85+
return {
86+
color: 'white',
87+
padding: '8px 15px',
88+
backgroundColor: '#333333',
89+
borderRadius: '15.5px',
90+
margin: '3px 0',
91+
maxWidth: '300px'
92+
};
6993
}
7094
};
7195

@@ -78,12 +102,25 @@ const Chatroom = (props): JSX.Element => {
78102
</div>
79103
);
80104
} else if (message.type === 'chat') {
81-
return (
82-
<div key={index} style={handleMessageContainerStyle(message)}>
83-
{message.userName === userName ? 'You' : message.userName}:{' '}
84-
{message.message}
85-
</div>
86-
);
105+
if (message.userName === userName) {
106+
return (
107+
<div key={index} style={handleMessageContainerStyle(message)}>
108+
{message.message}
109+
</div>
110+
);
111+
} else
112+
return (
113+
<div key={index} style={{ alignSelf: 'start' }}>
114+
<div
115+
style={{ color: '#E8E9EB', fontSize: '12px', margin: '3px 0' }}
116+
>
117+
{message.userName}
118+
</div>
119+
<div style={handleMessageContainerStyle(message)}>
120+
{message.message}
121+
</div>
122+
</div>
123+
);
87124
}
88125
return null;
89126
});
@@ -129,15 +166,16 @@ const Chatroom = (props): JSX.Element => {
129166
justifyContent: 'center',
130167
display: 'flex',
131168
flexDirection: 'column',
132-
height: '80%',
169+
height: '90%',
133170
width: '60%'
134171
}}
135172
>
136173
<div
137174
style={{
138175
justifyContent: 'center',
139176
display: 'flex',
140-
height: '90%',
177+
flexDirection: 'column',
178+
height: '100%',
141179
width: '100%'
142180
}}
143181
>
@@ -148,24 +186,32 @@ const Chatroom = (props): JSX.Element => {
148186
>
149187
{renderMessages()}
150188
</div>
151-
</div>
152-
<div className="chatroom-input">
153-
<form
154-
id="send-container"
155-
style={inputContainerStyles}
156-
onSubmit={handleSubmit}
157-
>
158-
<input
159-
type="text"
160-
id="message-input"
161-
onChange={(e) => setInputContent(e.target.value)}
162-
value={inputContent}
163-
style={inputStyles}
164-
/>
165-
<button type="submit" id="send-button" style={buttonStyles}>
166-
Send
167-
</button>
168-
</form>
189+
<div className="chatroom-input">
190+
<form
191+
id="send-container"
192+
style={inputContainerStyles}
193+
onSubmit={handleSubmit}
194+
>
195+
<input
196+
type="text"
197+
id="message-input"
198+
placeholder="message"
199+
onChange={(e) => setInputContent(e.target.value)}
200+
value={inputContent}
201+
style={inputStyles}
202+
/>
203+
<button type="submit" id="send-button" style={buttonStyles}>
204+
<Send
205+
sx={{
206+
width: '20px',
207+
height: '20px',
208+
marginLeft: '2px',
209+
marginTop: '2px'
210+
}}
211+
/>
212+
</button>
213+
</form>
214+
</div>
169215
</div>
170216
</div>
171217
)}

0 commit comments

Comments
 (0)