Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,7 @@ JWT_SECRET=your-secret-key

## License

Private — All rights reserved
Private — All rights reserved


- Join Room page supports Enter-key submission and improved accessibility guidance for room-code entry.
32 changes: 30 additions & 2 deletions frontend/src/pages/JoinRoomPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ function JoinRoomPage() {
const [error, setError] = useState('')
const [joinedRoom, setJoinedRoom] = useState(null)
const [isFocused, setIsFocused] = useState(false)
const [showCode, setShowCode] = useState(false)

useEffect(() => {
if (token) {
Expand Down Expand Up @@ -185,11 +186,17 @@ function JoinRoomPage() {

<div style={{ marginBottom: '24px' }}>
<input
type="text"
type={showCode ? 'text' : 'password'}
value={roomCode}
onChange={(e) => setRoomCode(e.target.value.toUpperCase().replace(/[^A-Z0-9]/g, ''))}
onFocus={() => setIsFocused(true)}
onBlur={() => setIsFocused(false)}

onKeyDown={(e) => {
if (e.key === 'Enter' && !isDisabled) {
handleJoinRoom()
}
}}
placeholder="XXXXXX"
maxLength={6}
style={{
Expand All @@ -208,7 +215,28 @@ function JoinRoomPage() {
boxShadow: isFocused ? '0 0 0 4px rgba(59,130,246,0.15)' : 'none',
transition: 'border-color 0.15s ease, box-shadow 0.15s ease'
}}
/>
/>
<div style={{
marginTop: '8px',
fontSize: '13px',
color: 'var(--text-secondary)'
}}>
Enter the 6-character code provided by your teacher.
</div>
<button
type="button"
onClick={() => setShowCode(!showCode)}
style={{
marginTop: '10px',
background: 'transparent',
border: 'none',
color: 'var(--accent)',
cursor: 'pointer',
fontWeight: 600
}}
>
{showCode ? 'Hide Code' : 'Show Code'}
</button>
</div>

<button
Expand Down