From c380ef7089823ce6fc4cd66474c5d992abb49b17 Mon Sep 17 00:00:00 2001 From: fantasticit Date: Fri, 15 Jul 2022 15:42:20 +0800 Subject: [PATCH] client: fix build doc url --- .../client/src/components/document/actions/index.tsx | 1 + .../client/src/components/document/link/index.tsx | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/client/src/components/document/actions/index.tsx b/packages/client/src/components/document/actions/index.tsx index f07679a2..f3cf0b9d 100644 --- a/packages/client/src/components/document/actions/index.tsx +++ b/packages/client/src/components/document/actions/index.tsx @@ -133,6 +133,7 @@ export const DocumentActions: React.FC = ({ /> { diff --git a/packages/client/src/components/document/link/index.tsx b/packages/client/src/components/document/link/index.tsx index 369d78df..53a3fc8d 100644 --- a/packages/client/src/components/document/link/index.tsx +++ b/packages/client/src/components/document/link/index.tsx @@ -1,21 +1,23 @@ import { IconLink } from '@douyinfe/semi-icons'; import { Space, Typography } from '@douyinfe/semi-ui'; +import { IDocument, IOrganization, IWiki } from '@think/domains'; import { copy } from 'helpers/copy'; import { buildUrl } from 'helpers/url'; import React, { useCallback } from 'react'; interface IProps { - wikiId: string; - documentId: string; + organizationId: IOrganization['id']; + wikiId: IWiki['id']; + documentId: IDocument['id']; render?: (arg: { copy: () => void; children: React.ReactNode }) => React.ReactNode; } const { Text } = Typography; -export const DocumentLinkCopyer: React.FC = ({ wikiId, documentId, render }) => { +export const DocumentLinkCopyer: React.FC = ({ organizationId, wikiId, documentId, render }) => { const handle = useCallback(() => { - copy(buildUrl(`/wiki/${wikiId}/document/${documentId}`)); - }, [wikiId, documentId]); + copy(buildUrl(`/app/org/${organizationId}/wiki/${wikiId}/doc/${documentId}`)); + }, [organizationId, wikiId, documentId]); const content = (