mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-01 10:09:56 +00:00
Merge remote-tracking branch 'origin/main' into feat/vote-components
* origin/main: fix: Add post body preview to desktop post listing view fix: Fix i18n UserService import issue
This commit is contained in:
commit
380d6f877c
1 changed files with 39 additions and 47 deletions
|
@ -381,10 +381,8 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
createdLine() {
|
createdLine() {
|
||||||
const post_view = this.postView;
|
const post_view = this.postView;
|
||||||
return (
|
return (
|
||||||
<ul className="list-inline mb-1 text-muted small mt-2">
|
<span className="small">
|
||||||
<li className="list-inline-item">
|
|
||||||
<PersonListing person={post_view.creator} />
|
<PersonListing person={post_view.creator} />
|
||||||
|
|
||||||
{this.creatorIsMod_ && (
|
{this.creatorIsMod_ && (
|
||||||
<span className="mx-1 badge text-bg-light">
|
<span className="mx-1 badge text-bg-light">
|
||||||
{I18NextService.i18n.t("mod")}
|
{I18NextService.i18n.t("mod")}
|
||||||
|
@ -407,7 +405,6 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
<CommunityLink community={post_view.community} />
|
<CommunityLink community={post_view.community} />
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</li>
|
|
||||||
{post_view.post.language_id !== 0 && (
|
{post_view.post.language_id !== 0 && (
|
||||||
<span className="mx-1 badge text-bg-light">
|
<span className="mx-1 badge text-bg-light">
|
||||||
{
|
{
|
||||||
|
@ -416,17 +413,13 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
)?.name
|
)?.name
|
||||||
}
|
}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}{" "}
|
||||||
<li className="list-inline-item">•</li>
|
•{" "}
|
||||||
<li className="list-inline-item">
|
|
||||||
<span>
|
|
||||||
<MomentTime
|
<MomentTime
|
||||||
published={post_view.post.published}
|
published={post_view.post.published}
|
||||||
updated={post_view.post.updated}
|
updated={post_view.post.updated}
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -727,10 +720,8 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
to={`/post/${post_view.post.id}?scrollToComments=true`}
|
to={`/post/${post_view.post.id}?scrollToComments=true`}
|
||||||
data-tippy-content={title}
|
data-tippy-content={title}
|
||||||
>
|
>
|
||||||
<span className="me-1">
|
|
||||||
<Icon icon="message-square" classes="me-1" inline />
|
<Icon icon="message-square" classes="me-1" inline />
|
||||||
{post_view.counts.comments}
|
{post_view.counts.comments}
|
||||||
</span>
|
|
||||||
{this.unreadCount && (
|
{this.unreadCount && (
|
||||||
<span className="text-muted fst-italic">
|
<span className="text-muted fst-italic">
|
||||||
({this.unreadCount} {I18NextService.i18n.t("new")})
|
({this.unreadCount} {I18NextService.i18n.t("new")})
|
||||||
|
@ -1000,7 +991,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
const post_view = this.postView;
|
const post_view = this.postView;
|
||||||
return (
|
return (
|
||||||
this.state.showAdvanced && (
|
this.state.showAdvanced && (
|
||||||
<>
|
<div className="mt-3">
|
||||||
{this.canMod_ && (
|
{this.canMod_ && (
|
||||||
<>
|
<>
|
||||||
{!this.creatorIsMod_ &&
|
{!this.creatorIsMod_ &&
|
||||||
|
@ -1161,7 +1152,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</>
|
</div>
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1356,11 +1347,11 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
showMobilePreview() {
|
showBodyPreview() {
|
||||||
const { body, id } = this.postView.post;
|
const { body, id } = this.postView.post;
|
||||||
|
|
||||||
return !this.showBody && body ? (
|
return !this.showBody && body ? (
|
||||||
<Link className="text-body" to={`/post/${id}`}>
|
<Link className="text-body mt-2 d-block" to={`/post/${id}`}>
|
||||||
<div className="md-div mb-1 preview-lines">{body}</div>
|
<div className="md-div mb-1 preview-lines">{body}</div>
|
||||||
</Link>
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
|
@ -1381,7 +1372,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
{this.mobileThumbnail()}
|
{this.mobileThumbnail()}
|
||||||
|
|
||||||
{/* Show a preview of the post body */}
|
{/* Show a preview of the post body */}
|
||||||
{this.showMobilePreview()}
|
{this.showBodyPreview()}
|
||||||
|
|
||||||
{this.commentsLine(true)}
|
{this.commentsLine(true)}
|
||||||
{this.userActionsLine()}
|
{this.userActionsLine()}
|
||||||
|
@ -1412,6 +1403,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
<div className="col-12">
|
<div className="col-12">
|
||||||
{this.postTitleLine()}
|
{this.postTitleLine()}
|
||||||
{this.createdLine()}
|
{this.createdLine()}
|
||||||
|
{this.showBodyPreview()}
|
||||||
{this.commentsLine()}
|
{this.commentsLine()}
|
||||||
{this.duplicatesLine()}
|
{this.duplicatesLine()}
|
||||||
{this.userActionsLine()}
|
{this.userActionsLine()}
|
||||||
|
|
Loading…
Reference in a new issue