import { Flex, Text } from "rebass"; import { appVersion } from "../../utils/version"; import Field from "../field"; import Dialog from "./dialog"; import platform from "platform"; import { useState } from "react"; import { confirm } from "../../common/dialog-controller"; import { isUserPremium } from "../../hooks/use-is-user-premium"; import * as clipboard from "clipboard-polyfill/text"; import { store as userstore } from "../../stores/user-store"; import { db } from "../../common/db"; const PLACEHOLDERS = { title: "Briefly describe what happened", body: `Tell us more about the issue you are facing. For example things like: 1. Steps to reproduce the issue 2. Things you have tried so far 3. etc. This is all optional, of course.`, }; function getDeviceInfo() { const version = appVersion.formatted; const os = platform.os; const browser = `${platform.name} ${platform.version}`; return `App version: ${version} OS: ${os} Browser: ${browser} Pro: ${isUserPremium()}`; } const BODY_TEMPLATE = (body) => { const info = `**Device information:**\n${getDeviceInfo()}`; if (!body) return info; return `${body}\n\n${info}`; }; function IssueDialog(props) { const [isSubmitting, setIsSubmitting] = useState(false); const [error, setError] = useState(); return ( ); } export default IssueDialog; function showIssueReportedDialog({ url }) { return confirm({ title: "Thank you for reporting!", yesAction: () => clipboard.writeText(url), yesText: "Copy link", message: ( <>
You can track your bug report at{" "}
Please note that we will respond to your bug report on the link above.{" "} We recommended that you save the above link for later reference.
If your issue is critical (e.g. notes not syncing, crashes etc.), please{" "} join our Discord community {" "} for one-to-one support.
> ), }); }