From 05a48fb1e1f24070bb8e886507f842381437922a Mon Sep 17 00:00:00 2001 From: Sarah Rietkerk Date: Tue, 27 Feb 2024 17:32:57 -0800 Subject: [PATCH] split out add notes button, added input for notes --- .../src/components/EvalResultDisplay.tsx | 49 +++++++++++++++---- teachertool/src/constants.ts | 1 + 2 files changed, 41 insertions(+), 9 deletions(-) diff --git a/teachertool/src/components/EvalResultDisplay.tsx b/teachertool/src/components/EvalResultDisplay.tsx index 29f1e628cb3c..a7a395c860d6 100644 --- a/teachertool/src/components/EvalResultDisplay.tsx +++ b/teachertool/src/components/EvalResultDisplay.tsx @@ -1,12 +1,13 @@ import * as React from "react"; -import { useContext } from "react"; +import { useState, useContext } from "react"; import css from "./styling/EvalResultDisplay.module.scss"; import { AppStateContext } from "../state/appStateContext"; import { getCatalogCriteriaWithId } from "../state/helpers"; import { CriteriaEvaluationResult } from "../types/criteria"; import { classList } from "react-common/components/util"; import { Button } from "react-common/components/controls/Button"; -import { Strings } from "../constants"; +import { Strings, Ticks } from "../constants"; +import { Input } from "react-common/components/controls/Input"; const ResultsHeader: React.FC = () => { @@ -25,6 +26,40 @@ const ResultsHeader: React.FC = () => { ); }; +interface AddNotesButtonProps { + criteriaId: string; + setShowInput: (show: boolean) => void; +} + +const AddNotesButton: React.FC = ({ criteriaId, setShowInput }) => { + const onAddNotesClicked = async () => { + pxt.tickEvent(Ticks.AddResultNotes, { criteriaId }); + setShowInput(true); + }; + return ( +