Skip to content

Commit c9c4d8a

Browse files
joBr99farhatahmad
andauthored
Add disableFormControls functionality to JoinCard (#6217)
Co-authored-by: Ahmad Farhat <ahmad.af.farhat@gmail.com>
1 parent cb6301e commit c9c4d8a

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

app/javascript/components/rooms/room/join/JoinCard.jsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ export default function JoinCard() {
7171
const queryParams = new URLSearchParams(location.search);
7272
const joinFormName = queryParams.get('joinFormName');
7373
const viewerCode = queryParams.get('viewerCode');
74+
const disableFormControls = queryParams.get('disableFormControls') === 'true';
7475

7576
useEffect(() => { // set cookie to return to if needed
7677
const date = new Date();
@@ -249,8 +250,20 @@ export default function JoinCard() {
249250
<Row>
250251
{(roomStatusAPI.isSuccess && !roomStatusAPI.data.status) ? WaitingPage : (
251252
<Form methods={methods} onSubmit={handleJoin}>
252-
<FormControl field={fields.name} type="text" disabled={currentUser?.signed_in} autoFocus={!currentUser?.signed_in} />
253-
{hasAccessCode && <FormControl field={fields.accessCode} type="text" autoFocus={currentUser?.signed_in} />}
253+
<FormControl
254+
field={fields.name}
255+
type="text"
256+
disabled={currentUser?.signed_in || disableFormControls}
257+
autoFocus={!currentUser?.signed_in}
258+
/>
259+
{hasAccessCode && (
260+
<FormControl
261+
field={fields.accessCode}
262+
type="text"
263+
disabled={disableFormControls}
264+
autoFocus={currentUser?.signed_in}
265+
/>
266+
)}
254267
{publicRoom?.data?.recording_consent === 'true' && (
255268
<FormControlGeneric
256269
id={fields.recordingConsent.controlId}

0 commit comments

Comments
 (0)