mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
feat: add typeScript support to enforce valid translation keys (#1954)
* #1952 Fix incorrect localization key for sign-up failure message * feat: add typeScript support to enforce valid translation keys * feat: add typeScript support to enforce valid translation keys * fix lint errors * fix lint error
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import Icon from "../Icon";
|
||||
import { generateDialog } from "./BaseDialog";
|
||||
import "@/less/common-dialog.less";
|
||||
@ -23,10 +23,10 @@ const defaultProps = {
|
||||
confirmBtnText: "common.confirm",
|
||||
onClose: () => null,
|
||||
onConfirm: () => null,
|
||||
};
|
||||
} as const;
|
||||
|
||||
const CommonDialog: React.FC<Props> = (props: Props) => {
|
||||
const { t } = useTranslation();
|
||||
const t = useTranslate();
|
||||
const { title, content, destroy, closeBtnText, confirmBtnText, onClose, onConfirm, style } = {
|
||||
...defaultProps,
|
||||
closeBtnText: t(defaultProps.closeBtnText),
|
||||
|
Reference in New Issue
Block a user