Skip to content

Commit 6de77e8

Browse files
committed
Edit Form Update
1 parent d313e35 commit 6de77e8

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

client/src/components/student-list/EditStudent.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ const customStyles = {
1212
right : 'auto',
1313
bottom : 'auto',
1414
marginRight : '-50%',
15-
transform : 'translate(-50%, -50%)'
15+
transform : 'translate(-50%, -5%)'
1616
}
1717
};
1818

1919
const EditStudent = (props)=> {
2020
const studentContext = useContext(AuthContext);
21-
const {fName,mName,lName,Std,Addr,brd, phy,eng,maths,sex,fees} = studentContext.state.selectedForEdit;
21+
const {fName,mName,lName,Std,Addr,School,brd, phy,eng,maths,sex,fees} = studentContext.state.selectedForEdit;
2222
const [modalJoinIsOpen, setModalJoinIsOpen] = useState(false)
2323
const [modalDOBIsOpen, setModalDOBIsOpen] = useState(false)
2424
const [loading, setLoading] = useState(false)
@@ -53,7 +53,9 @@ const EditStudent = (props)=> {
5353

5454
const firstNameEl = React.createRef(); const middleNameEl = React.createRef();const lastNameEl = React.createRef();
5555
const addressEl = React.createRef();const standardEl = React.createRef();
56-
const boardEl = React.createRef();const physicsEl = React.createRef();
56+
const boardEl = React.createRef();
57+
const schoolEl = React.createRef();
58+
const physicsEl = React.createRef();
5759
const englishEl = React.createRef();const mathsEl = React.createRef();
5860
const sexEl = React.createRef();const feesEl = React.createRef();
5961

@@ -64,6 +66,7 @@ const EditStudent = (props)=> {
6466
const fName = firstNameEl.current.value; const mName = middleNameEl.current.value;const lName = lastNameEl.current.value;
6567
const std = standardEl.current.value;const addr = addressEl.current.value;
6668
const brd = boardEl.current.value;
69+
const schl = schoolEl.current.value;
6770
const dateOfJoining = date;
6871
const phy = physicsEl.current.value;
6972
const eng = englishEl.current.value;const maths = mathsEl.current.value;
@@ -73,7 +76,7 @@ const EditStudent = (props)=> {
7376
"firstName":fName,"middleName": mName, "lastName":lName,
7477
"dateOfBirth": dateOfBirth,
7578
"Address":addr,"standard":std,
76-
"Board":brd,
79+
"Board":brd,"school": schl,
7780
"joinedOn": dateOfJoining,
7881
"lastYearmarks":{
7982
"physics":phy, "english":eng,"maths":maths
@@ -176,6 +179,8 @@ const EditStudent = (props)=> {
176179
</span>
177180
</div>
178181
</div>
182+
<label htmlFor="InputSchool">School</label>
183+
<input type="text" ref={schoolEl} defaultValue={School} className="form-control form-control-sm" id="InputSchool" placeholder="School" required />
179184
<hr />
180185
<div>
181186
<h5>Last Year Marks / Grades</h5>

client/src/components/student-list/Student.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export default class Student extends Component {
5151
}
5252

5353
render(){
54-
const {id,fName,mName,lName,DOB,Std,Addr,brd,joinedOn,phy,eng,maths,sex,fees}= this.props;
54+
const {id,fName,mName,lName,DOB,Std,Addr,brd,School,joinedOn,phy,eng,maths,sex,fees}= this.props;
5555
return (
5656
<AuthContext.Consumer>
5757
{context=>
@@ -87,9 +87,10 @@ export default class Student extends Component {
8787
</header>
8888
<hr/>
8989
<h5>Date of birth : {DOB}</h5>
90-
<h5>Address : {Addr}</h5>
9190
<h5>Sex : {sex}</h5>
91+
<h5>Address : {Addr}</h5>
9292
<h5>Board : {brd}</h5>
93+
<h5>School : {School}</h5>
9394
<h5>Date Of Joining : {joinedOn}</h5>
9495
<h5>Physics Marks : {phy}</h5>
9596
<h5>English Marks : {eng}</h5>

client/src/components/student-list/StudentList.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ export default class StudentList extends Component {
106106
DOB={stud.dateOfBirth}
107107
Std={stud.standard}
108108
Addr={stud.Address}
109+
School={stud.school}
109110
brd={stud.Board}
110111
joinedOn={stud.joinedOn}
111112
phy={stud.lastYearmarks.physics}

0 commit comments

Comments
 (0)