]> Untitled Git - lemmy-ui.git/commitdiff
fix: Remove Bootstrap JS in sidebars (#1434)
authorJay Sitter <jsit@users.noreply.github.com>
Wed, 21 Jun 2023 12:05:32 +0000 (08:05 -0400)
committerGitHub <noreply@github.com>
Wed, 21 Jun 2023 12:05:32 +0000 (08:05 -0400)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
src/shared/components/home/home.tsx
src/shared/components/home/site-sidebar.tsx

index 765dbf0307504854525118c44ac1b66ffbddd5de..4270bd0bee42d40546dbbc4285d8f6da24573eca 100644 (file)
@@ -570,8 +570,6 @@ export class Home extends Component<any, HomeState> {
               data-tippy-content={
                 subscribedCollapsed ? i18n.t("expand") : i18n.t("collapse")
               }
-              data-bs-toggle="collapse"
-              data-bs-target="#sidebarSubscribedBody"
               aria-expanded="true"
               aria-controls="sidebarSubscribedBody"
             >
@@ -582,24 +580,25 @@ export class Home extends Component<any, HomeState> {
             </button>
           )}
         </header>
-        <div
-          id="sidebarSubscribedBody"
-          className="collapse show"
-          aria-labelledby="sidebarSubscribedHeader"
-        >
-          <div className="card-body">
-            <ul className="list-inline mb-0">
-              {UserService.Instance.myUserInfo?.follows.map(cfv => (
-                <li
-                  key={cfv.community.id}
-                  className="list-inline-item d-inline-block"
-                >
-                  <CommunityLink community={cfv.community} />
-                </li>
-              ))}
-            </ul>
+        {!subscribedCollapsed && (
+          <div
+            id="sidebarSubscribedBody"
+            aria-labelledby="sidebarSubscribedHeader"
+          >
+            <div className="card-body">
+              <ul className="list-inline mb-0">
+                {UserService.Instance.myUserInfo?.follows.map(cfv => (
+                  <li
+                    key={cfv.community.id}
+                    className="list-inline-item d-inline-block"
+                  >
+                    <CommunityLink community={cfv.community} />
+                  </li>
+                ))}
+              </ul>
+            </div>
           </div>
-        </div>
+        )}
       </>
     );
   }
index 4caeed6b11121834e71672036f6747bb444b16a3..8f8b177e7f62922d8040a4675530fc0c8258720a 100644 (file)
@@ -42,13 +42,11 @@ export class SiteSidebar extends Component<SiteSidebarProps, SiteSidebarState> {
             )}
           </header>
 
-          <div
-            id="sidebarInfoBody"
-            className="collapse show"
-            aria-labelledby="sidebarInfoHeader"
-          >
-            <div className="card-body">{this.siteInfo()}</div>
-          </div>
+          {!this.state.collapsed && (
+            <div id="sidebarInfoBody" aria-labelledby="sidebarInfoHeader">
+              <div className="card-body">{this.siteInfo()}</div>
+            </div>
+          )}
         </section>
       </div>
     );