feat: move documents share management to wiki/[wikiId]/documents

This commit is contained in:
fantasticit 2022-05-11 23:26:46 +08:00
parent 94f3fd7981
commit ed78cfe8ad
4 changed files with 15 additions and 13 deletions

View File

@ -13,7 +13,7 @@ interface IProps {
wikiId: string;
}
export const Documents: React.FC<IProps> = ({ wikiId }) => {
export const WikiDocumentsShare: React.FC<IProps> = ({ wikiId }) => {
const { data: wiki, loading: wikiLoading, toggleStatus: toggleWorkspaceStatus } = useWikiDetail(wikiId);
const { data: tocs, loading } = useWikiTocs(wikiId);
const documents = useMemo(

View File

@ -4,7 +4,6 @@ import { Seo } from 'components/seo';
import { useWikiDetail } from 'data/wiki';
import { Base } from './base';
import { Users } from './users';
import { Documents } from './documents';
import { More } from './more';
interface IProps {
@ -16,7 +15,6 @@ interface IProps {
const TitleMap = {
base: '基础信息',
users: '成员管理',
docs: '隐私管理',
more: '更多',
};
@ -33,9 +31,6 @@ export const WikiSetting: React.FC<IProps> = ({ wikiId, tab, onNavigate }) => {
<TabPane tab={TitleMap['users']} itemKey="users">
<Users wikiId={wikiId} />
</TabPane>
<TabPane tab={TitleMap['docs']} itemKey="docs">
<Documents wikiId={wikiId} />
</TabPane>
<TabPane tab={TitleMap['more']} itemKey="more">
<More wikiId={wikiId} />
</TabPane>

View File

@ -11,6 +11,7 @@ import { WikiTocsManager } from 'components/wiki/tocs/manager';
import { DocumentCardPlaceholder, DocumentCard } from 'components/document/card';
import { Empty } from 'components/empty';
import { DocumentCreator } from 'components/document-creator';
import { WikiDocumentsShare } from 'components/wiki/documents-share';
import { useWikiDocs } from 'data/wiki';
interface IProps {
@ -62,6 +63,12 @@ const AllDocs = ({ wikiId }) => {
);
};
const TitleMap = {
tocs: '目录管理',
share: '隐私管理',
documents: '全部文档',
};
const Page: NextPage<IProps> = ({ wikiId }) => {
const { query = {} } = useRouter();
const { tab = 'tocs' } = query as {
@ -83,15 +90,15 @@ const Page: NextPage<IProps> = ({ wikiId }) => {
leftNode={<WikiTocs wikiId={wikiId} />}
rightNode={
<div style={{ padding: '16px 24px' }}>
<Seo title={tab === 'documents' ? '全部文档' : '目录管理'} />
<Title heading={3} style={{ marginBottom: 24 }}>
</Title>
<Tabs type="button" activeKey={tab} onChange={(tab) => navigate(tab)}>
<TabPane tab="目录管理" itemKey="tocs">
<Seo title={TitleMap[tab]} />
<Tabs type="line" activeKey={tab} onChange={(tab) => navigate(tab)}>
<TabPane tab={TitleMap['tocs']} itemKey="tocs">
<WikiTocsManager wikiId={wikiId} />
</TabPane>
<TabPane tab="全部文档" itemKey="documents">
<TabPane tab={TitleMap['share']} itemKey="share">
<WikiDocumentsShare wikiId={wikiId} />
</TabPane>
<TabPane tab={TitleMap['documents']} itemKey="documents">
<AllDocs wikiId={wikiId} />
</TabPane>
</Tabs>