From 0e4ae0bdba3109498ee470289239141cc159a34b Mon Sep 17 00:00:00 2001 From: DIYgod Date: Sat, 15 Apr 2023 05:28:06 +0100 Subject: [PATCH] feat: markdown help button --- src/editor/Help.tsx | 15 +++++++++++++++ src/editor/index.tsx | 2 ++ src/pages/dashboard/[subdomain]/editor.tsx | 10 +--------- 3 files changed, 18 insertions(+), 9 deletions(-) create mode 100644 src/editor/Help.tsx diff --git a/src/editor/Help.tsx b/src/editor/Help.tsx new file mode 100644 index 00000000..5a93a6d9 --- /dev/null +++ b/src/editor/Help.tsx @@ -0,0 +1,15 @@ +import { getSiteLink } from "~/lib/helpers" +import { ICommand } from "." + +export const Help: ICommand = { + name: "help", + label: "Help: xLog Flavored Markdown", + icon: "i-mingcute:question-line", + execute: ({ view }) => { + window.open( + `${getSiteLink({ + subdomain: "xlog", + })}/xfm`, + ) + }, +} diff --git a/src/editor/index.tsx b/src/editor/index.tsx index ac481199..fb80b7ae 100644 --- a/src/editor/index.tsx +++ b/src/editor/index.tsx @@ -15,6 +15,7 @@ import { Strikethrough } from "./Strikethrough" import { Underline } from "./Underline" import { Mention } from "./Mention" import { Emoji } from "./Emoji" +import { Help } from "./Help" export type ICommand
= {
icon: string
@@ -139,4 +140,5 @@ export const toolbars: ICommand[] = [
Image,
Mention,
Emoji,
+ Help,
]
diff --git a/src/pages/dashboard/[subdomain]/editor.tsx b/src/pages/dashboard/[subdomain]/editor.tsx
index a44bbb68..27c54b54 100644
--- a/src/pages/dashboard/[subdomain]/editor.tsx
+++ b/src/pages/dashboard/[subdomain]/editor.tsx
@@ -530,17 +530,9 @@ export default function SubdomainEditor() {
}`}
>