From b9c91f243dfb0bcc93d2a7c35f94d0efd0a704a1 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Sat, 25 Dec 2021 18:44:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=BF=81=E7=A7=BB?= =?UTF-8?q?=E5=90=8E=E4=BA=A7=E7=94=9F=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E7=BB=9F=E4=B8=80=E5=9B=BE=E6=A0=87=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E7=9A=84=E6=98=BE=E7=A4=BA=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/components/FullModal/Field.tsx | 20 +- web/src/components/IconBtn.tsx | 48 +- web/src/components/Panel/common/Wrapper.tsx | 9 +- web/src/components/Panel/group/Wrapper.tsx | 48 +- .../Panel/personal/ConversePanel.tsx | 79 ++- .../__snapshots__/IconBtn.spec.tsx.snap | 8 +- .../GroupDetail/Panel/GroupPanelTree.tsx | 59 ++- .../GroupPanelTree.spec.tsx.snap | 464 ++++++++++++++---- 8 files changed, 507 insertions(+), 228 deletions(-) diff --git a/web/src/components/FullModal/Field.tsx b/web/src/components/FullModal/Field.tsx index cf8cde11..e8950214 100644 --- a/web/src/components/FullModal/Field.tsx +++ b/web/src/components/FullModal/Field.tsx @@ -1,10 +1,10 @@ import React, { useState, useCallback, useEffect } from 'react'; import _isString from 'lodash/isString'; import _isNil from 'lodash/isNil'; -import { Button, Input, Space } from 'antd'; -import { Icon } from '@iconify/react'; +import { Input, Space } from 'antd'; import { t } from 'tailchat-shared'; import { DelayTip } from '../DelayTip'; +import { IconBtn } from '../IconBtn'; export type FullModalFieldEditorRenderComponent = React.FC<{ value: string; @@ -86,25 +86,15 @@ const FullModalFieldEditor: React.FC = React.memo( {!isEditing ? ( - `; diff --git a/web/src/components/modals/GroupDetail/Panel/GroupPanelTree.tsx b/web/src/components/modals/GroupDetail/Panel/GroupPanelTree.tsx index 28eb6c63..b904caa4 100644 --- a/web/src/components/modals/GroupDetail/Panel/GroupPanelTree.tsx +++ b/web/src/components/modals/GroupDetail/Panel/GroupPanelTree.tsx @@ -5,13 +5,13 @@ import { showAlert, t, } from 'tailchat-shared'; -import { Button, Tree } from 'antd'; +import { Space, Tree } from 'antd'; import type { DataNode } from 'antd/lib/tree'; import { buildTreeDataWithGroupPanel } from './utils'; -import { Icon } from '@iconify/react'; import { useGroupPanelTreeDrag } from './useGroupPanelTreeDrag'; import { closeModal, openModal } from '@/components/Modal'; import { ModalModifyGroupPanel } from '../../GroupPanel/ModifyGroupPanel'; +import { IconBtn } from '@/components/IconBtn'; interface GroupPanelTree { groupId: string; @@ -61,32 +61,36 @@ export const GroupPanelTree: React.FC = React.memo((props) => { return (
{node.title} -
-
); @@ -103,6 +107,7 @@ export const GroupPanelTree: React.FC = React.memo((props) => { defaultExpandAll={true} blockNode={true} draggable={true} + selectable={false} titleRender={titleRender} onDrop={handleDrop} // TODO: 待简化 https://github.com/react-component/tree/pull/482 diff --git a/web/src/components/modals/GroupDetail/Panel/__tests__/__snapshots__/GroupPanelTree.spec.tsx.snap b/web/src/components/modals/GroupDetail/Panel/__tests__/__snapshots__/GroupPanelTree.spec.tsx.snap index 8d5d242a..9e66e6fd 100644 --- a/web/src/components/modals/GroupDetail/Panel/__tests__/__snapshots__/GroupPanelTree.spec.tsx.snap +++ b/web/src/components/modals/GroupDetail/Panel/__tests__/__snapshots__/GroupPanelTree.spec.tsx.snap @@ -3,12 +3,12 @@ exports[`GroupPanelTree simple render snapshot 1`] = `
-
+
- - +
+ +
+
+ +
+
+ + + + +
- - +
+ +
+
+ +
+
+ + + + +
- - +
+ +
+
+ +
+
- - +
+ +
+
+ +
+
+ + + + +
- - +
+ +
+
+ +
+
+ + + + +
- - +
+ +
+
+ +
+