#100DAYSOFCODE Day88

#100DAYSOFCODE Day88

ASSESSMENT - STUDENT PROFILES(Developing)

  • Add tags to the main data
  • Search for the tag at the same time(not finished yet)
  • fix an error while expanding grades

    const addTagsHandler = (e) => {
      if (e.key === "Enter") {
        const value = e.target.value
        const index = data.id - 1
    
        if (!data.hasOwnProperty("tags")) {
          setStudentData((allData) => {
            const arr = { ...data, tags: [value] }
            return [...allData, (allData[index] = arr)]
          })
        } else {
          setStudentData((allData) => {
            if (data.tags.includes(value)) return allData
            const arr = [...data.tags, value]
            return [...allData, (allData[index] = { ...data, tags: arr })]
          })
        }
      }
    }
    

    Todo:

  • Card list should be in a div
  • Search by tag
  • style the tags

Screen Shot 2021-05-30 at 2.38.42 AM.png