File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
framework/core/js/src/forum/components Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -78,11 +78,24 @@ export default class PostStream extends Component {
78
78
content = < PostLoading /> ;
79
79
}
80
80
81
- return (
81
+ const postStreamElement = (
82
82
< div className = "PostStream-item" { ...attrs } >
83
83
{ content }
84
84
</ div >
85
85
) ;
86
+
87
+ // If we're on the first post, call the afterFirstPostItems method and add any additional elements.
88
+ if ( i === 0 && this . afterFirstPostItems ( ) . toArray ( ) . length > 0 ) {
89
+ // Using m.fragment to return multiple elements without an enclosing container
90
+ return m . fragment ( { ...attrs } , [
91
+ postStreamElement ,
92
+ < div className = "PostStream-item PostStream-afterFirstPost" key = "afterFirstPost" >
93
+ { this . afterFirstPostItems ( ) . toArray ( ) }
94
+ </ div > ,
95
+ ] ) ;
96
+ }
97
+
98
+ return postStreamElement ;
86
99
} ) ;
87
100
88
101
if ( ! viewingEnd && posts [ this . stream . visibleEnd - this . stream . visibleStart - 1 ] ) {
@@ -117,6 +130,15 @@ export default class PostStream extends Component {
117
130
) ;
118
131
}
119
132
133
+ /**
134
+ * @returns {ItemList<import('mithril').Children> }
135
+ */
136
+ afterFirstPostItems ( ) {
137
+ const items = new ItemList ( ) ;
138
+
139
+ return items ;
140
+ }
141
+
120
142
/**
121
143
* @returns {ItemList<import('mithril').Children> }
122
144
*/
You can’t perform that action at this time.
0 commit comments