From a257943f2081ce87b355d6074a8cd001d3a043b0 Mon Sep 17 00:00:00 2001 From: githubteacher Date: Wed, 10 Jul 2019 12:05:28 -0700 Subject: [PATCH 01/15] setting up changes to add --- src/App.jsx | 45 ++++++++++++++++++++++++++++++++++++++++++++- src/List.jsx | 3 ++- 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 902a9c1..2f79a61 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,5 +1,6 @@ import React from "react"; import Table from "./Table"; +/*Add import statement here for step 2*/ class App extends React.Component { constructor(props) { @@ -7,12 +8,14 @@ class App extends React.Component { this.state = { buttonClicked: "", - assignments: [], + assignments: [] /*Below this line, add the students state variable for step 3*/, grades: {} }; this.handleButtonClicked = this.handleButtonClicked.bind(this); this.addAssignment = this.addAssignment.bind(this); + /*Uncomment the line below for step 4*/ + /*this.addStudent = this.addStudent.bind(this);*/ this.addGrade = this.addGrade.bind(this); } @@ -28,6 +31,8 @@ class App extends React.Component { }); } + /*Write an addStudent function here for step 4*/ + addGrade(assignment, student, score) { let grades = this.state.grades; let assignmentName = assignment; @@ -42,10 +47,48 @@ class App extends React.Component { render() { let tabChoice =
; + /*Uncomment below for step 2*/ + /*if (this.state.buttonClicked === "assignments") { + tabChoice = ( + + ); + }*/ + + /* Change below for step 4*/ + + /*if (this.state.buttonClicked === "students") { + tabChoice = ( + + ); + }*/ + + /* Uncomment lines below for step 3*/ + /*if (this.state.buttonClicked === "grades") { + tabChoice = ( + + ); + }*/ + return (
+ {/* Replace this line with the proper header code for Step 1 */}
); - }*/ + } return (