import "./styles.sass"; import Button from "@/common/components/Button/index.js"; import {faHome, faPaperPlane, faCheckCircle, faInfoCircle} from "@fortawesome/free-solid-svg-icons"; import {useState} from "react"; import {useLocation, useNavigate} from "react-router-dom"; import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"; const ISSUES_URL = "https://github.com/ikhsanddy/pixies/issues"; export const TutorialSubmission = () => { const location = useLocation(); const navigate = useNavigate(); const typeParam = new URLSearchParams(location.search).get("type"); const [type, setType] = useState(typeParam || "guide"); const [contentUrl, setContentUrl] = useState(""); const [message, setMessage] = useState(""); const [success, setSuccess] = useState(false); const [agreed, setAgreed] = useState(false); const postTutorial = async (ev) => { ev.preventDefault(); const body = [ `**Type:** ${type}`, `**Content URL:** ${contentUrl}`, "", message ].join("\n"); window.open( `${ISSUES_URL}/new?title=${encodeURIComponent("Tutorial submission")}` + `&body=${encodeURIComponent(body)}`, "_blank" ); setSuccess(true); } if (success) { return (
Your browser opened a pre-filled GitHub issue. Submit it there to finish sharing your {type}.
Share your Pixies content with the community