mirror of https://github.com/fantasticit/think.git
client: fix server render editor
This commit is contained in:
parent
85db72e0fe
commit
fb0e416065
|
@ -14,6 +14,7 @@ import { useDocumentDetail } from 'data/document';
|
|||
import { useUser } from 'data/user';
|
||||
import { triggerJoinUser } from 'event';
|
||||
import { useDocumentStyle } from 'hooks/use-document-style';
|
||||
import { useMount } from 'hooks/use-mount';
|
||||
import { IsOnMobile } from 'hooks/use-on-mobile';
|
||||
import { useWindowSize } from 'hooks/use-window-size';
|
||||
import Router from 'next/router';
|
||||
|
@ -46,6 +47,7 @@ interface IProps {
|
|||
|
||||
export const DocumentReader: React.FC<IProps> = ({ documentId }) => {
|
||||
const { isMobile } = IsOnMobile.useHook();
|
||||
const mounted = useMount();
|
||||
const [container, setContainer] = useState<HTMLDivElement>();
|
||||
const { width: windowWidth } = useWindowSize();
|
||||
const { width, fontSize } = useDocumentStyle();
|
||||
|
@ -152,6 +154,7 @@ export const DocumentReader: React.FC<IProps> = ({ documentId }) => {
|
|||
normalContent={() => (
|
||||
<>
|
||||
<Seo title={document.title} />
|
||||
{mounted && (
|
||||
<CollaborationEditor
|
||||
editable={false}
|
||||
user={user}
|
||||
|
@ -165,6 +168,7 @@ export const DocumentReader: React.FC<IProps> = ({ documentId }) => {
|
|||
</div>
|
||||
}
|
||||
/>
|
||||
)}
|
||||
{!isMobile && authority && authority.editable && container && (
|
||||
<BackTop style={editBtnStyle} onClick={gotoEdit} target={() => container} visibilityHeight={200}>
|
||||
<IconEdit />
|
||||
|
|
Loading…
Reference in New Issue