
Please fix this error. Using react.js
Using react.js, create a inventory page where screen will display Inventory: Name Storage Type Max Item Capacity Resources: Resource Name Resource Type Max Number of Resources Current Number of Resources
class ContactForm extends React.Component{
constructor(props) {
super(props);
this.state = {
name: '',
email: '',
};
this.handleInputChange = this.handleInputChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
}
handleInputChange(event){
const target = event.target;
const value = target.type === 'checkbox'? target.checked : target.value;
const name = target.name;
this.setState({
[name]: value
})
console.log('Change detected. State updated' + name + ' = ' + value);
}
handleSubmit(event){
alert('A form was submitted: ' + this.state.name + ' // ' + this.state.email);
event.preventDefault();
}
render() {
return (
<div>
<form onSubmit={this.handleSubmit}>
<div className="form-group">
<h1> Inventory </h1>
<label for="nameInput">Name</label>
<input type="text" name="name" value= {this.state.name} onChange ={this.handleChange}
className="form-control" id="nameInput" placeholder="Name" />
</div>
<div className="form-group">
<label for="emailInput">Storage Type</label>
<input name="email" type="email" value={this.state.email} onChange={this.handleChange}
className="form-control" id="emailInput" placeholder="Stroage Type" />
</div>
<div className="form-group">
<label for="nameInput">Max Item Capacity</label>
<input type="text" name="email" value={this.state.name} onChange={this.handleChange}
className="form-control" id="nameInput" placeholder="Max Item Capacity" />
</div>
<div className="form-group">
<h1> Resources </h1>
<label for="nameInput">Resource Name</label>
<input type="text" name="name" value={this.state.name} onChange={this.handleChange}
className="form-control" id="nameInput" placeholder="Resource Name" />
</div>
<div className="form-group">
<label for="nameInput">Max Number of Resources</label>
<input name="text" name="email" value={this.state.name} onChange={this.handleChange}
className="form-control" id="nameInput" placeholder="Max Number of Resources" />
</div>
<div className="form-group">
<label for="nameInput">Current Number of Resources</label>
<input type="text" name="name" value={this.state.name} onChange={this.handleChange}
className="form-control" id="nameInput" placeholder="Current number of Resources" />
</div>
</form>
</div>
)
}
}
class MainTitle extends React.Component {
render(): React.ReactNode {
return(
<h1> Add Inventory </h1>
)
}
}
class App extends React.Component{
render(){
return(
<div>
<MainTitle/>
<ContactForm/>
</div>
)
}
}

Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images

- Page < 32 of 41 You can override a private method defined in a subclass. (True/False)? ZOOM +arrow_forward#ClubMember classclass ClubMember: #__init_ functiondef __init__(self,id,name,gender,weight,phone):self.id = idself.name = nameself.gender = genderself.weight = weightself.phone = phone #__str__ functiondef __str__(self):return "Id:"+str(self.id)+",Name:"+self.name+",Gender:"+self.gender+",Weight:"+str(self.weight)+",Phone:"+str(self.phone) #Club classclass Club: #__init__ functiondef __init__(self,name):self.name = nameself.members = {}self.membersCount = 0 def run(self):print("Welcome to "+self.name+"!")while True:print("""1. Add New Member2. View Member Info3. Search for a member4. Browse All Members5. Edit Member6. Delete a Member7. Exit""") choice = int(input("Choice:")) if choice == 1:self.membersCount = self.membersCount+1id = self.membersCountname = input("Member name:")gender = input("Gender:")weight = int(input("Weight:"))phone = int(input("Phone No.")) member = ClubMember(id,name,gender,weight,phone)self.members[id] = memberelif choice == 2:name = input("Enter name of…arrow_forwardPython please. Starter code: from player import Playerdef does_player_1_win(p1_hand, p2_hand):#given both player-hands, does player 1 win? -- return True or Falsedef main():# Create players# Have the players play repeatedly until one wins enough timesmain() #you might need something hereclass Player: # player for Rock, Paper, Scissors# ADD constructor, init PRIVATE attributes# ADD method to get randomly-generated "hand" for player# ADD method to increment number of wins for player# ADD method to reset wins to 0# ADD getters & setters for attributesarrow_forward
- Program #11. Show the ArrayStackADT interface 2. Create the ArrayStackDataStrucClass<T> with the following methods: default constructor, overloaded constructor, copy constructor, initializeStack, isEmptyStack, isFullStack, push, peek, void pop 3. Create the PrimeFactorizationDemoClass: instantiate an ArrayStackDataStrucClass<Integer> object with 50 elements. Use a try-catch block in the main( ) using pushes/pops. 4. Exception classes: StackException, StackUnderflowException, StackOverflowException 5. Show the 4 outputs for the following: 3,960 1,234 222,222 13,780arrow_forwardpython: class Student:def __init__(self, first, last, gpa):self.first = first # first nameself.last = last # last nameself.gpa = gpa # grade point average def get_gpa(self):return self.gpa def get_last(self):return self.last class Course:def __init__(self):self.roster = [] # list of Student objects def add_student(self, student):self.roster.append(student) def course_size(self):return len(self.roster) # Type your code here if __name__ == "__main__":course = Course()course.add_student(Student('Henry', 'Nguyen', 3.5))course.add_student(Student('Brenda', 'Stern', 2.0))course.add_student(Student('Lynda', 'Robison', 3.2))course.add_student(Student('Sonya', 'King', 3.9)) student = course.find_student_highest_gpa()print('Top student:', student.first, student.last, '( GPA:', student.gpa,')')arrow_forwardIn C++ Create a new project named lab9_1 . You will need to implement a Course class. Here is its UML diagram: Course - department : string- course_num : string- section : int- num_students : int- is_full : bool + Course()+ Course(string, string, int, int)+ setDepartment(string) : void+ setNumber(string) : void+ setSection(int) : void+ setStudents(int) : void+ getDepartment() const : string+ getNumber() const : string+ getSection() const : int+ getStudents() const : int+ print() const : void Create a sample file to read from: CSS 2A 1111 35 Additional information: The Course class has two constructors. Make sure you have default values for your default constructor. Each course maxes out at 40 students. Therefore, you need to make sure that there aren’t more than 40 students in a Course. You can choose how you handle situations where more than 40 students are added. Additionally, you should automatically set is_full to false or true, based on the number of…arrow_forward
- Help me Complete the class definition and implementation for class task.h and task.cpp: Example: class Task { private: string name; DateTime startDate; DateTime endDate; int status; // value =1 means DONE! and value = 0 is pending }arrow_forwardclass IndexItem { public: virtual int count() = 0; virtual void display()= 0; };class Book : public IndexItem { private: string title; string author; public: Book(string title, string author): title(title), author(author){} virtual int count(){ return 1; } virtual void display(){ /* YOU DO NOT NEED TO IMPLEMENT THIS FUNCTION */ } };class Category: public IndexItem { private: /* fill in the private member variables for the Category class below */ ? int count; public: Category(string name, string code): name(name), code(code){} /* Implement the count function below. Consider the use of the function as depicted in main() */ ? /* Implement the add function which fills the category with contents below. Consider the use of the function as depicted in main() */ ? virtualvoiddisplay(){ /* YOU DO NOT NEED TO IMPLEMENT THIS FUNCTION */ } };arrow_forwarda) Create a HeapPriorityQueue interface with the following abstract methods: isEmpty, is Full, enqueue, dequeue, reheapifyUpward, reheapify Downward, reposition. b) Create the HeapPriorityQueue class. Have heapArray hold maxSize of 250 entries. Also, include the methods: default constructor, toString. c) Create HeapOverflowException and HeapUnderflowException classes d) Create a Heap Demo class that creates a HeapPriorityQueue object and insert the values 1-10 into the heap. Print out the heap and remove two values from the heap. Print the resulting heap. Try and show the resulting tree with the nodes on their appropriate levels along with their branches.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





