From ebe4ecd9f41fffd7fdf8fd3b5491fdf3390991e1 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 14 Sep 2021 19:12:05 -0400 Subject: [PATCH 01/17] v0.12.2 --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 28620114..4ff38606 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "name": "lemmy-ui", "description": "An isomorphic UI for lemmy", + "version": "0.12.2", "author": "Dessalines ", "license": "AGPL-3.0", "scripts": { From 82bea8549af1a20cd9e4bbfe62fcd2cceb1b7dee Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 14 Sep 2021 19:13:13 -0400 Subject: [PATCH 02/17] Add version to package.json . Fixes #411 --- deploy.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deploy.sh b/deploy.sh index 57aa8189..ce125fcd 100755 --- a/deploy.sh +++ b/deploy.sh @@ -7,5 +7,9 @@ new_tag="$1" # sudo docker build . --tag dessalines/lemmy-ui:$new_tag # sudo docker push dessalines/lemmy-ui:$new_tag +# Upgrade version +yarn version --new-version $new_tag +git push + git tag $new_tag git push origin $new_tag From 4b23b78efeb71d36ed595aa975e1e2dd71ccaf2a Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sat, 18 Sep 2021 10:27:49 -0400 Subject: [PATCH 03/17] Use my fork of inferno-i18next. Fixes #413 (#415) --- .eslintrc.json | 1 + package.json | 2 +- src/shared/components/app/app.tsx | 2 +- src/shared/components/comment/comment-form.tsx | 2 +- src/shared/components/home/home.tsx | 2 +- src/shared/components/home/login.tsx | 2 +- src/shared/components/post/post-listings.tsx | 2 +- .../private_message/private-message-form.tsx | 2 +- src/shared/utils.ts | 11 +++++++++++ yarn.lock | 7 ++++--- 10 files changed, 23 insertions(+), 10 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 093a700c..4e05f0c5 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -16,6 +16,7 @@ "warnOnUnsupportedTypeScriptVersion": false }, "rules": { + "@typescript-eslint/ban-ts-comment": 0, "@typescript-eslint/no-explicit-any": 0, "@typescript-eslint/explicit-module-boundary-types": 0, "arrow-body-style": 0, diff --git a/package.json b/package.json index 4ff38606..3a13537b 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "inferno-create-element": "^7.4.9", "inferno-helmet": "^5.2.1", "inferno-hydrate": "^7.4.9", - "inferno-i18next": "github:nimbusec-oss/inferno-i18next#semver:^7.4.2", + "inferno-i18next-dess": "^0.0.1", "inferno-router": "^7.4.9", "inferno-server": "^7.4.9", "isomorphic-cookie": "^1.2.4", diff --git a/src/shared/components/app/app.tsx b/src/shared/components/app/app.tsx index ddf466b6..bac634e3 100644 --- a/src/shared/components/app/app.tsx +++ b/src/shared/components/app/app.tsx @@ -1,6 +1,6 @@ import { Component } from "inferno"; import { Helmet } from "inferno-helmet"; -import { Provider } from "inferno-i18next"; +import { Provider } from "inferno-i18next-dess"; import { Route, Switch } from "inferno-router"; import { GetSiteResponse } from "lemmy-js-client"; import { i18n } from "../../i18next"; diff --git a/src/shared/components/comment/comment-form.tsx b/src/shared/components/comment/comment-form.tsx index 95dff716..515e3d99 100644 --- a/src/shared/components/comment/comment-form.tsx +++ b/src/shared/components/comment/comment-form.tsx @@ -1,5 +1,5 @@ import { Component } from "inferno"; -import { T } from "inferno-i18next"; +import { T } from "inferno-i18next-dess"; import { Link } from "inferno-router"; import { CommentResponse, diff --git a/src/shared/components/home/home.tsx b/src/shared/components/home/home.tsx index 3cdb238d..d06bf011 100644 --- a/src/shared/components/home/home.tsx +++ b/src/shared/components/home/home.tsx @@ -1,5 +1,5 @@ import { Component, linkEvent } from "inferno"; -import { T } from "inferno-i18next"; +import { T } from "inferno-i18next-dess"; import { Link } from "inferno-router"; import { AddAdminResponse, diff --git a/src/shared/components/home/login.tsx b/src/shared/components/home/login.tsx index b227d64a..612a6b70 100644 --- a/src/shared/components/home/login.tsx +++ b/src/shared/components/home/login.tsx @@ -1,5 +1,5 @@ import { Component, linkEvent } from "inferno"; -import { T } from "inferno-i18next"; +import { T } from "inferno-i18next-dess"; import { GetCaptchaResponse, GetSiteResponse, diff --git a/src/shared/components/post/post-listings.tsx b/src/shared/components/post/post-listings.tsx index 3dc8260e..12d51936 100644 --- a/src/shared/components/post/post-listings.tsx +++ b/src/shared/components/post/post-listings.tsx @@ -1,5 +1,5 @@ import { Component } from "inferno"; -import { T } from "inferno-i18next"; +import { T } from "inferno-i18next-dess"; import { Link } from "inferno-router"; import { PostView } from "lemmy-js-client"; import { i18n } from "../../i18next"; diff --git a/src/shared/components/private_message/private-message-form.tsx b/src/shared/components/private_message/private-message-form.tsx index 542c48b7..60ae52d1 100644 --- a/src/shared/components/private_message/private-message-form.tsx +++ b/src/shared/components/private_message/private-message-form.tsx @@ -1,5 +1,5 @@ import { Component, linkEvent } from "inferno"; -import { T } from "inferno-i18next"; +import { T } from "inferno-i18next-dess"; import { Prompt } from "inferno-router"; import { CreatePrivateMessage, diff --git a/src/shared/utils.ts b/src/shared/utils.ts index 642bb755..17206076 100644 --- a/src/shared/utils.ts +++ b/src/shared/utils.ts @@ -1431,3 +1431,14 @@ export function initializeSite(site: GetSiteResponse) { UserService.Instance.myUserInfo = site.my_user; i18n.changeLanguage(getLanguage()); } + +let SHORTNUM_SI_FORMAT = new Intl.NumberFormat("en-US", { + maximumFractionDigits: 1, + //@ts-ignore + notation: "compact", + compactDisplay: "short", +}); + +export function numToSI(value: any) { + return SHORTNUM_SI_FORMAT.format(value); +} diff --git a/yarn.lock b/yarn.lock index bf33823d..ab163145 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4045,9 +4045,10 @@ inferno-hydrate@^7.4.9: dependencies: inferno "7.4.9" -"inferno-i18next@github:nimbusec-oss/inferno-i18next#semver:^7.4.2": - version "7.4.2" - resolved "https://codeload.github.com/nimbusec-oss/inferno-i18next/tar.gz/54b9be591ccd62c53799ad23e35f17144a62f909" +inferno-i18next-dess@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/inferno-i18next-dess/-/inferno-i18next-dess-0.0.1.tgz#48ae6bb4c3a617e59ff8dc97b9ed70f2ef762206" + integrity sha512-z/6UnuWFMyBivfR3SI9AmgA0/JvXARqtG/9BQryaLPenlG7iAb4cN2TeSt0mHIgFOo01QHVWZ8dqn7jZRijp2Q== dependencies: html-parse-stringify2 "^2.0.1" inferno "^7.4.2" From 4ec200ae6d9fae04ef742c6b321f58cc6ffbd841 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sat, 18 Sep 2021 10:30:03 -0400 Subject: [PATCH 04/17] Fix profile paging. Fixes #416 (#417) --- src/shared/components/person/profile.tsx | 1 + src/shared/utils.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/shared/components/person/profile.tsx b/src/shared/components/person/profile.tsx index 591b5036..5289b688 100644 --- a/src/shared/components/person/profile.tsx +++ b/src/shared/components/person/profile.tsx @@ -92,6 +92,7 @@ export class Profile extends Component { this.state = this.emptyState; this.handleSortChange = this.handleSortChange.bind(this); + this.handlePageChange = this.handlePageChange.bind(this); this.parseMessage = this.parseMessage.bind(this); this.subscription = wsSubscribe(this.parseMessage); diff --git a/src/shared/utils.ts b/src/shared/utils.ts index 17206076..ab2e8985 100644 --- a/src/shared/utils.ts +++ b/src/shared/utils.ts @@ -1432,8 +1432,8 @@ export function initializeSite(site: GetSiteResponse) { i18n.changeLanguage(getLanguage()); } -let SHORTNUM_SI_FORMAT = new Intl.NumberFormat("en-US", { - maximumFractionDigits: 1, +const SHORTNUM_SI_FORMAT = new Intl.NumberFormat("en-US", { + maximumSignificantDigits: 3, //@ts-ignore notation: "compact", compactDisplay: "short", From a2aac813cf7c43c2941b02b1a3464a5c0d03e569 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sat, 18 Sep 2021 12:35:49 -0400 Subject: [PATCH 05/17] Si simplifier (#418) * Updating translations. * Use a number simplifier for counts. Fixes #407 --- lemmy-translations | 2 +- src/shared/components/app/navbar.tsx | 5 ++-- .../components/comment/comment-node.tsx | 15 ++++++++--- .../components/community/communities.tsx | 15 +++++++---- src/shared/components/community/sidebar.tsx | 27 ++++++++++++++++--- src/shared/components/home/home.tsx | 21 +++++++++++++-- src/shared/components/person/profile.tsx | 7 ++++- src/shared/components/post/post-listing.tsx | 14 +++++++--- src/shared/components/search.tsx | 3 +++ src/shared/utils.ts | 2 +- 10 files changed, 89 insertions(+), 22 deletions(-) diff --git a/lemmy-translations b/lemmy-translations index eee933bd..183033e0 160000 --- a/lemmy-translations +++ b/lemmy-translations @@ -1 +1 @@ -Subproject commit eee933bd87780e0e2a8700e9b8fe0047f14f428a +Subproject commit 183033e0f796b450911e4e8f708ddd5969b12b77 diff --git a/src/shared/components/app/navbar.tsx b/src/shared/components/app/navbar.tsx index 06304a8c..6f204691 100644 --- a/src/shared/components/app/navbar.tsx +++ b/src/shared/components/app/navbar.tsx @@ -25,6 +25,7 @@ import { isBrowser, notifyComment, notifyPrivateMessage, + numToSI, setTheme, showAvatars, supportLemmyUrl, @@ -189,7 +190,7 @@ export class Navbar extends Component { "unread_messages" )}`} > - {this.state.unreadCount} + {numToSI(this.state.unreadCount)} )} @@ -309,7 +310,7 @@ export class Navbar extends Component { "unread_messages" )}`} > - {this.state.unreadCount} + {numToSI(this.state.unreadCount)} )} diff --git a/src/shared/components/comment/comment-node.tsx b/src/shared/components/comment/comment-node.tsx index 10078667..cb7818a9 100644 --- a/src/shared/components/comment/comment-node.tsx +++ b/src/shared/components/comment/comment-node.tsx @@ -30,6 +30,7 @@ import { getUnixTime, isMod, mdToHtml, + numToSI, setupTippy, showScores, wsClient, @@ -217,9 +218,10 @@ export class CommentNode extends Component { class="mr-1 font-weight-bold" aria-label={i18n.t("number_of_points", { count: this.state.score, + formattedCount: this.state.score, })} > - {this.state.score} + {numToSI(this.state.score)} @@ -293,7 +295,9 @@ export class CommentNode extends Component { {showScores() && this.state.upvotes !== this.state.score && ( - {this.state.upvotes} + + {numToSI(this.state.upvotes)} + )} {this.props.enableDownvotes && ( @@ -310,7 +314,9 @@ export class CommentNode extends Component { {showScores() && this.state.upvotes !== this.state.score && ( - {this.state.downvotes} + + {numToSI(this.state.downvotes)} + )} )} @@ -1289,14 +1295,17 @@ export class CommentNode extends Component { get pointsTippy(): string { let points = i18n.t("number_of_points", { count: this.state.score, + formattedCount: this.state.score, }); let upvotes = i18n.t("number_of_upvotes", { count: this.state.upvotes, + formattedCount: this.state.upvotes, }); let downvotes = i18n.t("number_of_downvotes", { count: this.state.downvotes, + formattedCount: this.state.downvotes, }); return `${points} • ${upvotes} • ${downvotes}`; diff --git a/src/shared/components/community/communities.tsx b/src/shared/components/community/communities.tsx index aa34be35..1cb74e26 100644 --- a/src/shared/components/community/communities.tsx +++ b/src/shared/components/community/communities.tsx @@ -19,6 +19,7 @@ import { getListingTypeFromPropsNoDefault, getPageFromProps, isBrowser, + numToSI, setIsoData, setOptionalAuth, showLocal, @@ -160,13 +161,17 @@ export class Communities extends Component { - {cv.counts.subscribers} - {cv.counts.users_active_month} - - {cv.counts.posts} + + {numToSI(cv.counts.subscribers)} + + + {numToSI(cv.counts.users_active_month)} - {cv.counts.comments} + {numToSI(cv.counts.posts)} + + + {numToSI(cv.counts.comments)} {cv.subscribed ? ( diff --git a/src/shared/components/community/sidebar.tsx b/src/shared/components/community/sidebar.tsx index c0cb9919..d4a5bc51 100644 --- a/src/shared/components/community/sidebar.tsx +++ b/src/shared/components/community/sidebar.tsx @@ -11,7 +11,13 @@ import { } from "lemmy-js-client"; import { i18n } from "../../i18next"; import { UserService, WebSocketService } from "../../services"; -import { authField, getUnixTime, mdToHtml, wsClient } from "../../utils"; +import { + authField, + getUnixTime, + mdToHtml, + numToSI, + wsClient, +} from "../../utils"; import { BannerIconHeader } from "../common/banner-icon-header"; import { Icon } from "../common/icon"; import { CommunityForm } from "../community/community-form"; @@ -143,16 +149,21 @@ export class Sidebar extends Component { return (
  • - {i18n.t("number_online", { count: this.props.online })} + {i18n.t("number_online", { + count: this.props.online, + formattedCount: numToSI(this.props.online), + })}
  • {i18n.t("number_of_users", { count: counts.users_active_day, + formattedCount: numToSI(counts.users_active_day), })}{" "} / {i18n.t("day")}
  • @@ -160,10 +171,12 @@ export class Sidebar extends Component { className="list-inline-item badge badge-secondary pointer" data-tippy-content={`${i18n.t("number_of_users", { count: counts.users_active_week, + formattedCount: counts.users_active_week, })} ${i18n.t("active_in_the_last")} ${i18n.t("week")}`} > {i18n.t("number_of_users", { count: counts.users_active_week, + formattedCount: numToSI(counts.users_active_week), })}{" "} / {i18n.t("week")} @@ -171,10 +184,12 @@ export class Sidebar extends Component { className="list-inline-item badge badge-secondary pointer" data-tippy-content={`${i18n.t("number_of_users", { count: counts.users_active_month, + formattedCount: counts.users_active_month, })} ${i18n.t("active_in_the_last")} ${i18n.t("month")}`} > {i18n.t("number_of_users", { count: counts.users_active_month, + formattedCount: numToSI(counts.users_active_month), })}{" "} / {i18n.t("month")} @@ -182,28 +197,34 @@ export class Sidebar extends Component { className="list-inline-item badge badge-secondary pointer" data-tippy-content={`${i18n.t("number_of_users", { count: counts.users_active_half_year, + formattedCount: counts.users_active_half_year, })} ${i18n.t("active_in_the_last")} ${i18n.t("number_of_months", { count: 6, + formattedCount: 6, })}`} > {i18n.t("number_of_users", { count: counts.users_active_half_year, + formattedCount: numToSI(counts.users_active_half_year), })}{" "} - / {i18n.t("number_of_months", { count: 6 })} + / {i18n.t("number_of_months", { count: 6, formattedCount: 6 })}
  • {i18n.t("number_of_subscribers", { count: counts.subscribers, + formattedCount: numToSI(counts.subscribers), })}
  • {i18n.t("number_of_posts", { count: counts.posts, + formattedCount: numToSI(counts.posts), })}
  • {i18n.t("number_of_comments", { count: counts.comments, + formattedCount: numToSI(counts.comments), })}
  • diff --git a/src/shared/components/home/home.tsx b/src/shared/components/home/home.tsx index d06bf011..a22a9593 100644 --- a/src/shared/components/home/home.tsx +++ b/src/shared/components/home/home.tsx @@ -40,6 +40,7 @@ import { getSortTypeFromProps, mdToHtml, notifyPost, + numToSI, restoreScrollPosition, saveCommentRes, saveScrollPosition, @@ -503,16 +504,21 @@ export class Home extends Component { return (
    • - {i18n.t("number_online", { count: this.state.siteRes.online })} + {i18n.t("number_online", { + count: this.state.siteRes.online, + formattedCount: numToSI(this.state.siteRes.online), + })}
    • {i18n.t("number_of_users", { count: counts.users_active_day, + formattedCount: numToSI(counts.users_active_day), })}{" "} / {i18n.t("day")}
    • @@ -520,10 +526,12 @@ export class Home extends Component { className="list-inline-item badge badge-secondary pointer" data-tippy-content={`${i18n.t("number_of_users", { count: counts.users_active_week, + formattedCount: counts.users_active_week, })} ${i18n.t("active_in_the_last")} ${i18n.t("week")}`} > {i18n.t("number_of_users", { count: counts.users_active_week, + formattedCount: numToSI(counts.users_active_week), })}{" "} / {i18n.t("week")} @@ -531,10 +539,12 @@ export class Home extends Component { className="list-inline-item badge badge-secondary pointer" data-tippy-content={`${i18n.t("number_of_users", { count: counts.users_active_month, + formattedCount: counts.users_active_month, })} ${i18n.t("active_in_the_last")} ${i18n.t("month")}`} > {i18n.t("number_of_users", { count: counts.users_active_month, + formattedCount: numToSI(counts.users_active_month), })}{" "} / {i18n.t("month")} @@ -542,33 +552,40 @@ export class Home extends Component { className="list-inline-item badge badge-secondary pointer" data-tippy-content={`${i18n.t("number_of_users", { count: counts.users_active_half_year, + formattedCount: counts.users_active_half_year, })} ${i18n.t("active_in_the_last")} ${i18n.t("number_of_months", { count: 6, + formattedCount: 6, })}`} > {i18n.t("number_of_users", { count: counts.users_active_half_year, + formattedCount: numToSI(counts.users_active_half_year), })}{" "} - / {i18n.t("number_of_months", { count: 6 })} + / {i18n.t("number_of_months", { count: 6, formattedCount: 6 })}
    • {i18n.t("number_of_users", { count: counts.users, + formattedCount: numToSI(counts.users), })}
    • {i18n.t("number_of_communities", { count: counts.communities, + formattedCount: numToSI(counts.communities), })}
    • {i18n.t("number_of_posts", { count: counts.posts, + formattedCount: numToSI(counts.posts), })}
    • {i18n.t("number_of_comments", { count: counts.comments, + formattedCount: numToSI(counts.comments), })}
    • diff --git a/src/shared/components/person/profile.tsx b/src/shared/components/person/profile.tsx index 5289b688..1dcd8e5d 100644 --- a/src/shared/components/person/profile.tsx +++ b/src/shared/components/person/profile.tsx @@ -26,6 +26,7 @@ import { fetchLimit, getUsernameFromProps, mdToHtml, + numToSI, previewLines, restoreScrollPosition, routeSortTypeToEnum, @@ -403,11 +404,15 @@ export class Profile extends Component {
      • - {i18n.t("number_of_posts", { count: pv.counts.post_count })} + {i18n.t("number_of_posts", { + count: pv.counts.post_count, + formattedCount: numToSI(pv.counts.post_count), + })}
      • {i18n.t("number_of_comments", { count: pv.counts.comment_count, + formattedCount: numToSI(pv.counts.comment_count), })}
      diff --git a/src/shared/components/post/post-listing.tsx b/src/shared/components/post/post-listing.tsx index 9c6da376..49825b39 100644 --- a/src/shared/components/post/post-listing.tsx +++ b/src/shared/components/post/post-listing.tsx @@ -32,6 +32,7 @@ import { isVideo, md, mdToHtml, + numToSI, previewLines, setupTippy, showScores, @@ -356,7 +357,7 @@ export class PostListing extends Component { class={`unselectable pointer font-weight-bold text-muted px-1`} data-tippy-content={this.pointsTippy} > - {this.state.score} + {numToSI(this.state.score)}
      ) : (
      @@ -475,12 +476,14 @@ export class PostListing extends Component { className="text-muted small" title={i18n.t("number_of_comments", { count: post_view.counts.comments, + formattedCount: post_view.counts.comments, })} to={`/post/${post_view.post.id}?scrollToComments=true`} > {i18n.t("number_of_comments", { count: post_view.counts.comments, + formattedCount: numToSI(post_view.counts.comments), })} @@ -494,7 +497,7 @@ export class PostListing extends Component { > - {this.state.downvotes} + {numToSI(this.state.downvotes)} )} @@ -532,7 +535,7 @@ export class PostListing extends Component { aria-label={i18n.t("upvote")} > - {this.state.upvotes} + {numToSI(this.state.upvotes)} ) : ( ) : ( @@ -1571,14 +1574,17 @@ export class PostListing extends Component { get pointsTippy(): string { let points = i18n.t("number_of_points", { count: this.state.score, + formattedCount: this.state.score, }); let upvotes = i18n.t("number_of_upvotes", { count: this.state.upvotes, + formattedCount: this.state.upvotes, }); let downvotes = i18n.t("number_of_downvotes", { count: this.state.downvotes, + formattedCount: this.state.downvotes, }); return `${points} • ${upvotes} • ${downvotes}`; diff --git a/src/shared/components/search.tsx b/src/shared/components/search.tsx index 4a1c8521..b70b12b0 100644 --- a/src/shared/components/search.tsx +++ b/src/shared/components/search.tsx @@ -38,6 +38,7 @@ import { fetchLimit, fetchUsers, isBrowser, + numToSI, personSelectName, personToChoice, restoreScrollPosition, @@ -649,6 +650,7 @@ export class Search extends Component { {` - ${i18n.t("number_of_subscribers", { count: community_view.counts.subscribers, + formattedCount: numToSI(community_view.counts.subscribers), })} `} @@ -662,6 +664,7 @@ export class Search extends Component { , {` - ${i18n.t("number_of_comments", { count: person_view.counts.comment_count, + formattedCount: numToSI(person_view.counts.comment_count), })}`}, ]; } diff --git a/src/shared/utils.ts b/src/shared/utils.ts index ab2e8985..e0e37979 100644 --- a/src/shared/utils.ts +++ b/src/shared/utils.ts @@ -1439,6 +1439,6 @@ const SHORTNUM_SI_FORMAT = new Intl.NumberFormat("en-US", { compactDisplay: "short", }); -export function numToSI(value: any) { +export function numToSI(value: number): string { return SHORTNUM_SI_FORMAT.format(value); } From 33bb8250cb92bcaa35d4fe1001205e3695ed3e30 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sat, 18 Sep 2021 13:06:12 -0400 Subject: [PATCH 06/17] Remove active in the last (#419) * Updating translations. * Removing active_in_the_last for i18n. - Fixes https://github.com/LemmyNet/lemmy-translations/issues/17 --- lemmy-translations | 2 +- src/shared/components/community/sidebar.tsx | 19 ++++++++----------- src/shared/components/home/home.tsx | 21 +++++++++------------ 3 files changed, 18 insertions(+), 24 deletions(-) diff --git a/lemmy-translations b/lemmy-translations index 183033e0..a700edf2 160000 --- a/lemmy-translations +++ b/lemmy-translations @@ -1 +1 @@ -Subproject commit 183033e0f796b450911e4e8f708ddd5969b12b77 +Subproject commit a700edf2dc9c290050b036b6d33e0ea351c92274 diff --git a/src/shared/components/community/sidebar.tsx b/src/shared/components/community/sidebar.tsx index d4a5bc51..0e7358f2 100644 --- a/src/shared/components/community/sidebar.tsx +++ b/src/shared/components/community/sidebar.tsx @@ -156,10 +156,10 @@ export class Sidebar extends Component {
    • {i18n.t("number_of_users", { count: counts.users_active_day, @@ -169,10 +169,10 @@ export class Sidebar extends Component {
    • {i18n.t("number_of_users", { count: counts.users_active_week, @@ -182,10 +182,10 @@ export class Sidebar extends Component {
    • {i18n.t("number_of_users", { count: counts.users_active_month, @@ -195,13 +195,10 @@ export class Sidebar extends Component {
    • {i18n.t("number_of_users", { count: counts.users_active_half_year, diff --git a/src/shared/components/home/home.tsx b/src/shared/components/home/home.tsx index a22a9593..ec581c00 100644 --- a/src/shared/components/home/home.tsx +++ b/src/shared/components/home/home.tsx @@ -511,10 +511,10 @@ export class Home extends Component {
    • {i18n.t("number_of_users", { count: counts.users_active_day, @@ -524,10 +524,10 @@ export class Home extends Component {
    • {i18n.t("number_of_users", { count: counts.users_active_week, @@ -537,10 +537,10 @@ export class Home extends Component {
    • {i18n.t("number_of_users", { count: counts.users_active_month, @@ -550,13 +550,10 @@ export class Home extends Component {
    • {i18n.t("number_of_users", { count: counts.users_active_half_year, From 28b848ce2c229753a1612ab5de3364a97c9c07c8 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sat, 18 Sep 2021 15:44:39 -0400 Subject: [PATCH 07/17] Adding markdown audio and video embeds. Fixes #420 (#421) --- package.json | 1 + src/shared/utils.ts | 11 +++++++++++ yarn.lock | 43 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+) diff --git a/package.json b/package.json index 3a13537b..d096f13d 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "jwt-decode": "^3.1.2", "markdown-it": "^12.1.0", "markdown-it-container": "^3.0.0", + "markdown-it-html5-embed": "^1.0.0", "markdown-it-sub": "^1.0.0", "markdown-it-sup": "^1.0.0", "moment": "^2.29.1", diff --git a/src/shared/utils.ts b/src/shared/utils.ts index e0e37979..f489d290 100644 --- a/src/shared/utils.ts +++ b/src/shared/utils.ts @@ -25,6 +25,7 @@ import { } from "lemmy-js-client"; import markdown_it from "markdown-it"; import markdown_it_container from "markdown-it-container"; +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"; import moment from "moment"; @@ -208,6 +209,16 @@ export const md = new markdown_it({ }) .use(markdown_it_sub) .use(markdown_it_sup) + .use(markdown_it_html5_embed, { + html5embed: { + useImageSyntax: true, // Enables video/audio embed with ![]() syntax (default) + attributes: { + audio: 'controls preload="metadata"', + video: + 'width="100%" max-height="100%" controls loop preload="metadata"', + }, + }, + }) .use(markdown_it_container, "spoiler", { validate: function (params: any) { return params.trim().match(/^spoiler\s+(.*)$/); diff --git a/yarn.lock b/yarn.lock index ab163145..ea31f9f3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2800,6 +2800,11 @@ enquirer@^2.3.5, enquirer@^2.3.6: dependencies: ansi-colors "^4.1.1" +entities@~1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56" + integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w== + entities@~2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5" @@ -4716,6 +4721,13 @@ lines-and-columns@^1.1.6: resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= +linkify-it@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-2.2.0.tgz#e3b54697e78bf915c70a38acd78fd09e0058b1cf" + integrity sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw== + dependencies: + uc.micro "^1.0.1" + linkify-it@^3.0.1: version "3.0.2" resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-3.0.2.tgz#f55eeb8bc1d3ae754049e124ab3bb56d97797fb8" @@ -5026,6 +5038,14 @@ 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-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" + integrity sha512-SPgugO/1+/9sZcgxoxijoTHSUpCUgFCNe1MSuTmDxDkV6NQrVzMclhRMFgE/rcHO+2rhIg3U7Oy80XA/E8ytpg== + dependencies: + markdown-it "^8.4.0" + mimoza "~1.0.0" + markdown-it-sub@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/markdown-it-sub/-/markdown-it-sub-1.0.0.tgz#375fd6026eae7ddcb012497f6411195ea1e3afe8" @@ -5047,6 +5067,17 @@ markdown-it@^12.1.0: mdurl "^1.0.1" uc.micro "^1.0.5" +markdown-it@^8.4.0: + version "8.4.2" + resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-8.4.2.tgz#386f98998dc15a37722aa7722084f4020bdd9b54" + integrity sha512-GcRz3AWTqSUphY3vsUqQSFMbgR38a4Lh3GWlHRh/7MRwz8mcu9n2IO7HOh+bXHrR9kOPDl5RNCaEsrneb+xhHQ== + dependencies: + argparse "^1.0.7" + entities "~1.1.1" + linkify-it "^2.0.0" + mdurl "^1.0.1" + uc.micro "^1.0.5" + mdurl@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" @@ -5135,6 +5166,11 @@ mime-db@1.49.0, "mime-db@>= 1.43.0 < 2": resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.49.0.tgz#f3dfde60c99e9cf3bc9701d687778f537001cbed" integrity sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA== +mime-db@^1.6.0: + version "1.50.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.50.0.tgz#abd4ac94e98d3c0e185016c67ab45d5fde40c11f" + integrity sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A== + mime-types@^2.1.12, mime-types@^2.1.27, mime-types@^2.1.31, mime-types@~2.1.17, mime-types@~2.1.19, mime-types@~2.1.24: version "2.1.32" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.32.tgz#1d00e89e7de7fe02008db61001d9e02852670fd5" @@ -5162,6 +5198,13 @@ mimic-fn@^3.1.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-3.1.0.tgz#65755145bbf3e36954b949c16450427451d5ca74" integrity sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ== +mimoza@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/mimoza/-/mimoza-1.0.0.tgz#d74aa4fe08932f005e430bdc7bfcfa95fcab4e62" + integrity sha1-10qk/giTLwBeQwvce/z6lfyrTmI= + dependencies: + mime-db "^1.6.0" + min-indent@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" From ba07aa31265caf28bf3468a45d1f7c3c8b69973e Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sat, 18 Sep 2021 15:53:34 -0400 Subject: [PATCH 08/17] Upgrading deps (#422) --- package.json | 16 +++--- yarn.lock | 143 ++++++++++++++++++++++++++++++++------------------- 2 files changed, 99 insertions(+), 60 deletions(-) diff --git a/package.json b/package.json index d096f13d..c08b1cdb 100644 --- a/package.json +++ b/package.json @@ -16,19 +16,19 @@ }, "repository": "https://github.com/LemmyNet/lemmy-ui", "dependencies": { - "@typescript-eslint/parser": "^4.28.3", + "@typescript-eslint/parser": "^4.31.1", "autosize": "^5.0.1", "choices.js": "^9.0.1", "emoji-short-name": "^1.0.0", "express": "~4.17.1", - "i18next": "^20.3.3", - "inferno": "^7.4.9", - "inferno-create-element": "^7.4.9", + "i18next": "^20.6.1", + "inferno": "^7.4.10", + "inferno-create-element": "^7.4.10", "inferno-helmet": "^5.2.1", - "inferno-hydrate": "^7.4.9", + "inferno-hydrate": "^7.4.10", "inferno-i18next-dess": "^0.0.1", - "inferno-router": "^7.4.9", - "inferno-server": "^7.4.9", + "inferno-router": "^7.4.10", + "inferno-server": "^7.4.10", "isomorphic-cookie": "^1.2.4", "jwt-decode": "^3.1.2", "markdown-it": "^12.1.0", @@ -44,7 +44,7 @@ "tippy.js": "^6.3.1", "toastify-js": "^1.11.1", "tributejs": "^5.1.3", - "ws": "^8.2.0" + "ws": "^8.2.2" }, "devDependencies": { "@babel/core": "^7.14.6", diff --git a/yarn.lock b/yarn.lock index ea31f9f3..2250867e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1164,14 +1164,14 @@ eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/parser@^4.28.3": - version "4.29.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.29.2.tgz#1c7744f4c27aeb74610c955d3dce9250e95c370a" - integrity sha512-WQ6BPf+lNuwteUuyk1jD/aHKqMQ9jrdCn7Gxt9vvBnzbpj7aWEf+aZsJ1zvTjx5zFxGCt000lsbD9tQPEL8u6g== +"@typescript-eslint/parser@^4.31.1": + version "4.31.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.31.1.tgz#8f9a2672033e6f6d33b1c0260eebdc0ddf539064" + integrity sha512-dnVZDB6FhpIby6yVbHkwTKkn2ypjVIfAR9nh+kYsA/ZL0JlTsd22BiDjouotisY3Irmd3OW1qlk9EI5R8GrvRQ== dependencies: - "@typescript-eslint/scope-manager" "4.29.2" - "@typescript-eslint/types" "4.29.2" - "@typescript-eslint/typescript-estree" "4.29.2" + "@typescript-eslint/scope-manager" "4.31.1" + "@typescript-eslint/types" "4.31.1" + "@typescript-eslint/typescript-estree" "4.31.1" debug "^4.3.1" "@typescript-eslint/scope-manager@4.29.2": @@ -1182,11 +1182,24 @@ "@typescript-eslint/types" "4.29.2" "@typescript-eslint/visitor-keys" "4.29.2" +"@typescript-eslint/scope-manager@4.31.1": + version "4.31.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.31.1.tgz#0c21e8501f608d6a25c842fcf59541ef4f1ab561" + integrity sha512-N1Uhn6SqNtU2XpFSkD4oA+F0PfKdWHyr4bTX0xTj8NRx1314gBDRL1LUuZd5+L3oP+wo6hCbZpaa1in6SwMcVQ== + dependencies: + "@typescript-eslint/types" "4.31.1" + "@typescript-eslint/visitor-keys" "4.31.1" + "@typescript-eslint/types@4.29.2": version "4.29.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.29.2.tgz#fc0489c6b89773f99109fb0aa0aaddff21f52fcd" integrity sha512-K6ApnEXId+WTGxqnda8z4LhNMa/pZmbTFkDxEBLQAbhLZL50DjeY0VIDCml/0Y3FlcbqXZrABqrcKxq+n0LwzQ== +"@typescript-eslint/types@4.31.1": + version "4.31.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.31.1.tgz#5f255b695627a13401d2fdba5f7138bc79450d66" + integrity sha512-kixltt51ZJGKENNW88IY5MYqTBA8FR0Md8QdGbJD2pKZ+D5IvxjTYDNtJPDxFBiXmka2aJsITdB1BtO1fsgmsQ== + "@typescript-eslint/typescript-estree@4.29.2": version "4.29.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.29.2.tgz#a0ea8b98b274adbb2577100ba545ddf8bf7dc219" @@ -1200,6 +1213,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@4.31.1": + version "4.31.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.31.1.tgz#4a04d5232cf1031232b7124a9c0310b577a62d17" + integrity sha512-EGHkbsUvjFrvRnusk6yFGqrqMBTue5E5ROnS5puj3laGQPasVUgwhrxfcgkdHNFECHAewpvELE1Gjv0XO3mdWg== + dependencies: + "@typescript-eslint/types" "4.31.1" + "@typescript-eslint/visitor-keys" "4.31.1" + debug "^4.3.1" + globby "^11.0.3" + is-glob "^4.0.1" + semver "^7.3.5" + tsutils "^3.21.0" + "@typescript-eslint/visitor-keys@4.29.2": version "4.29.2" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.29.2.tgz#d2da7341f3519486f50655159f4e5ecdcb2cd1df" @@ -1208,6 +1234,14 @@ "@typescript-eslint/types" "4.29.2" eslint-visitor-keys "^2.0.0" +"@typescript-eslint/visitor-keys@4.31.1": + version "4.31.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.31.1.tgz#f2e7a14c7f20c4ae07d7fc3c5878c4441a1da9cc" + integrity sha512-PCncP8hEqKw6SOJY+3St4LVtoZpPPn+Zlpm7KW5xnviMhdqcsBty4Lsg4J/VECpJjw1CkROaZhH4B8M1OfnXTQ== + dependencies: + "@typescript-eslint/types" "4.31.1" + eslint-visitor-keys "^2.0.0" + "@webassemblyjs/ast@1.11.1": version "1.11.1" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.1.tgz#2bfd767eae1a6996f432ff7e8d7fc75679c0b6a7" @@ -3867,10 +3901,10 @@ husky@^7.0.1: resolved "https://registry.yarnpkg.com/husky/-/husky-7.0.1.tgz#579f4180b5da4520263e8713cc832942b48e1f1c" integrity sha512-gceRaITVZ+cJH9sNHqx5tFwbzlLCVxtVZcusME8JYQ8Edy5mpGDOqD8QBCdMhpyo9a+JXddnujQ4rpY2Ff9SJA== -i18next@^20.3.3: - version "20.4.0" - resolved "https://registry.yarnpkg.com/i18next/-/i18next-20.4.0.tgz#6897229a7898e23f3c4885f10315c978b594d3b9" - integrity sha512-89iWWJudmaHJwzIdJ/1eu98GtsJnwBhOUWwlAre70itPMuTE/NTPtgVeaS1CGaB8Q3XrYBGpEqlq4jsScDx9kg== +i18next@^20.6.1: + version "20.6.1" + resolved "https://registry.yarnpkg.com/i18next/-/i18next-20.6.1.tgz#535e5f6e5baeb685c7d25df70db63bf3cc0aa345" + integrity sha512-yCMYTMEJ9ihCwEQQ3phLo7I/Pwycf8uAx+sRHwwk5U9Aui/IZYgQRyMqXafQOw5QQ7DM1Z+WyEXWIqSuJHhG2A== dependencies: "@babel/runtime" "^7.12.0" @@ -4020,6 +4054,13 @@ inferno-clone-vnode@^7.4.2: dependencies: inferno "7.4.8" +inferno-create-element@^7.4.10: + version "7.4.10" + resolved "https://registry.yarnpkg.com/inferno-create-element/-/inferno-create-element-7.4.10.tgz#a4d143c98aa141345fd9969b55b56f57336e0329" + integrity sha512-Gvq0FHL7qHofYjItVkpsOJtr8f2Ok1kxftBedbQb1fCUpHIEwiUvJSh+HX83ZunVwE9tisoPc/ddQPYFJ+x72Q== + dependencies: + inferno "7.4.10" + inferno-create-element@^7.4.2: version "7.4.8" resolved "https://registry.yarnpkg.com/inferno-create-element/-/inferno-create-element-7.4.8.tgz#77bbf24288645c359cf65b4821a3938c6537eb5e" @@ -4027,13 +4068,6 @@ inferno-create-element@^7.4.2: dependencies: inferno "7.4.8" -inferno-create-element@^7.4.9: - version "7.4.9" - resolved "https://registry.yarnpkg.com/inferno-create-element/-/inferno-create-element-7.4.9.tgz#0538b100442163e1c361f2a78664ee3dd5e6f2bb" - integrity sha512-wQ/gnd66pdrlm8uPAjGDlSCF6sX9mQ/mGtq8yYKHBTAmWPdE9P3mVsw5Wg9Iyy5NxRVsJqB9emBXIA8PNNkMCg== - dependencies: - inferno "7.4.9" - inferno-helmet@^5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/inferno-helmet/-/inferno-helmet-5.2.1.tgz#3717f325760aa14abeae82a78af7213f9055a3dc" @@ -4043,12 +4077,12 @@ inferno-helmet@^5.2.1: inferno-side-effect "^1.1.5" object-assign "^4.1.1" -inferno-hydrate@^7.4.9: - version "7.4.9" - resolved "https://registry.yarnpkg.com/inferno-hydrate/-/inferno-hydrate-7.4.9.tgz#ba355f2e17cc273d7adfd957bb19fce4447d8b29" - integrity sha512-QP8zmgTddI4WShmQO9VF+wqC3OXmwaGaZkQQNZsp7ZfprhhYuW6ulSPyckWEB/zGZxxYPdG8ZthEeQZF4NS5Jw== +inferno-hydrate@^7.4.10: + version "7.4.10" + resolved "https://registry.yarnpkg.com/inferno-hydrate/-/inferno-hydrate-7.4.10.tgz#678c2423fa47233d905b79d0597b39e1075da12e" + integrity sha512-bHJo7wd0ZKAmRlzoHqBjGhEgmOYFBh9LL58bIOeOXiuuyXJFUA6tP/vW91sx7j68K9Zq36SMwtbb/QnQ7R4mug== dependencies: - inferno "7.4.9" + inferno "7.4.10" inferno-i18next-dess@^0.0.1: version "0.0.1" @@ -4062,33 +4096,33 @@ inferno-i18next-dess@^0.0.1: inferno-shared "^7.4.2" inferno-vnode-flags "^7.4.2" -inferno-router@^7.4.9: - version "7.4.9" - resolved "https://registry.yarnpkg.com/inferno-router/-/inferno-router-7.4.9.tgz#6f3d708f8e01d47f982b41ae18c9312a4c51220b" - integrity sha512-MunV594oIw0lGjcf6HMyPIx/F5bsz2+nz+ao4Jd6cLWy1zUCD8eowqCfZe3Re82wbW8+w7zNp5bCpuV+4IiWNQ== +inferno-router@^7.4.10: + version "7.4.10" + resolved "https://registry.yarnpkg.com/inferno-router/-/inferno-router-7.4.10.tgz#6fb27831b8864204bfab5ed192a2c7280e6420ed" + integrity sha512-XIeqmmPVwkRE445uMLqjimsh/zxtCsjA25Vt18y52zZaBH1R3Me6FoEoPsnZhH3j9zyOfzpHpxEPpUGWKfyZoA== dependencies: history "^4.10.1" hoist-non-inferno-statics "^1.1.3" - inferno "7.4.9" + inferno "7.4.10" path-to-regexp-es6 "1.7.0" -inferno-server@^7.4.9: - version "7.4.9" - resolved "https://registry.yarnpkg.com/inferno-server/-/inferno-server-7.4.9.tgz#05e73aa14512f492d9eec30698c55f30c39493bb" - integrity sha512-x9kE+Tk34QfRM1OL4+KSWY86t7dLVanRhDWikBs3jsHuFU+bQ9VGuEp4cf4wEBnv0DbPQiH+/XY5aoaQ6S8zFQ== +inferno-server@^7.4.10: + version "7.4.10" + resolved "https://registry.yarnpkg.com/inferno-server/-/inferno-server-7.4.10.tgz#959af7c0946541f29c2258b67a80b7dd11db9df5" + integrity sha512-L9BDXUc6nwmZxo2SPeZl3MtvxiBi5fMmutHe7f6uOVlZoFyylg45CY0KS4+1ySxALxW2fb9ZKJJw/8pBXjmgQA== dependencies: - inferno "7.4.9" + inferno "7.4.10" + +inferno-shared@7.4.10: + version "7.4.10" + resolved "https://registry.yarnpkg.com/inferno-shared/-/inferno-shared-7.4.10.tgz#d4ca2c7fd6b580f86a623e923d080aa1d7259014" + integrity sha512-d7wlcW8NhchfX4vSg+6k9/FwFHAooo81GfWZtnDXtUvZNS4WEMaPH2j1YV6VnN4X3R0850dHRxR7830PdKh4Iw== inferno-shared@7.4.8, inferno-shared@^7.4.2: version "7.4.8" resolved "https://registry.yarnpkg.com/inferno-shared/-/inferno-shared-7.4.8.tgz#2b554a36683b770339008749096d9704846dd337" integrity sha512-I0jnqsBcQvGJ7hqZF3vEzspQ80evViCe8joP3snWkPXPElk9WBVGLBHX5tHwuFuXv6wW4zeVVA4kBRAs47B+NQ== -inferno-shared@7.4.9: - version "7.4.9" - resolved "https://registry.yarnpkg.com/inferno-shared/-/inferno-shared-7.4.9.tgz#f3cc5e85adadd7471a5e1c72da7df93a0bb98340" - integrity sha512-WNBz7OJ1DiVN+NeHgflwBHqvD589B9xMPkFGTj6mNs1cQCxYIZtslp5cqpkEo5TnA8O3FgEF00LMaLfc/i8fyw== - inferno-side-effect@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/inferno-side-effect/-/inferno-side-effect-1.1.5.tgz#a874c80dbc73602aafc1e0f3f3f1ec216a916271" @@ -4098,15 +4132,24 @@ inferno-side-effect@^1.1.5: npm "^5.8.0" shallowequal "^1.0.1" +inferno-vnode-flags@7.4.10: + version "7.4.10" + resolved "https://registry.yarnpkg.com/inferno-vnode-flags/-/inferno-vnode-flags-7.4.10.tgz#a255931fc1df1e6896b29226d837f28e1c5ac968" + integrity sha512-OzfnqXrJx8Rl3FtyjhdFk7gzuCLMPCbDTiO8Bz0lw6P3ngW9Md5N5LPeg7Jz510PM0NisScQtxxHPwsFQxDIfw== + inferno-vnode-flags@7.4.8, inferno-vnode-flags@^7.4.2: version "7.4.8" resolved "https://registry.yarnpkg.com/inferno-vnode-flags/-/inferno-vnode-flags-7.4.8.tgz#275d70e3c8b2b3f4eb56041cc9b8c832ce1fb26d" integrity sha512-wOUeO7Aho8VH+s2V2K/53KwS0DtQFgT7TdzPE/s6P26ZIxQj+vt7oTJqzXn+xjRIjnfkTLm2eQ8qfInOWCu1rw== -inferno-vnode-flags@7.4.9: - version "7.4.9" - resolved "https://registry.yarnpkg.com/inferno-vnode-flags/-/inferno-vnode-flags-7.4.9.tgz#26fe1a40f00de2ebc05b9e7543c8577c674c074b" - integrity sha512-pIGvc1MRSRrvjAOpARRz9OCyGrODKYfhw02ctWTIt3Jtn8dyqsjV0ZIaXOQEjpCi5ii7yfE5xwI+ZRI/g3pviQ== +inferno@7.4.10, inferno@^7.4.10: + version "7.4.10" + resolved "https://registry.yarnpkg.com/inferno/-/inferno-7.4.10.tgz#edfeca0db7dd1790aaf60e6aaf7edae8fe97dc63" + integrity sha512-L/qPVapN/b4WSrQND6fN0LOvhIeCVpGFQRbDplZvovOJoxRRZyE21k92tL/C76hQVFOp2FIgjZ7fjy9AnKPS+A== + dependencies: + inferno-shared "7.4.10" + inferno-vnode-flags "7.4.10" + opencollective-postinstall "^2.0.3" inferno@7.4.8, inferno@^7.4.2: version "7.4.8" @@ -4117,15 +4160,6 @@ inferno@7.4.8, inferno@^7.4.2: inferno-vnode-flags "7.4.8" opencollective-postinstall "^2.0.3" -inferno@7.4.9, inferno@^7.4.9: - version "7.4.9" - resolved "https://registry.yarnpkg.com/inferno/-/inferno-7.4.9.tgz#3722319b53b7e902ab194ad26fa6e80332d85c47" - integrity sha512-YxUYo3CyFGRkeSne87DacSAV1yXOp6dAu0toaEkwxb4dIIMilxDmJ8ap0EKxr3ZnQpX7EKmGrLBXrkYQVcmfvg== - dependencies: - inferno-shared "7.4.9" - inferno-vnode-flags "7.4.9" - opencollective-postinstall "^2.0.3" - inflight@^1.0.4, inflight@~1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -8394,11 +8428,16 @@ write-file-atomic@^2.0.0, write-file-atomic@^2.3.0: imurmurhash "^0.1.4" signal-exit "^3.0.2" -ws@^8.1.0, ws@^8.2.0: +ws@^8.1.0: version "8.2.0" resolved "https://registry.yarnpkg.com/ws/-/ws-8.2.0.tgz#0b738cd484bfc9303421914b11bb4011e07615bb" integrity sha512-uYhVJ/m9oXwEI04iIVmgLmugh2qrZihkywG9y5FfZV2ATeLIzHf93qs+tUNqlttbQK957/VX3mtwAS+UfIwA4g== +ws@^8.2.2: + version "8.2.2" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.2.2.tgz#ca684330c6dd6076a737250ed81ac1606cb0a63e" + integrity sha512-Q6B6H2oc8QY3llc3cB8kVmQ6pnJWVQbP7Q5algTcIxx7YEpc0oU4NBVHlztA7Ekzfhw2r0rPducMUiCGWKQRzw== + xdg-basedir@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4" From 8f132f67fa83343ed1b4d0e2b6366fa3e2138100 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sat, 18 Sep 2021 16:40:59 -0400 Subject: [PATCH 09/17] Fix up post, profile and community forms. Fixes #409 (#423) --- src/shared/components/app/navbar.tsx | 4 +- .../components/common/image-upload-form.tsx | 2 +- .../components/community/community-form.tsx | 72 ++++--- src/shared/components/person/settings.tsx | 196 ++++++++++-------- src/shared/components/post/post-form.tsx | 8 +- src/shared/utils.ts | 4 +- 6 files changed, 154 insertions(+), 132 deletions(-) diff --git a/src/shared/components/app/navbar.tsx b/src/shared/components/app/navbar.tsx index 6f204691..96812852 100644 --- a/src/shared/components/app/navbar.tsx +++ b/src/shared/components/app/navbar.tsx @@ -20,6 +20,7 @@ import { i18n } from "../../i18next"; import { UserService, WebSocketService } from "../../services"; import { authField, + donateLemmyUrl, fetchLimit, getLanguage, isBrowser, @@ -28,7 +29,6 @@ import { numToSI, setTheme, showAvatars, - supportLemmyUrl, toast, wsClient, wsJsonToRes, @@ -241,7 +241,7 @@ export class Navbar extends Component { diff --git a/src/shared/components/common/image-upload-form.tsx b/src/shared/components/common/image-upload-form.tsx index a090bc89..5e5f1e09 100644 --- a/src/shared/components/common/image-upload-form.tsx +++ b/src/shared/components/common/image-upload-form.tsx @@ -36,7 +36,7 @@ export class ImageUploadForm extends Component<