feat: Add date and time slash commands to block menu
This commit is contained in:
@@ -16,6 +16,8 @@ import {
|
||||
InfoIcon,
|
||||
LinkIcon,
|
||||
AttachmentIcon,
|
||||
ClockIcon,
|
||||
CalendarIcon,
|
||||
} from "outline-icons";
|
||||
import { MenuItem } from "@shared/editor/types";
|
||||
import { Dictionary } from "~/hooks/useDictionary";
|
||||
@@ -124,6 +126,24 @@ export default function blockMenuItems(dictionary: Dictionary): MenuItem[] {
|
||||
keywords: "page print break line",
|
||||
attrs: { markup: "***" },
|
||||
},
|
||||
{
|
||||
name: "date",
|
||||
title: dictionary.insertDate,
|
||||
keywords: "clock",
|
||||
icon: CalendarIcon,
|
||||
},
|
||||
{
|
||||
name: "time",
|
||||
title: dictionary.insertTime,
|
||||
keywords: "clock",
|
||||
icon: ClockIcon,
|
||||
},
|
||||
{
|
||||
name: "datetime",
|
||||
title: dictionary.insertDateTime,
|
||||
keywords: "clock",
|
||||
icon: CalendarIcon,
|
||||
},
|
||||
{
|
||||
name: "separator",
|
||||
},
|
||||
|
||||
@@ -71,6 +71,9 @@ export default function useDictionary() {
|
||||
tipNotice: t("Tip notice"),
|
||||
warning: t("Warning"),
|
||||
warningNotice: t("Warning notice"),
|
||||
insertDate: t("Current date"),
|
||||
insertTime: t("Current time"),
|
||||
insertDateTime: t("Current date and time"),
|
||||
};
|
||||
}, [t]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user