]> Untitled Git - lemmy-ui.git/commitdiff
fix: Fix some small style issues
authorJay Sitter <jay@jaysitter.com>
Sat, 17 Jun 2023 21:01:14 +0000 (17:01 -0400)
committerJay Sitter <jay@jaysitter.com>
Sat, 17 Jun 2023 21:01:14 +0000 (17:01 -0400)
src/shared/components/home/home.tsx
src/shared/components/home/site-sidebar.tsx

index 0acef49202a0e7c58debfd5e2756d8ca36f6d858..483d8ccb872c7196519e77f46b3dbadd25b8f5aa 100644 (file)
@@ -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<any, HomeState> {
       case "success": {
         const trending = this.state.trendingCommunitiesRes.data.communities;
         return (
-          <div
-            className={classNames({
-              "mb-2": !isMobile,
-            })}
-          >
+          <>
             <header className="card-header d-flex align-items-center">
               <h5 className="mb-0">
                 <T i18nKey="trending_communities">
@@ -522,13 +517,15 @@ export class Home extends Component<any, HomeState> {
               </h5>
             </header>
             <div className="card-body">
-              <ul className="list-inline">
-                {trending.map(cv => (
-                  <li key={cv.community.id} className="list-inline-item">
-                    <CommunityLink community={cv.community} />
-                  </li>
-                ))}
-              </ul>
+              {trending.length > 0 && (
+                <ul className="list-inline">
+                  {trending.map(cv => (
+                    <li key={cv.community.id} className="list-inline-item">
+                      <CommunityLink community={cv.community} />
+                    </li>
+                  ))}
+                </ul>
+              )}
               {canCreateCommunity(this.state.siteRes) && (
                 <LinkButton
                   path="/create_community"
@@ -540,7 +537,7 @@ export class Home extends Component<any, HomeState> {
                 translationKey="explore_communities"
               />
             </div>
-          </div>
+          </>
         );
       }
     }
index f4081737edf3dcf80fff5b49fbef09647722aa62..cc587bfbdba259624b6d52bbf6211a2a82b81e33 100644 (file)
@@ -31,10 +31,7 @@ export class SiteSidebar extends Component<SiteSidebarProps, SiteSidebarState> {
   render() {
     return (
       <div className="accordion">
-        <section
-          id="sidebarInfo"
-          className="card border-secondary mb-3 overflow-hidden"
-        >
+        <section id="sidebarInfo" className="card border-secondary mb-3">
           <header
             className="card-header d-flex align-items-center"
             id="sidebarInfoHeader"