Skip to content

Clean up #415

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion public/robots.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ Allow: /
Allow: /editor
Allow: /templates
Disallow: /bug-report
Disallow: /survey
9 changes: 0 additions & 9 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -24,14 +23,6 @@ export default function App() {
</ThemedPage>
}
/>
<Route
path="/survey"
element={
<ThemedPage>
<Survey />
</ThemedPage>
}
/>
<Route
path="/bug-report"
element={
Expand Down
3 changes: 0 additions & 3 deletions src/components/EditorHeader/ControlPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1454,9 +1454,6 @@ export default function ControlPanel({
report_bug: {
function: () => window.open("/bug-report", "_blank"),
},
feedback: {
function: () => window.open("/survey", "_blank"),
},
},
};

Expand Down
46 changes: 4 additions & 42 deletions src/pages/BugReport.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -108,12 +103,8 @@ function Form({ theme }) {
dragSubText="Upload up to 3 images"
accept="image/*"
limit={3}
></Upload>
<div className="pt-4 flex justify-between items-center">
<div className="text-sm opacity-80">
<i className="fa-brands fa-markdown me-1"></i>Styling with markdown is
supported
</div>
/>
<div className="pt-4 flex justify-end items-center">
<div className="flex items-center">
<Button
onClick={onSubmit}
Expand All @@ -140,22 +131,6 @@ export default function BugReport() {
document.body.setAttribute("class", "theme");
}, [setTheme]);

const changeTheme = () => {
const body = document.body;
const t = body.getAttribute("theme-mode");
if (t === "dark") {
if (body.hasAttribute("theme-mode")) {
body.setAttribute("theme-mode", "light");
setTheme("light");
}
} else {
if (body.hasAttribute("theme-mode")) {
body.setAttribute("theme-mode", "dark");
setTheme("dark");
}
}
};

return (
<>
<div className="sm:py-3 py-5 px-20 sm:px-6 flex justify-between items-center">
Expand All @@ -164,26 +139,13 @@ export default function BugReport() {
<img
src={theme === "dark" ? logo_dark : logo_light}
alt="logo"
className="me-2 sm:h-[28px] md:h-[46px] h-[48px]"
className="me-2 sm:h-[28px] h-[42px]"
/>
</Link>
<div className="ms-4 sm:text-sm xl:text-lg font-semibold">
Report a bug
</div>
</div>
<div className="flex items-center">
<Button
icon={
theme === "dark" ? (
<IconSun size="extra-large" />
) : (
<IconMoon size="extra-large" />
)
}
theme="borderless"
onClick={changeTheme}
/>
</div>
</div>
<hr
className={`${
Expand Down
19 changes: 4 additions & 15 deletions src/pages/LandingPage.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useState, useEffect } from "react";
import { Link } from "react-router-dom";
import { IconCrossStroked } from "@douyinfe/semi-icons";
import SimpleCanvas from "../components/SimpleCanvas";
import Navbar from "../components/Navbar";
import { diagram } from "../data/heroDiagram";
Expand All @@ -27,7 +26,6 @@ function shortenNumber(number) {
}

export default function LandingPage() {
const [showSurvey, setShowSurvey] = useState(true);
const [stats, setStats] = useState({ stars: 18000, forks: 1200 });

useEffect(() => {
Expand All @@ -47,18 +45,8 @@ export default function LandingPage() {
return (
<div>
<div className="flex flex-col h-screen bg-zinc-100">
{showSurvey && (
<div className="text-white font-semibold py-1.5 px-4 text-sm text-center bg-linear-to-r from-[#12495e] from-10% via-slate-500 to-[#12495e]">
<Link to="/survey" className="hover:underline">
Help us improve! Share your feedback.
</Link>
<div className="float-right">
<button onClick={() => setShowSurvey(false)}>
<IconCrossStroked size="small" />
</button>
</div>
</div>
)}
<div className="text-white font-semibold py-1 text-sm text-center bg-linear-to-r from-[#12495e] from-10% via-slate-500 to-[#12495e]" />

<FadeIn duration={0.6}>
<Navbar />
</FadeIn>
Expand Down Expand Up @@ -338,7 +326,8 @@ const features = [
title: "Keyboard shortcuts",
content: (
<div>
Speed up development with keyboard shortcuts. See all available shortcuts
Speed up development with keyboard shortcuts. See all available
shortcuts
<Link
to={`${socials.docs}/shortcuts`}
className="ms-1.5 text-blue-500 hover:underline"
Expand Down
Loading