Skip to content

Commit 0e8675e

Browse files
authored
Merge pull request #16 from oslabs-beta/rose
Rose
2 parents ba0ef8b + 9c28a57 commit 0e8675e

File tree

4 files changed

+32
-6
lines changed

4 files changed

+32
-6
lines changed

app/src/components/left/HTMLPanel.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,11 @@ const HTMLPanel = (props): JSX.Element => {
144144
};
145145

146146
const handleCreateElement = useCallback((e) => {
147-
if (e.key === 'Enter' && e.target.tagName !== 'TEXTAREA') {
147+
if (
148+
e.key === 'Enter' &&
149+
e.target.tagName !== 'TEXTAREA' &&
150+
e.target.id !== 'filled-hidden-label-small'
151+
) {
148152
e.preventDefault();
149153
document.getElementById('submitButton').click();
150154
}

app/src/components/left/RoomsContainer.tsx

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

165-
const userColors = ['#FC00BD', '#D0FC00', '#00DBFC', '#FD98B8', '#FCAA00', '#9267FF'];
165+
const handleKeyDown = (e) => {
166+
if (e.key === 'Enter' && e.target.id === 'filled-hidden-label-small') {
167+
e.preventDefault();
168+
joinRoom();
169+
}
170+
};
171+
const userColors = [
172+
'#FC00BD',
173+
'#D0FC00',
174+
'#00DBFC',
175+
'#FD98B8',
176+
'#FCAA00',
177+
'#9267FF'
178+
];
166179

167180
return (
168181
<div>
@@ -232,7 +245,7 @@ const RoomsContainer = () => {
232245
primary={`${index + 1}. ${
233246
index === 0 ? `${user} (host)` : user
234247
}`}
235-
style={{color: userColors[userList.indexOf(user)]}}
248+
style={{ color: userColors[userList.indexOf(user)] }}
236249
/>
237250
</ListItem>
238251
))}
@@ -274,6 +287,8 @@ const RoomsContainer = () => {
274287
value={roomCode}
275288
placeholder="Input Room Number"
276289
onChange={(e) => dispatch(setRoomCode(e.target.value))}
290+
className="enterRoomInput"
291+
onKeyDown={handleKeyDown}
277292
/>
278293
<Button
279294
variant="contained"

app/src/components/main/Canvas.tsx

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

243-
const userColors = ['#FC00BD', '#D0FC00', '#00DBFC', '#FD98B8', '#FCAA00', '#9267FF'];
243+
const userColors = [
244+
'#FC00BD',
245+
'#D0FC00',
246+
'#00DBFC',
247+
'#FD98B8',
248+
'#FCAA00',
249+
'#9267FF'
250+
];
244251

245252
return (
246253
<div

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)