remove showDeleteConfirm function and center the Empty of knowledge list and extract the text of the login page to en.json (#203)
feat: remove showDeleteConfirm function feat: center the Empty of knowledge list feat: extract the text of the login page to en.json #204
This commit is contained in:
@@ -1,39 +0,0 @@
|
||||
import { ExclamationCircleFilled } from '@ant-design/icons';
|
||||
import { Modal } from 'antd';
|
||||
|
||||
const { confirm } = Modal;
|
||||
|
||||
interface IProps {
|
||||
onOk?: (...args: any[]) => any;
|
||||
onCancel?: (...args: any[]) => any;
|
||||
}
|
||||
|
||||
export const showDeleteConfirm = ({
|
||||
onOk,
|
||||
onCancel,
|
||||
}: IProps): Promise<number> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
confirm({
|
||||
title: 'Are you sure delete this item?',
|
||||
icon: <ExclamationCircleFilled />,
|
||||
content: 'Some descriptions',
|
||||
okText: 'Yes',
|
||||
okType: 'danger',
|
||||
cancelText: 'No',
|
||||
async onOk() {
|
||||
try {
|
||||
const ret = await onOk?.();
|
||||
resolve(ret);
|
||||
console.info(ret);
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
},
|
||||
onCancel() {
|
||||
onCancel?.();
|
||||
},
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
export default showDeleteConfirm;
|
||||
@@ -4,7 +4,6 @@ import { IconComponentProps } from '@ant-design/icons/lib/components/Icon';
|
||||
const importAll = (requireContext: __WebpackModuleApi.RequireContext) => {
|
||||
const list = requireContext.keys().map((key) => {
|
||||
const name = key.replace(/\.\/(.*)\.\w+$/, '$1');
|
||||
console.log(name, requireContext(key));
|
||||
return { name, value: requireContext(key) };
|
||||
});
|
||||
return list;
|
||||
|
||||
Reference in New Issue
Block a user