@@ -27,12 +27,21 @@ interface PostProps {
2727 hideReplyingTo ?: boolean ;
2828 /** When true, tapping the card root is a no-op (e.g. the focused post in a conversation). */
2929 disablePress ?: boolean ;
30+ /** Draw a vertical line above the avatar — connects up to the previous post. */
31+ showThreadLineAbove ?: boolean ;
32+ /** Draw a vertical line below the avatar — connects down to the next post. */
33+ showThreadLineBelow ?: boolean ;
34+ /** Hide the bottom hairline (used inside conversation views where the thread line is the visual seam instead). */
35+ hideBottomBorder ?: boolean ;
3036}
3137
3238export const Post = memo ( function Post ( {
3339 post,
3440 hideReplyingTo : _hideReplyingTo = false ,
3541 disablePress = false ,
42+ showThreadLineAbove = false ,
43+ showThreadLineBelow = false ,
44+ hideBottomBorder = false ,
3645} : PostProps ) {
3746 const { theme } = useTheme ( ) ;
3847 const postId = post . id ;
@@ -108,12 +117,11 @@ export const Post = memo(function Post({
108117
109118 return (
110119 < Pressable
120+ role = "article"
111121 style = { ( { pressed } ) => [
112122 Atoms . w_full ,
113123 Atoms . px_lg ,
114- Atoms . pt_md ,
115- { paddingBottom : 6 } ,
116- {
124+ ! hideBottomBorder && {
117125 borderBottomWidth : 1 ,
118126 borderBottomColor : withHexOpacity ( theme . palette . neutral_500 , '20' ) ,
119127 } ,
@@ -124,16 +132,68 @@ export const Post = memo(function Post({
124132 onPress = { handlePress }
125133 disabled = { disablePress }
126134 >
135+ { /* Top padding bar */ }
127136 < View style = { [ Atoms . flex_row , Atoms . gap_lg ] } >
128- { authorIdentity ? (
129- < ProfileAvatar
130- identityKey = { authorIdentity }
131- size = "md"
132- onPress = { handleAuthorPress }
133- />
134- ) : null }
137+ < View
138+ style = { [
139+ Atoms . align_center ,
140+ ! showThreadLineAbove && Atoms . pt_md ,
141+ showThreadLineAbove && Atoms . mb_xs ,
142+ {
143+ flexBasis : 40 ,
144+ } ,
145+ ] }
146+ >
147+ { showThreadLineAbove ? (
148+ < View
149+ style = { [
150+ Atoms . flex_1 ,
151+ {
152+ width : 2 ,
153+ backgroundColor : withHexOpacity (
154+ theme . palette . neutral_500 ,
155+ '30' ,
156+ ) ,
157+ } ,
158+ ] }
159+ />
160+ ) : null }
161+ </ View >
162+ { /* Empty */ }
163+ < View style = { [ Atoms . flex_1 , showThreadLineAbove && Atoms . pt_md ] } > </ View >
164+ </ View >
165+
166+ { /* Main post body */ }
167+ < View style = { [ Atoms . flex_row , Atoms . gap_lg ] } >
168+ { /* Left side (avatar and thread line) */ }
169+ < View style = { [ Atoms . align_center ] } >
170+ { authorIdentity ? (
171+ < ProfileAvatar
172+ identityKey = { authorIdentity }
173+ size = "md"
174+ onPress = { handleAuthorPress }
175+ />
176+ ) : null }
177+ { showThreadLineBelow ? (
178+ < View
179+ style = { [
180+ Atoms . flex_1 ,
181+ Atoms . mt_xs ,
182+ {
183+ width : 2 ,
184+ backgroundColor : withHexOpacity (
185+ theme . palette . neutral_500 ,
186+ '30' ,
187+ ) ,
188+ } ,
189+ ] }
190+ />
191+ ) : null }
192+ </ View >
135193
136- < View style = { Atoms . flex_1 } >
194+ { /* Main post content */ }
195+ < View style = { [ Atoms . flex_1 , Atoms . pb_md ] } >
196+ { /* Author name and other topbar items */ }
137197 < View
138198 style = { [
139199 Atoms . flex_row ,
@@ -172,10 +232,12 @@ export const Post = memo(function Post({
172232 ) : null }
173233 </ View >
174234
175- < Text variant = "secondary" style = { { marginTop : 4 , lineHeight : 20 } } >
176- { displayContent }
177- { isTruncatedPreview ? '...' : '' }
178- </ Text >
235+ { displayContent ? (
236+ < Text variant = "secondary" style = { [ Atoms . mt_xs ] } >
237+ { displayContent }
238+ { isTruncatedPreview ? '...' : '' }
239+ </ Text >
240+ ) : null }
179241 { post . images ?. length > 0 && < PostImages images = { post . images } /> }
180242 { showContentExpandToggle && (
181243 < Pressable
@@ -197,17 +259,16 @@ export const Post = memo(function Post({
197259 </ Text >
198260 </ Pressable >
199261 ) }
262+ < PostToolbar
263+ onReply = { handleReply }
264+ onLike = { handleLike }
265+ onDislike = { handleDislike }
266+ liked = { liked }
267+ disliked = { disliked }
268+ style = { { marginTop : 8 } }
269+ />
200270 </ View >
201271 </ View >
202-
203- < PostToolbar
204- onReply = { handleReply }
205- onLike = { handleLike }
206- onDislike = { handleDislike }
207- liked = { liked }
208- disliked = { disliked }
209- style = { { marginTop : 8 , paddingLeft : 50 } }
210- />
211272 </ Pressable >
212273 ) ;
213274} ) ;
0 commit comments