From 860e2471e5cff7ae1f76304bf6feb83f4a86d865 Mon Sep 17 00:00:00 2001 From: fantasticit Date: Thu, 23 Jun 2022 18:18:54 +0800 Subject: [PATCH] client: update tocs style --- .../components/wiki/tocs/index.module.scss | 10 + .../client/src/components/wiki/tocs/index.tsx | 484 +++++++++--------- .../src/components/wiki/tocs/public.tsx | 152 +++--- 3 files changed, 332 insertions(+), 314 deletions(-) diff --git a/packages/client/src/components/wiki/tocs/index.module.scss b/packages/client/src/components/wiki/tocs/index.module.scss index d232e280..98a8c3d8 100644 --- a/packages/client/src/components/wiki/tocs/index.module.scss +++ b/packages/client/src/components/wiki/tocs/index.module.scss @@ -3,6 +3,16 @@ height: 100%; padding-top: 12px; overflow: auto; + + display: flex; + flex-direction: column; + + overflow: hidden; + + > main { + flex: 1; + overflow: auto; + } } .titleWrap { diff --git a/packages/client/src/components/wiki/tocs/index.tsx b/packages/client/src/components/wiki/tocs/index.tsx index b17708f5..fc0e4182 100644 --- a/packages/client/src/components/wiki/tocs/index.tsx +++ b/packages/client/src/components/wiki/tocs/index.tsx @@ -48,252 +48,256 @@ export const WikiTocs: React.FC = ({ return (
- - - - -
- } - loading={true} - /> - - } - error={wikiError} - normalContent={() => ( - - {(starWikis || []) - .filter((wiki) => wiki.id !== wikiId) - .map((wiki) => { - return ( - - - - - - {wiki.name.charAt(0)} - - - {wiki.name} - - - - - - ); - })} - - } - > +
+ - - - {wiki.name.charAt(0)} - - {wiki.name} - - - - - )} - /> - - - - - - - } - loading={true} - /> - - } - error={wikiError} - normalContent={() => ( - - )} - /> - - - - - - - } - loading={true} - /> - - } - error={wikiError} - normalContent={() => ( - - )} - /> - -
- } - error={starDocumentsError} - normalContent={() => ( -
- - 已加星标 - -
- )} - /> - 1
} - error={starDocumentsError} - normalContent={() => ( - - )} - /> - - -
- } - error={wikiError} - normalContent={() => ( -
- - 文档集 - -
+ } + loading={true} />
- )} - /> - 1} - error={tocsError} + } + error={wikiError} normalContent={() => ( - + + {(starWikis || []) + .filter((wiki) => wiki.id !== wikiId) + .map((wiki) => { + return ( + + + + + + {wiki.name.charAt(0)} + + + {wiki.name} + + + + + + ); + })} + + } + > +
+ + + {wiki.name.charAt(0)} + + {wiki.name} + + +
+
)} /> - + + + + + + + } + loading={true} + /> + + } + error={wikiError} + normalContent={() => ( + + )} + /> + + + + + + + } + loading={true} + /> + + } + error={wikiError} + normalContent={() => ( + + )} + /> +
+ +
+
+ } + error={starDocumentsError} + normalContent={() => ( +
+ + 已加星标 + +
+ )} + /> + 1
} + error={starDocumentsError} + normalContent={() => ( + + )} + /> + + +
+ } + error={wikiError} + normalContent={() => ( +
+ + 文档集 + +
+ )} + /> + 1
} + error={tocsError} + normalContent={() => ( + + )} + /> + +
); }; diff --git a/packages/client/src/components/wiki/tocs/public.tsx b/packages/client/src/components/wiki/tocs/public.tsx index b77daa97..986cc40e 100644 --- a/packages/client/src/components/wiki/tocs/public.tsx +++ b/packages/client/src/components/wiki/tocs/public.tsx @@ -43,72 +43,17 @@ export const WikiPublicTocs: React.FC = ({ return (
-
-
- - - +
+
+
+ + + +
-
- - } - text={} - /> - } - error={wikiError} - normalContent={() => ( - <> - - - {wiki.name.charAt(0)} - - } - text={{wiki.name}} - hoverable={false} - /> - - )} - /> - - } - text={'概述'} - href={{ - pathname: `/share/wiki/[wikiId]`, - query: { wikiId }, - }} - isActive={pathname === '/share/wiki/[wikiId]'} - /> - -
= ({ > } text={} - rightNode={} /> } - error={tocsError} + error={wikiError} normalContent={() => ( - + <> + + + {wiki.name.charAt(0)} + + } + text={{wiki.name}} + hoverable={false} + /> + )} /> -
+ + } + text={'概述'} + href={{ + pathname: `/share/wiki/[wikiId]`, + query: { wikiId }, + }} + isActive={pathname === '/share/wiki/[wikiId]'} + /> + + +
+
+ + } + text={} + rightNode={} + /> + } + error={tocsError} + normalContent={() => ( + + )} + /> +
+
); };