From bc8abe54b7a1051d6b9e4ab5ebc629b6e065d776 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Sat, 31 Dec 2022 22:35:03 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96pluginUserExtraInfo?= =?UTF-8?q?=E6=B8=B2=E6=9F=93=E6=96=B9=E5=BC=8F=EF=BC=8C=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E6=B8=B2=E6=9F=93=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/popover/GroupUserPopover.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/client/web/src/components/popover/GroupUserPopover.tsx b/client/web/src/components/popover/GroupUserPopover.tsx index 30322f9f..76086922 100644 --- a/client/web/src/components/popover/GroupUserPopover.tsx +++ b/client/web/src/components/popover/GroupUserPopover.tsx @@ -34,15 +34,19 @@ export const GroupUserPopover: React.FC<{
{pluginUserExtraInfo.map((item, i) => { const Component = item.component?.render; + if (Component) { + // 自定义渲染方式 + return ( + + ); + } + + // 默认渲染方式 return (
{item.label}:
- {Component ? ( - - ) : ( - String(userExtra[item.name]) - )} + {userExtra[item.name] ? String(userExtra[item.name]) : ''}
);