Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions client/src/components/EditBox.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useState, useEffect } from "react";
// import fakeData from "../fakeData.json";
import AddForm from "./AddForm";

import fakeData from "../fakeData.json";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this is loading dummy data for testing. Is this needed here?

import LearningObjectiveAddForm from "./LearningObjectiveAddForm";
import { useParams } from "react-router-dom";
import { skills } from "../components/consts/skillsConst";

Expand Down Expand Up @@ -138,7 +139,7 @@ export default function EditBox() {
})}
</ul>
<div className="add-btn-container">
<AddForm getLearningObj={getLearningObj} />
<LearningObjectiveAddForm getLearningObj={getLearningObj} />
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState, useEffect } from "react";

export default function AddForm({ getLearningObj }) {
import React, { useState } from "react";
import { skills, skillLabel } from "./consts/skillsConst";
export default function LearningObjectiveAddForm({ getLearningObj }) {
const token = window.localStorage.getItem("token");
const initialDescription = {
skill: "",
Expand All @@ -13,7 +13,7 @@ export default function AddForm({ getLearningObj }) {
[event.target.name]: event.target.value,
};
setAddDescription(updateInput);
console.log(updateInput);

}
async function hadleSubmit(e) {
e.preventDefault();
Expand All @@ -30,8 +30,6 @@ export default function AddForm({ getLearningObj }) {
}),
})
.then((response) => response.json())
.then((data) => console.log(data));

setAddDescription(initialDescription);
getLearningObj();
}
Expand All @@ -43,14 +41,10 @@ export default function AddForm({ getLearningObj }) {
<br />

<select name="skill" onChange={handleChange} className="dropdown-skill">
<option value="select">Select</option>
<option value="html">HTML</option>
<option value="css">CSS</option>
<option value="git">GIT</option>
<option value="javascript">Javascript</option>
<option value="react">React</option>
<option value="node">Node</option>
<option value="sql">SQL</option>
<option>Select a skill</option>
{skills.map((skill) => (
<option value={skill}>{skillLabel(skill)}</option>
))}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

</select>
<br />
<label className="input-label">Add your learning objective</label>
Expand Down
2 changes: 2 additions & 0 deletions client/src/components/StudentResultsDisplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ export default function StudentResultsDisplay({ studentDetail }) {
return (
<Accordion>
{skills.map((skill, index) => {
console.log(skills[skill]);
console.log(skill);
Comment thread
NawalC marked this conversation as resolved.
return (
<Card>
<Card.Header>
Expand Down