File tree Expand file tree Collapse file tree 3 files changed +8
-18
lines changed
src/frontend/apps/impress/src/features/docs Expand file tree Collapse file tree 3 files changed +8
-18
lines changed Original file line number Diff line number Diff line change @@ -54,11 +54,7 @@ export const DocEditor = ({ doc, versionId }: DocEditorProps) => {
54
54
$padding = { { horizontal : isDesktop ? '54px' : 'base' } }
55
55
className = "--docs--doc-editor-header"
56
56
>
57
- { isVersion ? (
58
- < DocVersionHeader title = { doc . title } />
59
- ) : (
60
- < DocHeader doc = { doc } />
61
- ) }
57
+ { isVersion ? < DocVersionHeader /> : < DocHeader doc = { doc } /> }
62
58
</ Box >
63
59
64
60
< Box
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import {
13
13
KEY_DOC ,
14
14
KEY_LIST_DOC ,
15
15
KEY_SUB_PAGE ,
16
+ useDocStore ,
16
17
useTrans ,
17
18
useUpdateDoc ,
18
19
} from '@/docs/doc-management' ;
@@ -24,18 +25,15 @@ interface DocTitleProps {
24
25
25
26
export const DocTitle = ( { doc } : DocTitleProps ) => {
26
27
if ( ! doc . abilities . partial_update ) {
27
- return < DocTitleText title = { doc . title } /> ;
28
+ return < DocTitleText /> ;
28
29
}
29
30
30
31
return < DocTitleInput doc = { doc } /> ;
31
32
} ;
32
33
33
- interface DocTitleTextProps {
34
- title ?: string ;
35
- }
36
-
37
- export const DocTitleText = ( { title } : DocTitleTextProps ) => {
34
+ export const DocTitleText = ( ) => {
38
35
const { isMobile } = useResponsiveStore ( ) ;
36
+ const { currentDoc } = useDocStore ( ) ;
39
37
const { untitledDocument } = useTrans ( ) ;
40
38
41
39
return (
@@ -45,7 +43,7 @@ export const DocTitleText = ({ title }: DocTitleTextProps) => {
45
43
$size = { isMobile ? 'h4' : 'h2' }
46
44
$variation = "1000"
47
45
>
48
- { title || untitledDocument }
46
+ { currentDoc ?. title || untitledDocument }
49
47
</ Text >
50
48
) ;
51
49
} ;
Original file line number Diff line number Diff line change @@ -5,11 +5,7 @@ import { useCunninghamTheme } from '@/cunningham';
5
5
6
6
import { DocTitleText } from './DocTitle' ;
7
7
8
- interface DocVersionHeaderProps {
9
- title ?: string ;
10
- }
11
-
12
- export const DocVersionHeader = ( { title } : DocVersionHeaderProps ) => {
8
+ export const DocVersionHeader = ( ) => {
13
9
const { spacingsTokens } = useCunninghamTheme ( ) ;
14
10
15
11
const { t } = useTranslation ( ) ;
@@ -23,7 +19,7 @@ export const DocVersionHeader = ({ title }: DocVersionHeaderProps) => {
23
19
aria-label = { t ( 'It is the document title' ) }
24
20
className = "--docs--doc-version-header"
25
21
>
26
- < DocTitleText title = { title } />
22
+ < DocTitleText />
27
23
< HorizontalSeparator />
28
24
</ Box >
29
25
</ >
You can’t perform that action at this time.
0 commit comments