diff --git a/docs/site/src/components/FeedbackForm/index.tsx b/docs/site/src/components/FeedbackForm/index.tsx new file mode 100644 index 00000000000..8613ffdf7a3 --- /dev/null +++ b/docs/site/src/components/FeedbackForm/index.tsx @@ -0,0 +1,62 @@ +import React, { useState } from 'react'; +import clsx from "clsx"; +import "./styles.css"; + +const FeedbackForm = () => { + const [title, setTitle] = useState(''); + const [body, setBody] = useState(''); + + const handleSubmit = (e: React.FormEvent) => { + e.preventDefault(); + + const prefixedTitle = `Docs feedback: ${title}`; + const githubNewIssueUrl = `https://github.com/iotaledger/devx/issues/new?template=doc-bug.md&title=${encodeURIComponent(prefixedTitle)}&body=${encodeURIComponent(body)}`; + + // Open the GitHub issue page with pre-filled data in a new tab + window.open(githubNewIssueUrl, '_blank'); + setTitle(""); + setBody(""); + }; + + return ( +
+
+
Feedback Form
+
+
+ + setTitle(e.target.value)} + required + className="input-field" + placeholder='Enter Title' + /> +
+
+ +