From 56e97fccd73267e4492a1398d4f8ecabd6b2ddf0 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Sun, 26 Nov 2023 00:23:11 +0800 Subject: [PATCH] feat: add popconfirm for topic delete --- client/web/src/plugin/component/index.tsx | 1 + .../com.msgbyte.topic/src/components/TopicCard.tsx | 12 +++++++----- .../web/plugins/com.msgbyte.topic/src/translate.ts | 4 ++++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/client/web/src/plugin/component/index.tsx b/client/web/src/plugin/component/index.tsx index 072660f8..788e45f7 100644 --- a/client/web/src/plugin/component/index.tsx +++ b/client/web/src/plugin/component/index.tsx @@ -15,6 +15,7 @@ export { Popover, Tag, Skeleton, + Popconfirm, } from 'antd'; export const TextArea = Input.TextArea; export { diff --git a/server/plugins/com.msgbyte.topic/web/plugins/com.msgbyte.topic/src/components/TopicCard.tsx b/server/plugins/com.msgbyte.topic/web/plugins/com.msgbyte.topic/src/components/TopicCard.tsx index 7a018f8c..8759f03f 100644 --- a/server/plugins/com.msgbyte.topic/web/plugins/com.msgbyte.topic/src/components/TopicCard.tsx +++ b/server/plugins/com.msgbyte.topic/web/plugins/com.msgbyte.topic/src/components/TopicCard.tsx @@ -13,6 +13,7 @@ import { UserName, UserAvatar, MessageAckContainer, + Popconfirm, } from '@capital/component'; import styled from 'styled-components'; import type { GroupTopic } from '../types'; @@ -139,11 +140,12 @@ export const TopicCard: React.FC<{ /> {userId === groupOwnerId && ( - + + + )} diff --git a/server/plugins/com.msgbyte.topic/web/plugins/com.msgbyte.topic/src/translate.ts b/server/plugins/com.msgbyte.topic/web/plugins/com.msgbyte.topic/src/translate.ts index badee783..ed8f33bf 100644 --- a/server/plugins/com.msgbyte.topic/web/plugins/com.msgbyte.topic/src/translate.ts +++ b/server/plugins/com.msgbyte.topic/web/plugins/com.msgbyte.topic/src/translate.ts @@ -26,4 +26,8 @@ export const Translate = { 'zh-CN': '话题信息异常', 'en-US': 'Topic Data Error', }), + topicDeleteConfimTip: localTrans({ + 'zh-CN': '你确定要删除该话题么', + 'en-US': 'Are you sure you want to delete this topic?', + }), };