diff --git a/package-lock.json b/package-lock.json index 859903b..32c993f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1992,6 +1992,14 @@ "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", "dev": true }, + "@types/dompurify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/dompurify/-/dompurify-2.0.1.tgz", + "integrity": "sha512-OQ16dECrRv/I//woKkVUxyVGYR94W3qp3Wy//B63awHVe3h/1/URFqP5a/V2m4k01DEvWs1+z7FWW3xfM1lH3Q==", + "requires": { + "@types/trusted-types": "*" + } + }, "@types/eslint-visitor-keys": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", @@ -2182,6 +2190,11 @@ "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-1.0.1.tgz", "integrity": "sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==" }, + "@types/trusted-types": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-1.0.4.tgz", + "integrity": "sha512-6jtHrHpmiXOXoJ31Cg9R+iEVwuEKPf0XHwFUI93eEPXx492/J2JHyafkleKE2EYzZprayk9FSjTyK1GDqcwDng==" + }, "@types/yargs": { "version": "13.0.5", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.5.tgz", @@ -5613,6 +5626,11 @@ "domelementtype": "1" } }, + "dompurify": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.0.7.tgz", + "integrity": "sha512-S3O0lk6rFJtO01ZTzMollCOGg+WAtCwS3U5E2WSDY/x/sy7q70RjEC4Dmrih5/UqzLLB9XoKJ8KqwBxaNvBu4A==" + }, "domutils": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz", diff --git a/package.json b/package.json index 9580ad8..a4b917c 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,10 @@ "version": "0.1.0", "private": true, "dependencies": { + "@d4sd/components": "^3.1.5", + "@types/dompurify": "^2.0.1", + "@types/jest": "^24.0.20", "@types/node": "^12.11.7", "@types/react": "^16.9.11", @@ -14,6 +17,7 @@ "babel-polyfill": "^6.26.0", "connected-react-router": "^6.5.2", "customize-cra": "^0.8.0", + "dompurify": "^2.0.7", "firebase": "^7.2.3", "less": "^3.10.3", "less-loader": "^5.0.0", diff --git a/src/components/layouts/preliminary-submission-layout/index.tsx b/src/components/layouts/preliminary-submission-layout/index.tsx index f3595e5..2ad3aab 100644 --- a/src/components/layouts/preliminary-submission-layout/index.tsx +++ b/src/components/layouts/preliminary-submission-layout/index.tsx @@ -33,7 +33,7 @@ const PrelimSubmitLayout = (): JSX.Element => { }; useEffect(() => { - const step: string | null = localStorage.getItem('prelimStep-d4sd-prelim-submit'); + const step: string | null = 'feedback'//localStorage.getItem('prelimStep-d4sd-prelim-submit'); if (step) { setSubmitStep(step); } diff --git a/src/components/preliminarysubmission-cards/feedback/index.tsx b/src/components/preliminarysubmission-cards/feedback/index.tsx index 9a6a5ee..79280e8 100644 --- a/src/components/preliminarysubmission-cards/feedback/index.tsx +++ b/src/components/preliminarysubmission-cards/feedback/index.tsx @@ -1,7 +1,10 @@ -import React, { useEffect } from 'react'; -import useForm from 'react-hook-form'; -import { Form } from '@d4sd/components'; -import './style.less'; +import React, { useEffect } from "react"; +import useForm from "react-hook-form"; +import { Form, Row, Col } from "@d4sd/components"; +import "./style.less"; +import DOMPurify from "dompurify"; +import { Input } from "antd"; +import TextArea from "antd/lib/input/TextArea"; interface FeedbackCardIF { setSubmitStep(step: string): void; @@ -10,6 +13,17 @@ interface FeedbackCardIF { const FeedbackCard = (props: FeedbackCardIF): JSX.Element => { const { setSubmitStep } = props; const { register, handleSubmit, setValue } = useForm(); + const projectName = localStorage.getItem("teamName-d4sd-prelim-submit"); + const problemStatement = localStorage.getItem( + "problemstatement-d4sd-prelim-submit" + ); + + const prelimQuestion1 = localStorage.getItem("prelim-submission-question1") || ""; + const prelimQuestion2 = localStorage.getItem("prelim-submission-question2") || ""; + const prelimQuestion3 = localStorage.getItem("prelim-submission-question3") || ""; + + const questionList = + "
Here’s your opportunity to get input on your ideas. Your team can pose up to three questions to ask the community about your proposed solutions. Asking questions is optional but can really help facilitate feedback exchange. Advice for writing effective questions:
"; /* eslint-disable */ const onSubmit = (data: any): void => { @@ -21,20 +35,97 @@ const FeedbackCard = (props: FeedbackCardIF): JSX.Element => { // register inputs useEffect(() => { - register({ name: 'stuff' }); - // eslint-disable-next-line + register({ name: "stuff" }); + // eslint-disable-next-line }, []); // eslint-disable-next-line const handleChange = (e: any) => { + console.log(e.target.name); setValue(e.target.name, e.target.value); - setSubmitStep(''); + localStorage.setItem(e.target.name, e.target.value); + //setSubmitStep(""); }; + return (FEEDBACK
- ++ Team members: +
++ 1. Problem Statement +
+{problemStatement}
++ 2. Propose Initial Concepts +
+ Specific: Call attention to specific aspects of your + proposals. +
++ Open-ended: + Request open-ended answers rather than asking for Yes/No + responses or trivial feedback. +
++ Succinct: + Keep your questions to under 200 characters. +
++ Comparitive: + Ask questions that compare different alternatives. +
+