From 48a3d69ab15c595cf9549b27cad5232a0bc192ca Mon Sep 17 00:00:00 2001 From: 1ilit <1ilit@proton.me> Date: Sun, 20 Apr 2025 01:37:11 +0400 Subject: [PATCH] remove survey and clean up --- public/robots.txt | 1 - src/App.jsx | 9 - src/components/EditorHeader/ControlPanel.jsx | 3 - src/pages/BugReport.jsx | 46 +-- src/pages/LandingPage.jsx | 19 +- src/pages/Survey.jsx | 307 ------------------- 6 files changed, 8 insertions(+), 377 deletions(-) delete mode 100644 src/pages/Survey.jsx diff --git a/public/robots.txt b/public/robots.txt index 5ebe41e3..93848abe 100644 --- a/public/robots.txt +++ b/public/robots.txt @@ -4,4 +4,3 @@ Allow: / Allow: /editor Allow: /templates Disallow: /bug-report -Disallow: /survey \ No newline at end of file diff --git a/src/App.jsx b/src/App.jsx index 38671710..0678c6a5 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,7 +1,6 @@ import { BrowserRouter, Routes, Route, useLocation } from "react-router-dom"; import { useLayoutEffect } from "react"; import Editor from "./pages/Editor"; -import Survey from "./pages/Survey"; import BugReport from "./pages/BugReport"; import Templates from "./pages/Templates"; import LandingPage from "./pages/LandingPage"; @@ -24,14 +23,6 @@ export default function App() { } /> - - - - } - /> window.open("/bug-report", "_blank"), }, - feedback: { - function: () => window.open("/survey", "_blank"), - }, }, }; diff --git a/src/pages/BugReport.jsx b/src/pages/BugReport.jsx index 42260e94..7de6f7c8 100644 --- a/src/pages/BugReport.jsx +++ b/src/pages/BugReport.jsx @@ -2,12 +2,7 @@ import { useEffect, useState, useCallback, useRef } from "react"; import logo_light from "../assets/logo_light_160.png"; import logo_dark from "../assets/logo_dark_160.png"; import { Banner, Button, Input, Upload, Toast, Spin } from "@douyinfe/semi-ui"; -import { - IconSun, - IconMoon, - IconGithubLogo, - IconPaperclip, -} from "@douyinfe/semi-icons"; +import { IconGithubLogo, IconPaperclip } from "@douyinfe/semi-icons"; import RichEditor from "../components/LexicalEditor/RichEditor"; import { LexicalComposer } from "@lexical/react/LexicalComposer"; import { editorConfig } from "../data/editorConfig"; @@ -108,12 +103,8 @@ function Form({ theme }) { dragSubText="Upload up to 3 images" accept="image/*" limit={3} - > -
-
- Styling with markdown is - supported -
+ /> +

{ @@ -47,18 +45,8 @@ export default function LandingPage() { return (
- {showSurvey && ( -
- - Help us improve! Share your feedback. - -
- -
-
- )} +
+ @@ -338,7 +326,8 @@ const features = [ title: "Keyboard shortcuts", content: (
- Speed up development with keyboard shortcuts. See all available shortcuts + Speed up development with keyboard shortcuts. See all available + shortcuts { - setForm({ - satisfaction: 5, - ease: 5, - wouldRecommend: 5, - hadDifficulty: "", - difficulty: "", - triedOtherApps: "", - comparison: "", - occupation: "", - }); - setLoading(false); - }; - - const onSubmit = useCallback(() => { - setLoading(true); - editor.update(() => { - const sendMail = async () => { - try { - await api.email.send( - `[SURVEY]: ${new Date().toDateString()}`, - `${Object.keys(form) - .map((k) => `
${questions[k]}
${form[k]}
`) - .join("\n\n")}
${$generateHtmlFromNodes(editor)}`, - ); - Toast.success("Thanks for the feedback!"); - editor.dispatchCommand(CLEAR_EDITOR_COMMAND, null); - resetForm(); - } catch { - Toast.error("Oops! Something went wrong."); - setLoading(false); - } - }; - sendMail(); - }); - }, [editor, form]); - - return ( -
-
-
{questions.satisfaction}
- { - setForm((prev) => ({ ...prev, satisfaction: v })); - }} - /> -
-
Not at all
-
Extremely
-
-
-
-
{questions.ease}
- { - setForm((prev) => ({ ...prev, ease: v })); - }} - /> -
-
Not at all
-
Extremely
-
-
-
-
- {questions.wouldRecommend} -
- { - setForm((prev) => ({ ...prev, wouldRecommend: v })); - }} - /> -
-
Not at all
-
Extremely
-
-
-
-
{questions.hadDifficulty}
- - setForm((prev) => ({ ...prev, hadDifficulty: e.target.value })) - } - > - Yes - No - -
- {form.hadDifficulty === "yes" && ( -
-
{questions.difficulty}
-