From f656517fa729351d0774d0b81e733e8cc1143fec Mon Sep 17 00:00:00 2001 From: Bo-Chun Louis Chen <louistw@uab.edu> Date: Thu, 9 Dec 2021 17:29:30 -0600 Subject: [PATCH] Add blazerid field to the form --- react/src/components/Main.jsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/react/src/components/Main.jsx b/react/src/components/Main.jsx index 9ebe1d2..0786f27 100644 --- a/react/src/components/Main.jsx +++ b/react/src/components/Main.jsx @@ -29,6 +29,7 @@ function Main(props) { const firstName = useRef(null); const lastName = useRef(null); const reason = useRef(null); + const blazerid = useRef(username); // Define functions const hideModal = () => setIsLoading(false); @@ -47,7 +48,7 @@ function Main(props) { showModal(); if (DEBUG) console.log('Modal showed') socketRef.current.emit('request', { - 'username': username, + 'username': blazerid.current.value, 'firstName': firstName.current.value, 'lastName': lastName.current.value, 'reason': reason.current.value, @@ -111,6 +112,13 @@ function Main(props) { <Container className="col-4"> <Form noValidate validated={validated} onSubmit={handleSubmit}> + <Form.Group controlId="formBlazerID"> + <Form.Label>BlazerID</Form.Label> + <Form.Control required defaultValue={username} ref={blazerid} type="text" placeholder="BlazerID" /> + <Form.Control.Feedback type="invalid"> + Required + </Form.Control.Feedback> + </Form.Group> <Form.Group controlId="formFirstName"> <Form.Label>First Name</Form.Label> <Form.Control required ref={firstName} type="text" placeholder="First Name" /> -- GitLab