From 3b7973e9e14903394c50e83df78e369c56e5c6a9 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Sat, 11 Nov 2023 01:41:05 +0800 Subject: [PATCH] refactor: add webpanel a group panel container for futher support mobile --- .../com.msgbyte.webview/src/group/GroupWebPanelRender.tsx | 8 ++++++-- client/web/src/components/Panel/group/MembersPanel.tsx | 4 +--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/client/web/plugins/com.msgbyte.webview/src/group/GroupWebPanelRender.tsx b/client/web/plugins/com.msgbyte.webview/src/group/GroupWebPanelRender.tsx index 21944cb023d..2aff8fb36db 100644 --- a/client/web/plugins/com.msgbyte.webview/src/group/GroupWebPanelRender.tsx +++ b/client/web/plugins/com.msgbyte.webview/src/group/GroupWebPanelRender.tsx @@ -1,9 +1,11 @@ import React from 'react'; import { Translate } from '../translate'; -import { WebviewKeepAlive } from '@capital/component'; +import { GroupPanelContainer, WebviewKeepAlive } from '@capital/component'; import urlRegex from 'url-regex'; +import { useGroupPanelContext } from '@capital/common'; const GroupWebPanelRender: React.FC<{ panelInfo: any }> = (props) => { + const { groupId, panelId } = useGroupPanelContext(); const panelInfo = props.panelInfo; if (!panelInfo) { @@ -20,7 +22,9 @@ const GroupWebPanelRender: React.FC<{ panelInfo: any }> = (props) => { } return ( - + + + ); }; GroupWebPanelRender.displayName = 'GroupWebPanelRender'; diff --git a/client/web/src/components/Panel/group/MembersPanel.tsx b/client/web/src/components/Panel/group/MembersPanel.tsx index 71da0042c29..7547a6b2940 100644 --- a/client/web/src/components/Panel/group/MembersPanel.tsx +++ b/client/web/src/components/Panel/group/MembersPanel.tsx @@ -1,14 +1,12 @@ import { Icon } from 'tailchat-design'; import { UserListItem } from '@/components/UserListItem'; -import { Dropdown, Input, MenuProps, Skeleton } from 'antd'; +import { Dropdown, Input, Skeleton } from 'antd'; import React, { useMemo } from 'react'; import { getGroupConfigWithInfo, - PERMISSION, t, useCachedOnlineStatus, useGroupInfo, - useHasGroupPermission, UserBaseInfo, } from 'tailchat-shared'; import { Problem } from '@/components/Problem';