Skip to content

Commit afb3b60

Browse files
authored
Clean up (#415)
1 parent 3c29049 commit afb3b60

File tree

6 files changed

+8
-377
lines changed

6 files changed

+8
-377
lines changed

public/robots.txt

-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ Allow: /
44
Allow: /editor
55
Allow: /templates
66
Disallow: /bug-report
7-
Disallow: /survey

src/App.jsx

-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { BrowserRouter, Routes, Route, useLocation } from "react-router-dom";
22
import { useLayoutEffect } from "react";
33
import Editor from "./pages/Editor";
4-
import Survey from "./pages/Survey";
54
import BugReport from "./pages/BugReport";
65
import Templates from "./pages/Templates";
76
import LandingPage from "./pages/LandingPage";
@@ -24,14 +23,6 @@ export default function App() {
2423
</ThemedPage>
2524
}
2625
/>
27-
<Route
28-
path="/survey"
29-
element={
30-
<ThemedPage>
31-
<Survey />
32-
</ThemedPage>
33-
}
34-
/>
3526
<Route
3627
path="/bug-report"
3728
element={

src/components/EditorHeader/ControlPanel.jsx

-3
Original file line numberDiff line numberDiff line change
@@ -1454,9 +1454,6 @@ export default function ControlPanel({
14541454
report_bug: {
14551455
function: () => window.open("/bug-report", "_blank"),
14561456
},
1457-
feedback: {
1458-
function: () => window.open("/survey", "_blank"),
1459-
},
14601457
},
14611458
};
14621459

src/pages/BugReport.jsx

+4-42
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@ import { useEffect, useState, useCallback, useRef } from "react";
22
import logo_light from "../assets/logo_light_160.png";
33
import logo_dark from "../assets/logo_dark_160.png";
44
import { Banner, Button, Input, Upload, Toast, Spin } from "@douyinfe/semi-ui";
5-
import {
6-
IconSun,
7-
IconMoon,
8-
IconGithubLogo,
9-
IconPaperclip,
10-
} from "@douyinfe/semi-icons";
5+
import { IconGithubLogo, IconPaperclip } from "@douyinfe/semi-icons";
116
import RichEditor from "../components/LexicalEditor/RichEditor";
127
import { LexicalComposer } from "@lexical/react/LexicalComposer";
138
import { editorConfig } from "../data/editorConfig";
@@ -108,12 +103,8 @@ function Form({ theme }) {
108103
dragSubText="Upload up to 3 images"
109104
accept="image/*"
110105
limit={3}
111-
></Upload>
112-
<div className="pt-4 flex justify-between items-center">
113-
<div className="text-sm opacity-80">
114-
<i className="fa-brands fa-markdown me-1"></i>Styling with markdown is
115-
supported
116-
</div>
106+
/>
107+
<div className="pt-4 flex justify-end items-center">
117108
<div className="flex items-center">
118109
<Button
119110
onClick={onSubmit}
@@ -140,22 +131,6 @@ export default function BugReport() {
140131
document.body.setAttribute("class", "theme");
141132
}, [setTheme]);
142133

143-
const changeTheme = () => {
144-
const body = document.body;
145-
const t = body.getAttribute("theme-mode");
146-
if (t === "dark") {
147-
if (body.hasAttribute("theme-mode")) {
148-
body.setAttribute("theme-mode", "light");
149-
setTheme("light");
150-
}
151-
} else {
152-
if (body.hasAttribute("theme-mode")) {
153-
body.setAttribute("theme-mode", "dark");
154-
setTheme("dark");
155-
}
156-
}
157-
};
158-
159134
return (
160135
<>
161136
<div className="sm:py-3 py-5 px-20 sm:px-6 flex justify-between items-center">
@@ -164,26 +139,13 @@ export default function BugReport() {
164139
<img
165140
src={theme === "dark" ? logo_dark : logo_light}
166141
alt="logo"
167-
className="me-2 sm:h-[28px] md:h-[46px] h-[48px]"
142+
className="me-2 sm:h-[28px] h-[42px]"
168143
/>
169144
</Link>
170145
<div className="ms-4 sm:text-sm xl:text-lg font-semibold">
171146
Report a bug
172147
</div>
173148
</div>
174-
<div className="flex items-center">
175-
<Button
176-
icon={
177-
theme === "dark" ? (
178-
<IconSun size="extra-large" />
179-
) : (
180-
<IconMoon size="extra-large" />
181-
)
182-
}
183-
theme="borderless"
184-
onClick={changeTheme}
185-
/>
186-
</div>
187149
</div>
188150
<hr
189151
className={`${

src/pages/LandingPage.jsx

+4-15
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { useState, useEffect } from "react";
22
import { Link } from "react-router-dom";
3-
import { IconCrossStroked } from "@douyinfe/semi-icons";
43
import SimpleCanvas from "../components/SimpleCanvas";
54
import Navbar from "../components/Navbar";
65
import { diagram } from "../data/heroDiagram";
@@ -27,7 +26,6 @@ function shortenNumber(number) {
2726
}
2827

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

3331
useEffect(() => {
@@ -47,18 +45,8 @@ export default function LandingPage() {
4745
return (
4846
<div>
4947
<div className="flex flex-col h-screen bg-zinc-100">
50-
{showSurvey && (
51-
<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]">
52-
<Link to="/survey" className="hover:underline">
53-
Help us improve! Share your feedback.
54-
</Link>
55-
<div className="float-right">
56-
<button onClick={() => setShowSurvey(false)}>
57-
<IconCrossStroked size="small" />
58-
</button>
59-
</div>
60-
</div>
61-
)}
48+
<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]" />
49+
6250
<FadeIn duration={0.6}>
6351
<Navbar />
6452
</FadeIn>
@@ -338,7 +326,8 @@ const features = [
338326
title: "Keyboard shortcuts",
339327
content: (
340328
<div>
341-
Speed up development with keyboard shortcuts. See all available shortcuts
329+
Speed up development with keyboard shortcuts. See all available
330+
shortcuts
342331
<Link
343332
to={`${socials.docs}/shortcuts`}
344333
className="ms-1.5 text-blue-500 hover:underline"

0 commit comments

Comments
 (0)