Commit cad7a43 1 parent e169fb3 commit cad7a43 Copy full SHA for cad7a43
File tree 4 files changed +22
-2
lines changed
4 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -81,8 +81,9 @@ export function ContentItem(props: ContainerProps) {
81
81
< GripVertical className = "w-4 h-4" />
82
82
</ div >
83
83
84
- { /* 桌面端展示 */ }
85
- < a href = { `/#${ item . id } ` } className = "min-h-[61px] relative border-b border-b-border py-4 hidden sm:block" >
84
+ { /* 桌面端展示,只允许一级标题可点击 */ }
85
+ { ! item . parentId
86
+ ? < a href = { `/#${ item . id } ` } className = "min-h-[61px] relative border-b border-b-border py-4 hidden sm:block" >
86
87
< div className = "mr-28" > { parse ( DOMPurify . sanitize ( item . title ) ) } </ div >
87
88
< ContentItemButtons
88
89
item = { item }
@@ -91,6 +92,15 @@ export function ContentItem(props: ContainerProps) {
91
92
onSubContentAdd = { handleSubContentAdd }
92
93
/>
93
94
</ a >
95
+ : < div className = "min-h-[61px] relative border-b border-b-border py-4" onClick = { e => e . preventDefault ( ) } >
96
+ < div className = "mr-28 select-none" > { parse ( DOMPurify . sanitize ( item . title ) ) } </ div >
97
+ < ContentItemButtons
98
+ item = { item }
99
+ onContentEdit = { handleContentEdit }
100
+ onDialogOpen = { handleDialogOpen }
101
+ onSubContentAdd = { handleSubContentAdd }
102
+ />
103
+ </ div > }
94
104
95
105
{ /* 移动端展示 */ }
96
106
< div className = "min-h-[61px] relative border-b border-b-border py-4 sm:hidden" onClick = { e => e . preventDefault ( ) } >
Original file line number Diff line number Diff line change @@ -155,6 +155,7 @@ export const cartoonTemplate: ArticleModuleTemplate = {
155
155
} ,
156
156
} ,
157
157
content : {
158
+ flexGrow : 1 ,
158
159
width : '100%' ,
159
160
paddingTop : '30px' ,
160
161
paddingLeft : '16px' ,
@@ -164,6 +165,7 @@ export const cartoonTemplate: ArticleModuleTemplate = {
164
165
borderRadius : '8px' ,
165
166
border : '1px solid' ,
166
167
backgroundColor : 'var(--main-content-background)' ,
168
+ overflow : 'hidden' ,
167
169
} ,
168
170
} ,
169
171
sub : {
Original file line number Diff line number Diff line change @@ -44,6 +44,8 @@ export const simpleTemplate: ArticleModuleTemplate = {
44
44
} ,
45
45
main : {
46
46
container : {
47
+ 'display' : 'flex' ,
48
+ 'flexDirection' : 'column' ,
47
49
'padding' : '45px 36px' ,
48
50
49
51
'&:nth-of-type(2n)' : {
@@ -61,6 +63,7 @@ export const simpleTemplate: ArticleModuleTemplate = {
61
63
color : 'var(--main-title-foreground)' ,
62
64
} ,
63
65
content : {
66
+ 'flexGrow' : 1 ,
64
67
'color' : 'var(--main-content-foreground)' ,
65
68
'backgroundColor' : 'var(--main-content-background)' ,
66
69
'fontSize' : '15px' ,
@@ -82,6 +85,7 @@ export const simpleTemplate: ArticleModuleTemplate = {
82
85
backgroundColor : 'var(--main-content-secondary-background)' ,
83
86
color : 'var(--sub-container-foreground)' ,
84
87
} ,
88
+ 'overflow' : 'hidden' ,
85
89
} ,
86
90
} ,
87
91
sub : {
Original file line number Diff line number Diff line change @@ -45,6 +45,8 @@ export const techTemplate: ArticleModuleTemplate = {
45
45
} ,
46
46
main : {
47
47
container : {
48
+ display : 'flex' ,
49
+ flexDirection : 'column' ,
48
50
paddingLeft : '12px' ,
49
51
paddingRight : '12px' ,
50
52
paddingTop : '13px' ,
@@ -84,12 +86,14 @@ export const techTemplate: ArticleModuleTemplate = {
84
86
} ,
85
87
} ,
86
88
content : {
89
+ flexGrow : 1 ,
87
90
position : 'relative' ,
88
91
padding : '12px 18px' ,
89
92
borderRadius : '12px' ,
90
93
fontSize : '15px' ,
91
94
backgroundColor : 'rgb(255 255 255 / 0.7)' ,
92
95
color : 'var(--main-content-foreground)' ,
96
+ overflow : 'hidden' ,
93
97
} ,
94
98
} ,
95
99
sub : {
You can’t perform that action at this time.
0 commit comments