From: Jay Sitter Date: Sat, 17 Jun 2023 00:14:48 +0000 (-0500) Subject: Merge branch 'main' into feat/markdown-format-bar-above X-Git-Url: http://these/git/?a=commitdiff_plain;h=e540b1e4a92971a42ab9867e92a4af7904a7cfd0;hp=f037220d5eba071a7a52be8be7fd05c0d233a61c;p=lemmy-ui.git Merge branch 'main' into feat/markdown-format-bar-above --- diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 6df17d5..76916e6 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @dessalines @SleeplessOne1917 +* @dessalines @SleeplessOne1917 @alectrocute diff --git a/package.json b/package.json index 2298d9e..b7c48c7 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "inferno-server": "^8.1.1", "isomorphic-cookie": "^1.2.4", "jwt-decode": "^3.1.2", - "lemmy-js-client": "0.17.2-rc.24", + "lemmy-js-client": "0.18.0-rc.1", "lodash": "^4.17.21", "markdown-it": "^13.0.1", "markdown-it-container": "^3.0.0", diff --git a/src/shared/components/app/app.tsx b/src/shared/components/app/app.tsx index 96857f3..c495548 100644 --- a/src/shared/components/app/app.tsx +++ b/src/shared/components/app/app.tsx @@ -25,7 +25,7 @@ export class App extends Component { return ( <> -
+
{siteView && ( )} diff --git a/src/shared/components/app/footer.tsx b/src/shared/components/app/footer.tsx index bd66165..aabe4ef 100644 --- a/src/shared/components/app/footer.tsx +++ b/src/shared/components/app/footer.tsx @@ -16,7 +16,7 @@ export class Footer extends Component { render() { return ( - + ); } } diff --git a/src/shared/components/app/navbar.tsx b/src/shared/components/app/navbar.tsx index 6d310ee..c17837c 100644 --- a/src/shared/components/app/navbar.tsx +++ b/src/shared/components/app/navbar.tsx @@ -86,8 +86,12 @@ export class Navbar extends Component { const siteView = this.props.siteRes?.site_view; const person = UserService.Instance.myUserInfo?.local_user_view.person; return ( -
+ {showMoreChildren && (
{ focus allLanguages={this.props.allLanguages} siteLanguages={this.props.siteLanguages} + containerClass="comment-comment-container" onUpsertComment={this.props.onCreateComment} /> )} diff --git a/src/shared/components/common/markdown-textarea.tsx b/src/shared/components/common/markdown-textarea.tsx index 5ecbb47..ef7ba01 100644 --- a/src/shared/components/common/markdown-textarea.tsx +++ b/src/shared/components/common/markdown-textarea.tsx @@ -64,8 +64,9 @@ export class MarkdownTextArea extends Component< MarkdownTextAreaProps, MarkdownTextAreaState > { - private id = `comment-textarea-${randomStr()}`; - private formId = `comment-form-${randomStr()}`; + private id = `markdown-textarea-${randomStr()}`; + private formId = `markdown-form-${randomStr()}`; + private tribute: any; state: MarkdownTextAreaState = { diff --git a/src/shared/components/community/community.tsx b/src/shared/components/community/community.tsx index 05fa55e..f2d7ad7 100644 --- a/src/shared/components/community/community.tsx +++ b/src/shared/components/community/community.tsx @@ -360,7 +360,6 @@ export class Community extends Component< community_view={res.community_view} moderators={res.moderators} admins={site_res.admins} - online={res.online} enableNsfw={enableNsfw(site_res)} editable allLanguages={site_res.all_languages} diff --git a/src/shared/components/community/sidebar.tsx b/src/shared/components/community/sidebar.tsx index 57400f4..f4c7452 100644 --- a/src/shared/components/community/sidebar.tsx +++ b/src/shared/components/community/sidebar.tsx @@ -39,7 +39,6 @@ interface SidebarProps { allLanguages: Language[]; siteLanguages: number[]; communityLanguages?: number[]; - online: number; enableNsfw?: boolean; showIcon?: boolean; editable?: boolean; @@ -132,37 +131,39 @@ export class Sidebar extends Component { const myUSerInfo = UserService.Instance.myUserInfo; const { name, actor_id } = this.props.community_view.community; return ( -
-
-
- {this.communityTitle()} - {this.props.editable && this.adminButtons()} - {myUSerInfo && this.subscribe()} - {this.canPost && this.createPost()} - {myUSerInfo && this.blockCommunity()} - {!myUSerInfo && ( -
- - ### - -
- )} -
-
-
-
- {this.description()} - {this.badges()} - {this.mods()} -
+
+ ); } @@ -237,12 +238,6 @@ export class Sidebar extends Component { const counts = community_view.counts; return (
    -
  • - {i18n.t("number_online", { - count: this.props.online, - formattedCount: numToSI(this.props.online), - })} -
  • { siteRes: { site_view: { counts, site }, admins, - online, }, showSubscribedMobile, showTrendingMobile, @@ -393,7 +392,6 @@ export class Home extends Component { site={site} admins={admins} counts={counts} - online={online} showLocal={showLocal(this.isoData)} /> )} @@ -417,41 +415,40 @@ export class Home extends Component { siteRes: { site_view: { counts, site }, admins, - online, }, } = this.state; return ( -
    -
    -
    -
    - {this.trendingCommunities()} - {canCreateCommunity(this.state.siteRes) && ( - - )} +
    +
    +
    + {this.trendingCommunities()} + {canCreateCommunity(this.state.siteRes) && ( -
    + )} +
    - - {this.hasFollows && ( -
    -
    {this.subscribedCommunities}
    -
    - )} -
    + + + {this.hasFollows && ( +
    +
    {this.subscribedCommunities}
    +
    + )}
    ); } diff --git a/src/shared/components/home/login.tsx b/src/shared/components/home/login.tsx index 381c13b..841a3d2 100644 --- a/src/shared/components/home/login.tsx +++ b/src/shared/components/home/login.tsx @@ -172,7 +172,7 @@ export class Login extends Component { toast(i18n.t("enter_two_factor_code"), "info"); } - i.setState({ loginRes: { state: "empty" } }); + i.setState({ loginRes: { state: "failed", msg: loginRes.msg } }); break; } diff --git a/src/shared/components/home/site-form.tsx b/src/shared/components/home/site-form.tsx index 8b56808..4035c74 100644 --- a/src/shared/components/home/site-form.tsx +++ b/src/shared/components/home/site-form.tsx @@ -81,7 +81,6 @@ export class SiteForm extends Component { slur_filter_regex: ls.slur_filter_regex, actor_name_max_length: ls.actor_name_max_length, federation_enabled: ls.federation_enabled, - federation_debug: ls.federation_debug, federation_worker_count: ls.federation_worker_count, captcha_enabled: ls.captcha_enabled, captcha_difficulty: ls.captcha_difficulty, diff --git a/src/shared/components/home/site-sidebar.tsx b/src/shared/components/home/site-sidebar.tsx index 051c3af..8603c36 100644 --- a/src/shared/components/home/site-sidebar.tsx +++ b/src/shared/components/home/site-sidebar.tsx @@ -12,7 +12,6 @@ interface SiteSidebarProps { showLocal: boolean; counts?: SiteAggregates; admins?: PersonView[]; - online?: number; } interface SiteSidebarState { @@ -30,7 +29,7 @@ export class SiteSidebar extends Component { render() { return ( -
    +
    {this.siteName()}
    @@ -42,7 +41,7 @@ export class SiteSidebar extends Component { )}
    -
    + ); } @@ -99,15 +98,8 @@ export class SiteSidebar extends Component { badges(siteAggregates: SiteAggregates) { const counts = siteAggregates; - const online = this.props.online ?? 1; return (
      -
    • - {i18n.t("number_online", { - count: online, - formattedCount: numToSI(online), - })} -
    • ) : (
      -
      +
      {i18n.t("create_post")}
      { body() { const body = this.postView.post.body; return body ? ( -
      +
      {this.state.viewSource ? (
      {body}
      ) : (
      )} -
      +
      ) : ( <> ); @@ -464,7 +464,7 @@ export class PostListing extends Component { {showScores() ? (
      {numToSI(this.postView.counts.score)} @@ -1398,7 +1398,7 @@ export class PostListing extends Component { <> {/* The mobile view*/}
      -
      +
      {this.createdLine()} @@ -1413,14 +1413,14 @@ export class PostListing extends Component { {this.duplicatesLine()} {this.removeAndBanDialogs()}
      -
      +
      {/* The larger view*/}
      -
      +
      {!this.props.viewOnly && this.voteBar()} -
      +
      {this.thumbnail()}
      @@ -1435,7 +1435,7 @@ export class PostListing extends Component {
      -
      +
      ); diff --git a/src/shared/components/post/post.tsx b/src/shared/components/post/post.tsx index 5136580..25fd1b3 100644 --- a/src/shared/components/post/post.tsx +++ b/src/shared/components/post/post.tsx @@ -384,6 +384,7 @@ export class Post extends Component { disabled={res.post_view.post.locked} allLanguages={this.state.siteRes.all_languages} siteLanguages={this.state.siteRes.discussion_languages} + containerClass="post-comment-container" onUpsertComment={this.handleCreateComment} finished={this.state.finished.get(0)} /> @@ -547,25 +548,22 @@ export class Post extends Component { const res = this.state.postRes; if (res.state === "success") { return ( -
      - -
      + ); } } diff --git a/yarn.lock b/yarn.lock index f783f07..7cd6447 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5615,10 +5615,10 @@ leac@^0.6.0: resolved "https://registry.yarnpkg.com/leac/-/leac-0.6.0.tgz#dcf136e382e666bd2475f44a1096061b70dc0912" integrity sha512-y+SqErxb8h7nE/fiEX07jsbuhrpO9lL8eca7/Y1nuWV2moNlXhyd59iDGcRf6moVyDMbmTNzL40SUyrFU/yDpg== -lemmy-js-client@0.17.2-rc.24: - version "0.17.2-rc.24" - resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.17.2-rc.24.tgz#3b09233a6d89286e559be2e840d81c0c549562ad" - integrity sha512-aSHz7UTcwnwnNd9poY8tEXP7RA9ieZm9MAfSljcbCNU5ds9CASXYNodmraUVJiqCmT4HWnj7IeVmBC9r7nTHnw== +lemmy-js-client@0.18.0-rc.1: + version "0.18.0-rc.1" + resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.18.0-rc.1.tgz#fd0c88810572d90413696011ebaed19e3b8162d8" + integrity sha512-lQe443Nr5UCSoY+IxmT7mBe0IRF6EAZ/4PJSRoPSL+U8A+egMMBPbuxnisHzLsC+eDOWRUIgOqZlwlaRnbmuig== dependencies: cross-fetch "^3.1.5" form-data "^4.0.0"