X-Git-Url: http://these/git/?a=blobdiff_plain;f=src%2Fshared%2Fcomponents%2Fpost%2Fpost-listings.tsx;h=fc77f505a11ff76119bd52658dc4a116bb04603b;hb=afafb777b4be09d70cd8f56f8d236d98ac63ba6e;hp=098a015d1beecf9cdfcf0f25e2eed27092955450;hpb=2b1af707c3df6126b3e6890106c03c60ad49b1be;p=lemmy-ui.git diff --git a/src/shared/components/post/post-listings.tsx b/src/shared/components/post/post-listings.tsx index 098a015..fc77f50 100644 --- a/src/shared/components/post/post-listings.tsx +++ b/src/shared/components/post/post-listings.tsx @@ -14,6 +14,7 @@ import { FeaturePost, Language, LockPost, + MarkPostAsRead, PostView, PurgePerson, PurgePost, @@ -21,7 +22,7 @@ import { SavePost, TransferCommunity, } from "lemmy-js-client"; -import { i18n } from "../../i18next"; +import { I18NextService } from "../../services"; import { PostListing } from "./post-listing"; interface PostListingsProps { @@ -49,6 +50,7 @@ interface PostListingsProps { onAddModToCommunity(form: AddModToCommunity): void; onAddAdmin(form: AddAdmin): void; onTransferCommunity(form: TransferCommunity): void; + onMarkPostAsRead(form: MarkPostAsRead): void; } export class PostListings extends Component { @@ -66,9 +68,9 @@ export class PostListings extends Component { render() { return ( -
+
{this.posts.length > 0 ? ( - this.posts.map(post_view => ( + this.posts.map((post_view, idx) => ( <> { onAddModToCommunity={this.props.onAddModToCommunity} onAddAdmin={this.props.onAddAdmin} onTransferCommunity={this.props.onTransferCommunity} + onMarkPostAsRead={this.props.onMarkPostAsRead} /> -
+ {idx + 1 !== this.posts.length &&
} )) ) : ( <> -
{i18n.t("no_posts")}
+
{I18NextService.i18n.t("no_posts")}
{this.props.showCommunity && ( ## @@ -141,7 +144,7 @@ export class PostListings extends Component { // Sort by oldest // Remove the ones that have no length for (const e of urlMap.entries()) { - if (e[1].length == 1) { + if (e[1].length === 1) { urlMap.delete(e[0]); } else { e[1].sort((a, b) => a.post.published.localeCompare(b.post.published)); @@ -155,7 +158,7 @@ export class PostListings extends Component { const found = urlMap.get(url); if (found) { // If its the oldest, add - if (pv.post.id == found[0].post.id) { + if (pv.post.id === found[0].post.id) { this.duplicatesMap.set(pv.post.id, found.slice(1)); } // Otherwise, delete it