mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-31 07:08:40 -04:00
Reorganize redux and hooks (1/4) (#985)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
This commit is contained in:
parent
bdf8110676
commit
1b7abf9f27
61 changed files with 898 additions and 986 deletions
|
@ -7,7 +7,7 @@
|
|||
import equal from 'fast-deep-equal'
|
||||
import React from 'react'
|
||||
import { Modal } from 'react-bootstrap'
|
||||
import { useTranslation , Trans } from 'react-i18next'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import { useSelector } from 'react-redux'
|
||||
import { useParams } from 'react-router-dom'
|
||||
import { useFrontendBaseUrl } from '../../../../hooks/common/use-frontend-base-url'
|
||||
|
@ -24,7 +24,7 @@ export interface ShareModalProps {
|
|||
|
||||
export const ShareModal: React.FC<ShareModalProps> = ({ show, onHide }) => {
|
||||
useTranslation()
|
||||
const noteMetadata = useSelector((state: ApplicationState) => state.documentContent.metadata, equal)
|
||||
const noteFrontmatter = useSelector((state: ApplicationState) => state.noteDetails.frontmatter, equal)
|
||||
const editorMode = useSelector((state: ApplicationState) => state.editorConfig.editorMode)
|
||||
const baseUrl = useFrontendBaseUrl()
|
||||
const { id } = useParams<EditorPathParams>()
|
||||
|
@ -39,11 +39,11 @@ export const ShareModal: React.FC<ShareModalProps> = ({ show, onHide }) => {
|
|||
<Trans i18nKey={'editor.modal.shareLink.editorDescription'}/>
|
||||
<CopyableField content={`${baseUrl}/n/${id}?${editorMode}`} nativeShareButton={true}
|
||||
url={`${baseUrl}/n/${id}?${editorMode}`}/>
|
||||
<ShowIf condition={noteMetadata.type === 'slide'}>
|
||||
<ShowIf condition={noteFrontmatter.type === 'slide'}>
|
||||
<Trans i18nKey={'editor.modal.shareLink.slidesDescription'}/>
|
||||
<CopyableField content={`${baseUrl}/p/${id}`} nativeShareButton={true} url={`${baseUrl}/p/${id}`}/>
|
||||
</ShowIf>
|
||||
<ShowIf condition={noteMetadata.type === ''}>
|
||||
<ShowIf condition={noteFrontmatter.type === ''}>
|
||||
<Trans i18nKey={'editor.modal.shareLink.viewOnlyDescription'}/>
|
||||
<CopyableField content={`${baseUrl}/s/${id}`} nativeShareButton={true} url={`${baseUrl}/s/${id}`}/>
|
||||
</ShowIf>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue