Skip to content
Snippets Groups Projects
Commit c5c520e5 authored by Bo-Chun Chen's avatar Bo-Chun Chen
Browse files

Add blazerid field to the form

parent e159f1d8
No related branches found
No related tags found
No related merge requests found
...@@ -29,6 +29,7 @@ function Main(props) { ...@@ -29,6 +29,7 @@ function Main(props) {
const firstName = useRef(null); const firstName = useRef(null);
const lastName = useRef(null); const lastName = useRef(null);
const reason = useRef(null); const reason = useRef(null);
const blazerid = useRef(username);
// Define functions // Define functions
const hideModal = () => setIsLoading(false); const hideModal = () => setIsLoading(false);
...@@ -47,7 +48,7 @@ function Main(props) { ...@@ -47,7 +48,7 @@ function Main(props) {
showModal(); showModal();
if (DEBUG) console.log('Modal showed') if (DEBUG) console.log('Modal showed')
socketRef.current.emit('request', { socketRef.current.emit('request', {
'username': username, 'username': blazerid.current.value,
'firstName': firstName.current.value, 'firstName': firstName.current.value,
'lastName': lastName.current.value, 'lastName': lastName.current.value,
'reason': reason.current.value, 'reason': reason.current.value,
...@@ -111,6 +112,13 @@ function Main(props) { ...@@ -111,6 +112,13 @@ function Main(props) {
<Container className="col-4"> <Container className="col-4">
<Form noValidate validated={validated} onSubmit={handleSubmit}> <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.Group controlId="formFirstName">
<Form.Label>First Name</Form.Label> <Form.Label>First Name</Form.Label>
<Form.Control required ref={firstName} type="text" placeholder="First Name" /> <Form.Control required ref={firstName} type="text" placeholder="First Name" />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment