]> Untitled Git - lemmy-ui.git/commitdiff
fix: Fix missing prop
authorJay Sitter <jay@jaysitter.com>
Sat, 17 Jun 2023 02:24:32 +0000 (22:24 -0400)
committerJay Sitter <jay@jaysitter.com>
Sat, 17 Jun 2023 02:25:35 +0000 (22:25 -0400)
src/shared/components/common/badges.tsx
src/shared/components/community/sidebar.tsx

index 858b986487189dc060c4a51ebae239820f4cb3a7..49c0888b0579ca27d661c3d9c472546f2913335c 100644 (file)
@@ -1,7 +1,7 @@
 import { Link } from "inferno-router";
 import {
   CommunityAggregates,
-  CommunityView,
+  CommunityId,
   SiteAggregates,
 } from "lemmy-js-client";
 import { i18n } from "../../i18next";
@@ -9,7 +9,7 @@ import { numToSI } from "../../utils";
 
 interface BadgesProps {
   counts: CommunityAggregates | SiteAggregates;
-  community_view: CommunityView;
+  communityId?: CommunityId;
 }
 
 const isCommunityAggregates = (
@@ -24,7 +24,7 @@ const isSiteAggregates = (
   return "communities" in counts;
 };
 
-export const Badges = ({ counts, community_view }: BadgesProps) => {
+export const Badges = ({ counts, communityId }: BadgesProps) => {
   return (
     <ul className="my-1 list-inline">
       <li
@@ -118,9 +118,7 @@ export const Badges = ({ counts, community_view }: BadgesProps) => {
       <li className="list-inline-item">
         <Link
           className="badge badge-primary"
-          to={`/modlog${
-            community_view ? `/${community_view.community.id}` : ""
-          }`}
+          to={`/modlog${communityId ? `/${communityId}` : ""}`}
         >
           {i18n.t("modlog")}
         </Link>
index 711ab5e664df4c9c6bf057d1ea614a7d2b300ab1..720e596fb6a13f0b876cd046c2d2bf9b8fef4b8b 100644 (file)
@@ -159,7 +159,7 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
             <div className="card-body">
               {this.description()}
               <Badges
-                community_view={this.props.community_view}
+                communityId={this.props.community_view.community.id}
                 counts={this.props.community_view.counts}
               />
               {this.mods()}