From ff4d37d03aa683801711199f774cfd633f858f5d Mon Sep 17 00:00:00 2001 From: Jay Sitter Date: Sat, 17 Jun 2023 13:51:21 -0400 Subject: [PATCH 01/11] fix(a11y): Fix some a11y issues in Site Sidebar and use native Bootstrap Collapse and Card classes --- .../components/common/banner-icon-header.tsx | 4 +- src/shared/components/home/site-sidebar.tsx | 49 ++++++++++++------- 2 files changed, 34 insertions(+), 19 deletions(-) diff --git a/src/shared/components/common/banner-icon-header.tsx b/src/shared/components/common/banner-icon-header.tsx index 1df23bef..d2fae2e1 100644 --- a/src/shared/components/common/banner-icon-header.tsx +++ b/src/shared/components/common/banner-icon-header.tsx @@ -14,7 +14,7 @@ export class BannerIconHeader extends Component { render() { const banner = this.props.banner; const icon = this.props.icon; - return ( + return banner || icon ? (
{banner && } {icon && ( @@ -26,6 +26,6 @@ export class BannerIconHeader extends Component { /> )}
- ); + ) : null; } } diff --git a/src/shared/components/home/site-sidebar.tsx b/src/shared/components/home/site-sidebar.tsx index 66a48ca1..283ddf83 100644 --- a/src/shared/components/home/site-sidebar.tsx +++ b/src/shared/components/home/site-sidebar.tsx @@ -29,17 +29,23 @@ export class SiteSidebar extends Component { render() { return ( -
-
-
-
{this.siteName()}
- {!this.state.collapsed && ( - <> - - {this.siteInfo()} - - )} -
+
+
+ {this.siteName()} + {!this.state.collapsed && ( + + )} +
+ +
+
{this.siteInfo()}
); @@ -47,13 +53,22 @@ export class SiteSidebar extends Component { siteName() { return ( -
- {this.props.site.name} +
+
{this.props.site.name}
-
+
); } From 878e0f0f85d078b5e7ee09d738ef9f39d253a224 Mon Sep 17 00:00:00 2001 From: Jay Sitter Date: Sat, 17 Jun 2023 14:24:13 -0400 Subject: [PATCH 02/11] fix: Add .accordion wrapper around sidebar to obtain negative bottom margin --- src/shared/components/home/site-sidebar.tsx | 38 +++++++++++---------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/shared/components/home/site-sidebar.tsx b/src/shared/components/home/site-sidebar.tsx index 283ddf83..b09f27d2 100644 --- a/src/shared/components/home/site-sidebar.tsx +++ b/src/shared/components/home/site-sidebar.tsx @@ -29,25 +29,27 @@ export class SiteSidebar extends Component { render() { return ( -
-
- {this.siteName()} - {!this.state.collapsed && ( - - )} -
- -
+
-
{this.siteInfo()}
-
-
+
+ {this.siteName()} + {!this.state.collapsed && ( + + )} +
+ +
+
{this.siteInfo()}
+
+
+ ); } From 072d253baa978b66708abe6bc31a8267b37e4595 Mon Sep 17 00:00:00 2001 From: Jay Sitter Date: Sat, 17 Jun 2023 15:09:10 -0400 Subject: [PATCH 03/11] fix(a11y): Apply same accordion/collapse markup to Subscribed Communities sidebar card --- src/shared/components/home/home.tsx | 80 +++++++++++++-------- src/shared/components/home/site-sidebar.tsx | 9 ++- 2 files changed, 57 insertions(+), 32 deletions(-) diff --git a/src/shared/components/home/home.tsx b/src/shared/components/home/home.tsx index 4d79bc63..851c5c25 100644 --- a/src/shared/components/home/home.tsx +++ b/src/shared/components/home/home.tsx @@ -492,12 +492,14 @@ export class Home extends Component { showLocal={showLocal(this.isoData)} /> {this.hasFollows && ( -
-
{this.subscribedCommunities}
-
+
+
+ {this.subscribedCommunities} +
+
)} ); @@ -543,39 +545,59 @@ export class Home extends Component { const { subscribedCollapsed } = this.state; return ( -
-
- - # - + <> +
+
+ # - - + + # + + +
-
- {!subscribedCollapsed && ( -
    - {UserService.Instance.myUserInfo?.follows.map(cfv => ( -
  • - -
  • - ))} -
- )} -
+ +
+
+
    + {UserService.Instance.myUserInfo?.follows.map(cfv => ( +
  • + +
  • + ))} +
+
+
+ ); } diff --git a/src/shared/components/home/site-sidebar.tsx b/src/shared/components/home/site-sidebar.tsx index b09f27d2..3df4eb69 100644 --- a/src/shared/components/home/site-sidebar.tsx +++ b/src/shared/components/home/site-sidebar.tsx @@ -34,7 +34,10 @@ export class SiteSidebar extends Component { id="sidebarInfo" className="card border-secondary mb-3 overflow-hidden" > -
+
{this.siteName()} {!this.state.collapsed && ( @@ -55,7 +58,7 @@ export class SiteSidebar extends Component { siteName() { return ( -
+ <>
{this.props.site.name}
-
+ ); } From cf5c8a1c07a73581eb11aeaf7829460863ce2b5b Mon Sep 17 00:00:00 2001 From: Jay Sitter Date: Sat, 17 Jun 2023 15:24:55 -0400 Subject: [PATCH 04/11] fix(a11y): Fix some mobile styles for Sidebar Cards --- src/shared/components/home/home.tsx | 53 +++++++++++---------- src/shared/components/home/site-sidebar.tsx | 45 +++++++++-------- 2 files changed, 52 insertions(+), 46 deletions(-) diff --git a/src/shared/components/home/home.tsx b/src/shared/components/home/home.tsx index 851c5c25..23b09414 100644 --- a/src/shared/components/home/home.tsx +++ b/src/shared/components/home/home.tsx @@ -443,16 +443,17 @@ export class Home extends Component { admins={admins} counts={counts} showLocal={showLocal(this.isoData)} + isMobile={true} /> )} {showTrendingMobile && ( -
+
{this.trendingCommunities(true)}
)} {showSubscribedMobile && ( -
-
{this.subscribedCommunities}
+
+ {this.subscribedCommunities(true)}
)}
@@ -497,7 +498,7 @@ export class Home extends Component { id="sidebarSubscribed" className="card border-secondary mb-3" > - {this.subscribedCommunities} + {this.subscribedCommunities(false)}
)} @@ -541,7 +542,7 @@ export class Home extends Component { } } - get subscribedCommunities() { + subscribedCommunities(isMobile = false) { const { subscribedCollapsed } = this.state; return ( @@ -558,26 +559,28 @@ export class Home extends Component { - + {!isMobile && ( + + )}
{ return ( <>
{this.props.site.name}
- + {!this.props.isMobile && ( + + )} ); } From 0d302c0e40c52a15d39f0531c4d1af56bd9d873e Mon Sep 17 00:00:00 2001 From: Jay Sitter Date: Sat, 17 Jun 2023 15:32:29 -0400 Subject: [PATCH 05/11] fix: Cleaner logic --- .../components/common/banner-icon-header.tsx | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/shared/components/common/banner-icon-header.tsx b/src/shared/components/common/banner-icon-header.tsx index d2fae2e1..7028ef4f 100644 --- a/src/shared/components/common/banner-icon-header.tsx +++ b/src/shared/components/common/banner-icon-header.tsx @@ -14,18 +14,20 @@ export class BannerIconHeader extends Component { render() { const banner = this.props.banner; const icon = this.props.icon; - return banner || icon ? ( -
- {banner && } - {icon && ( - - )} -
- ) : null; + return ( + (banner || icon) && ( +
+ {banner && } + {icon && ( + + )} +
+ ) + ); } } From c8758317f7ed08b05ec80597fd3df06e3618d514 Mon Sep 17 00:00:00 2001 From: Jay Sitter Date: Sat, 17 Jun 2023 15:32:49 -0400 Subject: [PATCH 06/11] fix: Fix Trending sidebar card too --- src/shared/components/home/home.tsx | 68 +++++++++++++++-------------- 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/src/shared/components/home/home.tsx b/src/shared/components/home/home.tsx index 23b09414..0acef492 100644 --- a/src/shared/components/home/home.tsx +++ b/src/shared/components/home/home.tsx @@ -1,3 +1,4 @@ +import classNames from "classnames"; import { NoOptionI18nKeys } from "i18next"; import { Component, linkEvent, MouseEventHandler } from "inferno"; import { T } from "inferno-i18next-dess"; @@ -448,7 +449,7 @@ export class Home extends Component { )} {showTrendingMobile && (
-
{this.trendingCommunities(true)}
+ {this.trendingCommunities(true)}
)} {showSubscribedMobile && ( @@ -472,19 +473,7 @@ export class Home extends Component { return (
-
- {this.trendingCommunities()} - {canCreateCommunity(this.state.siteRes) && ( - - )} - -
+ {this.trendingCommunities()}
{ case "success": { const trending = this.state.trendingCommunitiesRes.data.communities; return ( -
-
- - # - +
+
+
+ # - - -
-
    - {trending.map(cv => ( -
  • - -
  • - ))} -
+ + # + + +
+
+
+
    + {trending.map(cv => ( +
  • + +
  • + ))} +
+ {canCreateCommunity(this.state.siteRes) && ( + + )} + +
); } From 9f0657ab9b1bedd37f74a9201880acda0289784f Mon Sep 17 00:00:00 2001 From: Jay Sitter Date: Sat, 17 Jun 2023 15:46:51 -0400 Subject: [PATCH 07/11] feat(a11y): Add eslint-plugin-jsx-a11y --- .eslintrc.json | 15 ++++++-- package.json | 1 + yarn.lock | 97 ++++++++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 105 insertions(+), 8 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 3a60a6bb..598b7f3f 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -3,11 +3,12 @@ "env": { "browser": true }, - "plugins": ["@typescript-eslint"], + "plugins": ["@typescript-eslint", "jsx-a11y"], "extends": [ "eslint:recommended", "plugin:@typescript-eslint/recommended", - "plugin:inferno/recommended" + "plugin:inferno/recommended", + "plugin:jsx-a11y/recommended" ], "parser": "@typescript-eslint/parser", "parserOptions": { @@ -20,6 +21,16 @@ "@typescript-eslint/explicit-module-boundary-types": 0, "@typescript-eslint/no-empty-function": 0, "arrow-body-style": 0, + "jsx-a11y/alt-text": 1, + "jsx-a11y/anchor-is-valid": 1, + "jsx-a11y/aria-activedescendant-has-tabindex": 1, + "jsx-a11y/aria-role": 1, + "jsx-a11y/click-events-have-key-events": 1, + "jsx-a11y/iframe-has-title": 1, + "jsx-a11y/interactive-supports-focus": 1, + "jsx-a11y/no-redundant-roles": 1, + "jsx-a11y/no-static-element-interactions": 1, + "jsx-a11y/role-has-required-aria-props": 1, "curly": 0, "eol-last": 0, "eqeqeq": 0, diff --git a/package.json b/package.json index 3f6c4ed0..b0d555b5 100644 --- a/package.json +++ b/package.json @@ -106,6 +106,7 @@ "bootstrap-v4": "npm:bootstrap@^4.6.2", "eslint": "^8.40.0", "eslint-plugin-inferno": "^7.32.2", + "eslint-plugin-jsx-a11y": "^6.7.1", "eslint-plugin-prettier": "^4.2.1", "husky": "^8.0.3", "import-sort-style-module": "^6.0.0", diff --git a/yarn.lock b/yarn.lock index 7cd64474..cd5bb4e1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1202,6 +1202,13 @@ dependencies: regenerator-runtime "^0.13.11" +"@babel/runtime@^7.20.7": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.5.tgz#8564dd588182ce0047d55d7a75e93921107b57ec" + integrity sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA== + dependencies: + regenerator-runtime "^0.13.11" + "@babel/template@^7.18.10", "@babel/template@^7.20.7", "@babel/template@^7.21.9": version "7.21.9" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.21.9.tgz#bf8dad2859130ae46088a99c1f265394877446fb" @@ -2159,6 +2166,13 @@ argparse@^2.0.1: resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== +aria-query@^5.1.3: + version "5.2.1" + resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-5.2.1.tgz#bc285d9d654d1df121bcd0c134880d415ca67c15" + integrity sha512-7uFg4b+lETFgdaJyETnILsXgnnzVnkHcgRbwbPwevm5x/LmUlt3MjczMRe1zg824iBgXZNRPTBftNYyRSKLp2g== + dependencies: + dequal "^2.0.3" + array-buffer-byte-length@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz#fabe8bc193fea865f317fe7807085ee0dee5aead" @@ -2177,7 +2191,7 @@ array-flatten@^2.1.2: resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-2.1.2.tgz#24ef80a28c1a893617e2149b0c6d0d788293b099" integrity sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ== -array-includes@^3.1.5: +array-includes@^3.1.5, array-includes@^3.1.6: version "3.1.6" resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.6.tgz#9e9e720e194f198266ba9e18c29e6a9b0e4b225f" integrity sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw== @@ -2205,6 +2219,16 @@ array-uniq@^1.0.1: resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" integrity sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q== +array.prototype.flatmap@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz#1aae7903c2100433cb8261cd4ed310aab5c4a183" + integrity sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + es-shim-unscopables "^1.0.0" + array.prototype.reduce@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/array.prototype.reduce/-/array.prototype.reduce-1.0.5.tgz#6b20b0daa9d9734dd6bc7ea66b5bbce395471eac" @@ -2244,6 +2268,11 @@ assert-plus@1.0.0, assert-plus@^1.0.0: resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" integrity sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw== +ast-types-flow@^0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad" + integrity sha512-eBvWn1lvIApYMhzQMsu9ciLfkBY499mFZlNqG+/9WR7PVlroQw0vG30cOQQbaKz3sCEc44TAOu2ykzqXSNnwag== + astral-regex@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" @@ -2284,6 +2313,18 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.12.0.tgz#ce1c9d143389679e253b314241ea9aa5cec980d3" integrity sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg== +axe-core@^4.6.2: + version "4.7.2" + resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.7.2.tgz#040a7342b20765cb18bb50b628394c21bccc17a0" + integrity sha512-zIURGIS1E1Q4pcrMjp+nnEh+16G56eG/MUllJH8yEvw7asDo7Ac9uhC9KIH5jzpITueEZolfYglnCGIuSBz39g== + +axobject-query@^3.1.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-3.2.1.tgz#39c378a6e3b06ca679f29138151e45b2b32da62a" + integrity sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg== + dependencies: + dequal "^2.0.3" + babel-loader@^9.1.2: version "9.1.2" resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-9.1.2.tgz#a16a080de52d08854ee14570469905a5fc00d39c" @@ -2446,16 +2487,16 @@ bonjour-service@^1.0.11: fast-deep-equal "^3.1.3" multicast-dns "^7.2.5" +"bootstrap-v4@npm:bootstrap@^4.6.2": + version "4.6.2" + resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.6.2.tgz#8e0cd61611728a5bf65a3a2b8d6ff6c77d5d7479" + integrity sha512-51Bbp/Uxr9aTuy6ca/8FbFloBUJZLHwnhTcnjIeRn2suQWsWzcuJhGjKDB5eppVte/8oCdOL3VuwxvZDUggwGQ== + bootstrap@^5.2.3: version "5.3.0" resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-5.3.0.tgz#0718a7cc29040ee8dbf1bd652b896f3436a87c29" integrity sha512-UnBV3E3v4STVNQdms6jSGO2CvOkjUMdDAVR2V5N4uCMdaIkaQjbcEAMqRimDHIs4uqBYzDAKCQwCB+97tJgHQw== -bootswatch@^5.2.3: - version "5.3.0" - resolved "https://registry.yarnpkg.com/bootswatch/-/bootswatch-5.3.0.tgz#7c7dd50bbe8519b0c6dbe01f4f9c3100b60228bd" - integrity sha512-ga2hHognDrh5h3+CaBBug6ktx3MTlnDzH57s+Mvjt9ZcNxqwpK+m3sE3YIUSr8zf2iG05elOb1mnqqcdbce2ow== - boxen@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/boxen/-/boxen-1.3.0.tgz#55c6c39a8ba58d9c61ad22cd877532deb665a20b" @@ -3152,6 +3193,11 @@ cyclist@^1.0.1: resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.2.tgz#673b5f233bf34d8e602b949429f8171d9121bea3" integrity sha512-0sVXIohTfLqVIW3kb/0n6IiWF3Ifj5nm2XaSrLq2DI6fKIGa2fYAZdk917rUneaeLVpYfFcyXE2ft0fe3remsA== +damerau-levenshtein@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz#b43d286ccbd36bc5b2f7ed41caf2d0aba1f8a6e7" + integrity sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA== + dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" @@ -3319,6 +3365,11 @@ depd@~1.1.2: resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" integrity sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ== +dequal@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/dequal/-/dequal-2.0.3.tgz#2644214f1997d39ed0ee0ece72335490a7ac67be" + integrity sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA== + destroy@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" @@ -3696,6 +3747,28 @@ eslint-plugin-inferno@^7.32.2: resolve "^2.0.0-next.4" semver "^7.3.8" +eslint-plugin-jsx-a11y@^6.7.1: + version "6.7.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.7.1.tgz#fca5e02d115f48c9a597a6894d5bcec2f7a76976" + integrity sha512-63Bog4iIethyo8smBklORknVjB0T2dwB8Mr/hIC+fBS0uyHdYYpzM/Ed+YC8VxTjlXHEWFOdmgwcDn1U2L9VCA== + dependencies: + "@babel/runtime" "^7.20.7" + aria-query "^5.1.3" + array-includes "^3.1.6" + array.prototype.flatmap "^1.3.1" + ast-types-flow "^0.0.7" + axe-core "^4.6.2" + axobject-query "^3.1.1" + damerau-levenshtein "^1.0.8" + emoji-regex "^9.2.2" + has "^1.0.3" + jsx-ast-utils "^3.3.3" + language-tags "=1.0.5" + minimatch "^3.1.2" + object.entries "^1.1.6" + object.fromentries "^2.0.6" + semver "^6.3.0" + eslint-plugin-prettier@^4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz#651cbb88b1dab98bfd42f017a12fa6b2d993f94b" @@ -5590,6 +5663,18 @@ klona@^2.0.6: resolved "https://registry.yarnpkg.com/klona/-/klona-2.0.6.tgz#85bffbf819c03b2f53270412420a4555ef882e22" integrity sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA== +language-subtag-registry@~0.3.2: + version "0.3.22" + resolved "https://registry.yarnpkg.com/language-subtag-registry/-/language-subtag-registry-0.3.22.tgz#2e1500861b2e457eba7e7ae86877cbd08fa1fd1d" + integrity sha512-tN0MCzyWnoz/4nHS6uxdlFWoUZT7ABptwKPQ52Ea7URk6vll88bWBVhodtnlfEuCcKWNGoc+uGbw1cwa9IKh/w== + +language-tags@=1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/language-tags/-/language-tags-1.0.5.tgz#d321dbc4da30ba8bf3024e040fa5c14661f9193a" + integrity sha512-qJhlO9cGXi6hBGKoxEG/sKZDAHD5Hnu9Hs4WbOY3pCWXDhw0N8x1NenNzm2EnNLkLkk7J2SdxAkDSbb6ftT+UQ== + dependencies: + language-subtag-registry "~0.3.2" + latest-version@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-3.1.0.tgz#a205383fea322b33b5ae3b18abee0dc2f356ee15" From 3564c6c379ff7be50b26dea9240080656bc30316 Mon Sep 17 00:00:00 2001 From: Jay Sitter Date: Sat, 17 Jun 2023 17:01:14 -0400 Subject: [PATCH 08/11] fix: Fix some small style issues --- src/shared/components/home/home.tsx | 25 +++++++++------------ src/shared/components/home/site-sidebar.tsx | 5 +---- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/src/shared/components/home/home.tsx b/src/shared/components/home/home.tsx index 0acef492..483d8ccb 100644 --- a/src/shared/components/home/home.tsx +++ b/src/shared/components/home/home.tsx @@ -1,4 +1,3 @@ -import classNames from "classnames"; import { NoOptionI18nKeys } from "i18next"; import { Component, linkEvent, MouseEventHandler } from "inferno"; import { T } from "inferno-i18next-dess"; @@ -506,11 +505,7 @@ export class Home extends Component { case "success": { const trending = this.state.trendingCommunitiesRes.data.communities; return ( -
+ <>
@@ -522,13 +517,15 @@ export class Home extends Component {
-
    - {trending.map(cv => ( -
  • - -
  • - ))} -
+ {trending.length > 0 && ( +
    + {trending.map(cv => ( +
  • + +
  • + ))} +
+ )} {canCreateCommunity(this.state.siteRes) && ( { translationKey="explore_communities" />
-
+ ); } } diff --git a/src/shared/components/home/site-sidebar.tsx b/src/shared/components/home/site-sidebar.tsx index f4081737..cc587bfb 100644 --- a/src/shared/components/home/site-sidebar.tsx +++ b/src/shared/components/home/site-sidebar.tsx @@ -31,10 +31,7 @@ export class SiteSidebar extends Component { render() { return (
-
+
Date: Sat, 17 Jun 2023 19:16:24 -0400 Subject: [PATCH 09/11] fix: Remove unused var --- src/shared/components/home/home.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shared/components/home/home.tsx b/src/shared/components/home/home.tsx index 483d8ccb..c7fccb8e 100644 --- a/src/shared/components/home/home.tsx +++ b/src/shared/components/home/home.tsx @@ -448,7 +448,7 @@ export class Home extends Component { )} {showTrendingMobile && (
- {this.trendingCommunities(true)} + {this.trendingCommunities}
)} {showSubscribedMobile && ( @@ -472,7 +472,7 @@ export class Home extends Component { return (
- {this.trendingCommunities()} + {this.trendingCommunities}
{ ); } - trendingCommunities(isMobile = false) { + trendingCommunities() { switch (this.state.trendingCommunitiesRes?.state) { case "loading": return ( From 9084a91242358eb01613d3e24534b7daa3bc0a96 Mon Sep 17 00:00:00 2001 From: Jay Sitter Date: Sat, 17 Jun 2023 19:19:08 -0400 Subject: [PATCH 10/11] chore: Empty commit to re-trigger woodpecker job From f702cbd2564bca9cfa28beadb28ff9934cc0a66b Mon Sep 17 00:00:00 2001 From: Jay Sitter Date: Sat, 17 Jun 2023 19:27:11 -0400 Subject: [PATCH 11/11] fix: Fix build error --- src/shared/components/home/home.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/components/home/home.tsx b/src/shared/components/home/home.tsx index c7fccb8e..4f9b9694 100644 --- a/src/shared/components/home/home.tsx +++ b/src/shared/components/home/home.tsx @@ -448,7 +448,7 @@ export class Home extends Component { )} {showTrendingMobile && (
- {this.trendingCommunities} + {this.trendingCommunities()}
)} {showSubscribedMobile && ( @@ -472,7 +472,7 @@ export class Home extends Component { return (
- {this.trendingCommunities} + {this.trendingCommunities()}