Compare commits

...

4 commits

Author SHA1 Message Date
Dessalines
572175f795 v0.15.3-rc.1 2022-02-07 16:44:58 -05:00
Dessalines
b894fb69d6 Fix report page bugs. Fixes #558 (#568) 2022-02-07 16:36:53 -05:00
Dessalines
765135f824 Fix post title link bug. Fixes #547 (#563) 2022-02-07 16:35:40 -05:00
Dessalines
a1bda825a2 Add markdown footnotes. Fixes #561 (#562) 2022-02-07 16:35:35 -05:00
6 changed files with 20 additions and 7 deletions

View file

@ -1,7 +1,7 @@
{
"name": "lemmy-ui",
"description": "An isomorphic UI for lemmy",
"version": "0.15.1",
"version": "0.15.3-rc.1",
"author": "Dessalines <tyhou13@gmx.com>",
"license": "AGPL-3.0",
"scripts": {
@ -36,6 +36,7 @@
"jwt-decode": "^3.1.2",
"markdown-it": "^12.1.0",
"markdown-it-container": "^3.0.0",
"markdown-it-footnote": "^3.0.3",
"markdown-it-html5-embed": "^1.0.0",
"markdown-it-sub": "^1.0.0",
"markdown-it-sup": "^1.0.0",

View file

@ -56,6 +56,8 @@ export class CommentReport extends Component<CommentReportProps, any> {
moderators={[]}
admins={[]}
enableDownvotes={true}
viewOnly={true}
showCommunity={true}
/>
<div>
{i18n.t("reporter")}: <PersonListing person={r.creator} />

View file

@ -82,6 +82,7 @@ interface PostListingProps {
admins?: PersonViewSafe[];
enableDownvotes: boolean;
enableNsfw: boolean;
viewOnly?: boolean;
}
export class PostListing extends Component<PostListingProps, PostListingState> {
@ -513,8 +514,10 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
return (
<div class="d-flex justify-content-start flex-wrap text-muted font-weight-bold mb-1">
{this.commentsButton}
{mobile && this.mobileVotes}
{UserService.Instance.myUserInfo && this.postActions(mobile)}
{mobile && !this.props.viewOnly && this.mobileVotes}
{UserService.Instance.myUserInfo &&
!this.props.viewOnly &&
this.postActions(mobile)}
</div>
);
}
@ -1154,7 +1157,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
{/* The larger view*/}
<div class="d-none d-sm-block">
<div class="row">
{this.voteBar()}
{!this.props.viewOnly && this.voteBar()}
<div class="col-sm-2 pr-0">
<div class="">{this.thumbnail()}</div>
</div>
@ -1627,7 +1630,6 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
handleImageExpandClick(i: PostListing, event: any) {
event.preventDefault();
i.state.imageExpanded = !i.state.imageExpanded;
i.state.showBody = i.state.imageExpanded;
i.setState(i.state);
setupTippy();
}

View file

@ -48,6 +48,7 @@ export class PostReport extends Component<PostReportProps, any> {
showCommunity={true}
enableDownvotes={true}
enableNsfw={true}
viewOnly={true}
/>
<div>
{i18n.t("reporter")}: <PersonListing person={r.creator} />

View file

@ -30,6 +30,7 @@ import {
} from "lemmy-js-client";
import markdown_it from "markdown-it";
import markdown_it_container from "markdown-it-container";
import markdown_it_footnote from "markdown-it-footnote";
import markdown_it_html5_embed from "markdown-it-html5-embed";
import markdown_it_sub from "markdown-it-sub";
import markdown_it_sup from "markdown-it-sup";
@ -225,6 +226,7 @@ export const md = new markdown_it({
})
.use(markdown_it_sub)
.use(markdown_it_sup)
.use(markdown_it_footnote)
.use(markdown_it_html5_embed, {
html5embed: {
useImageSyntax: true, // Enables video/audio embed with ![]() syntax (default)
@ -1103,7 +1105,7 @@ export function updatePostReportRes(
data: PostReportView,
reports: PostReportView[]
) {
let found = reports.find(p => p.post.id == data.post.id);
let found = reports.find(p => p.post_report.id == data.post_report.id);
if (found) {
found.post_report = data.post_report;
}
@ -1113,7 +1115,7 @@ export function updateCommentReportRes(
data: CommentReportView,
reports: CommentReportView[]
) {
let found = reports.find(c => c.comment.id == data.comment.id);
let found = reports.find(c => c.comment_report.id == data.comment_report.id);
if (found) {
found.comment_report = data.comment_report;
}

View file

@ -4967,6 +4967,11 @@ markdown-it-container@^3.0.0:
resolved "https://registry.yarnpkg.com/markdown-it-container/-/markdown-it-container-3.0.0.tgz#1d19b06040a020f9a827577bb7dbf67aa5de9a5b"
integrity sha512-y6oKTq4BB9OQuY/KLfk/O3ysFhB3IMYoIWhGJEidXt1NQFocFK2sA2t0NYZAMyMShAGL6x5OPIbrmXPIqaN9rw==
markdown-it-footnote@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/markdown-it-footnote/-/markdown-it-footnote-3.0.3.tgz#e0e4c0d67390a4c5f0c75f73be605c7c190ca4d8"
integrity sha512-YZMSuCGVZAjzKMn+xqIco9d1cLGxbELHZ9do/TSYVzraooV8ypsppKNmUJ0fVH5ljkCInQAtFpm8Rb3eXSrt5w==
markdown-it-html5-embed@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/markdown-it-html5-embed/-/markdown-it-html5-embed-1.0.0.tgz#f36bedca1eb12ce4df2d53b5ec72f62ba5e094b3"