From 12476d8c065945841977ed701de0fda2a2afe312 Mon Sep 17 00:00:00 2001 From: fantasticit Date: Thu, 26 May 2022 00:37:28 +0800 Subject: [PATCH] client: improve style --- .../document/comments/comments/Item/index.tsx | 33 +++++++------ .../components/document/comments/index.tsx | 10 +--- .../src/components/document/reader/index.tsx | 47 ++++++++++++------- .../collaboration/index.module.scss | 2 +- .../collaboration/collaboration/index.tsx | 7 +-- 5 files changed, 54 insertions(+), 45 deletions(-) diff --git a/packages/client/src/components/document/comments/comments/Item/index.tsx b/packages/client/src/components/document/comments/comments/Item/index.tsx index a523ae8c..566f77a1 100644 --- a/packages/client/src/components/document/comments/comments/Item/index.tsx +++ b/packages/client/src/components/document/comments/comments/Item/index.tsx @@ -65,20 +65,25 @@ export const CommentItem: React.FC = ({ comment, replyComment, editComme export const CommentItemPlaceholder = () => { return ( -
-
- -
-
-
- -
-
-
- + +
+
-
-
-
+
+
+ +
+
+
+ +
+
+
+ + } + > ); }; diff --git a/packages/client/src/components/document/comments/index.tsx b/packages/client/src/components/document/comments/index.tsx index 9bb812b1..e152d9c4 100644 --- a/packages/client/src/components/document/comments/index.tsx +++ b/packages/client/src/components/document/comments/index.tsx @@ -1,4 +1,4 @@ -import { Avatar, Banner, Button, Pagination, Space, Typography } from '@douyinfe/semi-ui'; +import { Avatar, Banner, Button, Pagination, Space, Spin, Typography } from '@douyinfe/semi-ui'; import { DataRender } from 'components/data-render'; import { useComments } from 'data/comment'; import { useUser } from 'data/user'; @@ -90,13 +90,7 @@ export const CommentEditor: React.FC = ({ documentId }) => { - {Array.from({ length: 3 }, (_, i) => i).map((i) => ( - - ))} - - } + loadingContent={null} normalContent={() => ( <> {commentsData.total > 0 && ( diff --git a/packages/client/src/components/document/reader/index.tsx b/packages/client/src/components/document/reader/index.tsx index f73c2f80..12ffc66c 100644 --- a/packages/client/src/components/document/reader/index.tsx +++ b/packages/client/src/components/document/reader/index.tsx @@ -1,5 +1,5 @@ import { IconEdit } from '@douyinfe/semi-icons'; -import { BackTop, Button, Layout, Nav, Skeleton, Space, Tooltip, Typography } from '@douyinfe/semi-ui'; +import { BackTop, Button, Layout, Nav, Skeleton, Space, Spin, Tooltip, Typography } from '@douyinfe/semi-ui'; import cls from 'classnames'; import { DataRender } from 'components/data-render'; import { DocumentCollaboration } from 'components/document/collaboration'; @@ -79,7 +79,6 @@ export const DocumentReader: React.FC = ({ documentId }) => { }, [document]); const actions = useMemo(() => { - console.log({ readable, editable }); return ( {document && ( @@ -135,21 +134,35 @@ export const DocumentReader: React.FC = ({ documentId }) => {
{document && } - {user && readable && ( - - )} - {user && ( -
- -
- )} + {user && + (docAuthLoading ? ( +
+ +
+ ) : ( + + ))} + {user && + (docAuthLoading ? null : ( +
+ +
+ ))} {!isMobile && authority && authority.editable && container && ( container} visibilityHeight={200}> diff --git a/packages/client/src/tiptap/editor/collaboration/collaboration/index.module.scss b/packages/client/src/tiptap/editor/collaboration/collaboration/index.module.scss index 10a6f859..43fdb25c 100644 --- a/packages/client/src/tiptap/editor/collaboration/collaboration/index.module.scss +++ b/packages/client/src/tiptap/editor/collaboration/collaboration/index.module.scss @@ -2,7 +2,7 @@ display: flex; width: 100%; height: 100%; - min-height: 100px; + min-height: 240px; overflow: hidden; flex-direction: column; diff --git a/packages/client/src/tiptap/editor/collaboration/collaboration/index.tsx b/packages/client/src/tiptap/editor/collaboration/collaboration/index.tsx index fc49d075..e85c7573 100644 --- a/packages/client/src/tiptap/editor/collaboration/collaboration/index.tsx +++ b/packages/client/src/tiptap/editor/collaboration/collaboration/index.tsx @@ -98,11 +98,8 @@ export const CollaborationEditor = forwardRef((props: ICollaborationEditorProps, - - {/* FIXME: semi-design 的问题,不加 div,文字会换行! */} -
-
+
+
} error={error}