feat: markdown help button

This commit is contained in:
DIYgod
2023-04-15 05:28:06 +01:00
parent 9e2db05eff
commit 0e4ae0bdba
3 changed files with 18 additions and 9 deletions
+15
View File
@@ -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`,
)
},
}
+2
View File
@@ -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<P = any> = {
icon: string
@@ -139,4 +140,5 @@ export const toolbars: ICommand[] = [
Image,
Mention,
Emoji,
Help,
]
+1 -9
View File
@@ -530,17 +530,9 @@ export default function SubdomainEditor() {
}`}
>
<EditorToolbar view={view} toolbars={toolbars}></EditorToolbar>
<UniLink
className="ml-7 align-middle hidden xl:block"
href={`${getSiteLink({
subdomain: "xlog",
})}/xfm`}
>
{t("Tip: xLog Flavored Markdown")}
</UniLink>
</div>
{isMobileLayout ? (
<div className="flex items-center space-x-3 w-auto inline-block pl-5">
<div className="flex items-center space-x-3 w-auto pl-5">
{/* <span
className={cn(
`text-sm capitalize`,