Skip to content

Commit ba0ef8b

Browse files
authored
Merge pull request #15 from oslabs-beta/laura
Cursor color matching and multi-users in collab room
2 parents 671f5d7 + e3a304e commit ba0ef8b

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

app/src/components/left/RoomsContainer.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ const RoomsContainer = () => {
162162
return userName.length === 0 || roomCode.length === 0;
163163
}
164164

165+
const userColors = ['#FC00BD', '#D0FC00', '#00DBFC', '#FD98B8', '#FCAA00', '#9267FF'];
166+
165167
return (
166168
<div>
167169
<Stack //stack styling for container
@@ -178,7 +180,7 @@ const RoomsContainer = () => {
178180
<Typography variant="h5" color={'#f2fbf8'}>
179181
Live Room: {roomCode}
180182
</Typography>
181-
<Typography variant="h6" color={'#70d8be'}>
183+
<Typography variant="h6" color={userColors[userList.indexOf(userName)]}>
182184
Nickname: {userName}
183185
</Typography>
184186
{/* Set up condition rendering depends on if user joined a room then render leave button if not render join button */}
@@ -221,15 +223,16 @@ const RoomsContainer = () => {
221223
<ListItem
222224
key={index}
223225
sx={{
224-
color: '#f2fbf8',
225226
textAlign: 'center',
226-
width: '100%'
227+
width: '100%',
228+
color: '#f2fbf8'
227229
}}
228230
>
229231
<ListItemText
230232
primary={`${index + 1}. ${
231233
index === 0 ? `${user} (host)` : user
232234
}`}
235+
style={{color: userColors[userList.indexOf(user)]}}
233236
/>
234237
</ListItem>
235238
))}

app/src/components/main/Canvas.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,8 @@ function Canvas(props: {}): JSX.Element {
240240
currentComponent.style
241241
);
242242

243+
const userColors = ['#FC00BD', '#D0FC00', '#00DBFC', '#FD98B8', '#FCAA00', '#9267FF'];
244+
243245
return (
244246
<div
245247
className={'componentContainer'}
@@ -262,8 +264,8 @@ function Canvas(props: {}): JSX.Element {
262264
left: cursor.x + 'px',
263265
top: cursor.y - 68 + 'px',
264266
//cursor style
265-
fontSize: '40px',
266-
color: '#46c0a5'
267+
fontSize: '2em',
268+
color: userColors[userList.indexOf(cursor.remoteUserName)]
267269
}}
268270
>
269271
{<GiBoba />}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "reactype",
3-
"version": "18.0.0 by Sonya Hu, Hadrian Chan, Nam Ha, Rick McGrath",
3+
"version": "19.0.0 by Rose Jiang, Laura Forden, Lauren Leer, Sean Kil",
44
"description": "Prototyping tool for React/Typescript Applications.",
55
"private": true,
66
"main": "app/.electron/main.js",

0 commit comments

Comments
 (0)