From 4c9a9455b2edd1c0caeb081088e0506cb8df4b2a Mon Sep 17 00:00:00 2001 From: Mir Ali Talpur Date: Wed, 15 Jul 2020 11:09:33 -0700 Subject: [PATCH] #2 add inidividualStudentTeacherEdit component --- components/individualStudentTeacherEdit.js | 169 ++++++++++++++++++++ components/nav.js | 6 + components/teacherDashboard.js | 171 ++++++++++++++++++++- components/teacherStudentComponent.js | 56 +++++-- 4 files changed, 389 insertions(+), 13 deletions(-) create mode 100644 components/individualStudentTeacherEdit.js diff --git a/components/individualStudentTeacherEdit.js b/components/individualStudentTeacherEdit.js new file mode 100644 index 0000000..4f87796 --- /dev/null +++ b/components/individualStudentTeacherEdit.js @@ -0,0 +1,169 @@ +import React from 'react'; +import { Form, Input, Card, Button, Avatar, Space } from 'antd'; + +import stylesheet from 'antd/dist/antd.min.css'; +const { Meta } = Card; + + +export default class TeacherEditStudentComponent extends React.Component { + constructor(props) { + super(props); + } + + componentDidMount() { + console.log("in TeacherEditStudentComponent class...."); + console.log(this.props.individualEditStudentInformation); + console.log(this.props.individualEditStudentInformation.data.data.displayName); + + } + + backButtonComponent = () => { + return( + + ) + } + + updateButtonComponent = () => { + return( + + ) + } + + nameFormItemComponent = () => { + if(this.props.teacherStudentComponent.individualStudentTeacherEditNameError) { + return( +
+ Name + + this.props.handleIndividualStudentTeacherEditNameChange(event)} + onBlur={(event) => this.props.onBlurhandleIndividualStudentTeacherEditNameChange(event)} + /> + +
+ ) + } else { + return( +
+ Name + + this.props.handleIndividualStudentTeacherEditNameChange(event)} + onBlur={(event)=> this.props.onBlurhandleIndividualStudentTeacherEditNameChange(event)} + /> + +
+ ) + } + } + + emailFormItemComponent = () => { + if(this.props.teacherStudentComponent.individualStudentTeacherEditEmailError) { + return( +
+ Email + + this.props.handleIndividualStudentTeacherEditEmailChange(event)} + onBlur={(event)=>this.props.onBlurhandleIndividualStudentTeacherEditEmailChange(event)} + /> + +
+ ) + } else { + return( +
+ Email + + this.props.handleIndividualStudentTeacherEditNameChange(event)} + onBlur={(event)=>this.props.onBlurhandleIndividualStudentTeacherEditEmailChange(event)} + /> + +
+ ) + } + } + + gradeFormItemComponent = () => { + if(this.props.teacherStudentComponent.individualStudentTeacherEditGradeError) { + return( +
+ Current Grade + + this.props.handleIndividualStudentTeacherEditNameChange(event)} + onBlur={(event)=>this.props.onBlurhandleIndividualStudentTeacherEditGradeChange(event)} + /> + +
+ ) + } else { + return( +
+ Current Grade + + this.props.handleIndividualStudentTeacherEditNameChange(event)} + onBlur={(event)=>this.props.onBlurhandleIndividualStudentTeacherEditGradeChange(event)} + /> + +
+ ) + } + } + + passwordFormItemComponent = () => { + return( +
+ New Password + + this.props.handleIndividualStudentTeacherEditNameChange(event)} + /> + +
+ ) + } + + render() { + return ( + +