a tool for shared writing and social publishing
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

sort posts by newest first

+11 -7
+11 -7
app/lish/PostList.tsx
··· 32 32 33 33 return ( 34 34 <div className="pubPostList flex flex-col gap-3"> 35 - {props.posts.map((post, index) => { 36 - let p = post.documents?.data as PubLeafletDocument.Record; 37 - let uri = new AtUri(post.documents?.uri!); 35 + {props.posts 36 + .sort((a, b) => { 37 + return a.documents?.indexed_at! > b.documents?.indexed_at! ? -1 : 1; 38 + }) 39 + .map((post, index) => { 40 + let p = post.documents?.data as PubLeafletDocument.Record; 41 + let uri = new AtUri(post.documents?.uri!); 38 42 39 - return ( 40 - <PostListItem {...p} key={index} isFeed={props.isFeed} uri={uri} /> 41 - ); 42 - })} 43 + return ( 44 + <PostListItem {...p} key={index} isFeed={props.isFeed} uri={uri} /> 45 + ); 46 + })} 43 47 </div> 44 48 ); 45 49 };