]> Untitled Git - lemmy-ui.git/commitdiff
Use aside semantic HTML tag for sidebars
authorZetaphor <zetaphor@hey.com>
Fri, 16 Jun 2023 20:27:55 +0000 (17:27 -0300)
committerZetaphor <zetaphor@hey.com>
Fri, 16 Jun 2023 20:27:55 +0000 (17:27 -0300)
src/shared/components/community/sidebar.tsx
src/shared/components/home/home.tsx
src/shared/components/home/site-sidebar.tsx

index 0d08e77e1ac9c32c93038038474413891c7beb83..11870f5df5edda3f62eb5c43c29d9c99e96b29f1 100644 (file)
@@ -133,7 +133,7 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
     const { name, actor_id } = this.props.community_view.community;
     return (
       <div id="sidebarContainer">
-        <div id="sidebarMain" className="card border-secondary mb-3">
+        <section id="sidebarMain" className="card border-secondary mb-3">
           <div className="card-body">
             {this.communityTitle()}
             {this.props.editable && this.adminButtons()}
@@ -154,14 +154,14 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
               </div>
             )}
           </div>
-        </div>
-        <div id="sidebarInfo" className="card border-secondary mb-3">
+        </section>
+        <section id="sidebarInfo" className="card border-secondary mb-3">
           <div className="card-body">
             {this.description()}
             {this.badges()}
             {this.mods()}
           </div>
-        </div>
+        </section>
       </div>
     );
   }
index 9c7cd753defe55c61f92226fe1617ef68c9c2608..c7780a9e557635fdcfffa95166a70e5eb2b25cec 100644 (file)
@@ -422,36 +422,37 @@ export class Home extends Component<any, HomeState> {
     } = this.state;
 
     return (
-      <div>
-        <div id="sidebarContainer">
-          <div id="sidebarMain" className="card border-secondary mb-3">
-            <div className="card-body">
-              {this.trendingCommunities()}
-              {canCreateCommunity(this.state.siteRes) && (
-                <LinkButton
-                  path="/create_community"
-                  translationKey="create_a_community"
-                />
-              )}
+      <div id="sidebarContainer">
+        <section id="sidebarMain" className="card border-secondary mb-3">
+          <div className="card-body">
+            {this.trendingCommunities()}
+            {canCreateCommunity(this.state.siteRes) && (
               <LinkButton
-                path="/communities"
-                translationKey="explore_communities"
+                path="/create_community"
+                translationKey="create_a_community"
               />
-            </div>
+            )}
+            <LinkButton
+              path="/communities"
+              translationKey="explore_communities"
+            />
           </div>
-          <SiteSidebar
-            site={site}
-            admins={admins}
-            counts={counts}
-            online={online}
-            showLocal={showLocal(this.isoData)}
-          />
-          {this.hasFollows && (
-            <div id="sidebarSubscribed" className="card border-secondary mb-3">
-              <div className="card-body">{this.subscribedCommunities}</div>
-            </div>
-          )}
-        </div>
+        </section>
+        <SiteSidebar
+          site={site}
+          admins={admins}
+          counts={counts}
+          online={online}
+          showLocal={showLocal(this.isoData)}
+        />
+        {this.hasFollows && (
+          <section
+            id="sidebarSubscribed"
+            className="card border-secondary mb-3"
+          >
+            <div className="card-body">{this.subscribedCommunities}</div>
+          </section>
+        )}
       </div>
     );
   }
index d96a1381dc8575afad92efe935aa73a198d830c3..d2a3eee071767fb93c5f730edbe7eba4f1cb6ae8 100644 (file)
@@ -30,7 +30,7 @@ export class SiteSidebar extends Component<SiteSidebarProps, SiteSidebarState> {
 
   render() {
     return (
-      <div id="sidebarInfo" className="card border-secondary mb-3">
+      <section id="sidebarInfo" className="card border-secondary mb-3">
         <div className="card-body">
           <div>
             <div className="mb-2">{this.siteName()}</div>
@@ -42,7 +42,7 @@ export class SiteSidebar extends Component<SiteSidebarProps, SiteSidebarState> {
             )}
           </div>
         </div>
-      </div>
+      </section>
     );
   }