fix: Put Popconfirm into a React component. (#1638)

* add "Sure to delete" to i18n(#1569)

* fix: add sure to delete to i18n

* fix: Put Popconfirm into a React component.
This commit is contained in:
陈温鹏
2023-03-10 19:16:08 +08:00
committed by GitHub
parent 404382f2e0
commit 2998bbf4b9
19 changed files with 105 additions and 75 deletions

View File

@@ -16,9 +16,10 @@ import BaseListPage from "./BaseListPage";
import * as Setting from "./Setting";
import i18next from "i18next";
import {Link} from "react-router-dom";
import {Button, Popconfirm, Table, Tag} from "antd";
import {Table, Tag} from "antd";
import React from "react";
import * as SessionBackend from "./backend/SessionBackend";
import PopconfirmModal from "./PopconfirmModal";
class SessionListPage extends BaseListPage {
@@ -97,12 +98,11 @@ class SessionListPage extends BaseListPage {
render: (text, record, index) => {
return (
<div>
<Popconfirm
<PopconfirmModal
title={i18next.t("general:Sure to delete") + `: ${record.name} ?`}
onConfirm={() => this.deleteSession(index)}
>
<Button style={{marginBottom: "10px"}} type="primary" danger>{i18next.t("general:Delete")}</Button>
</Popconfirm>
</PopconfirmModal>
</div>
);
},