fix: Fix missing prop

This commit is contained in:
Jay Sitter 2023-06-16 22:24:32 -04:00
parent 7a105942b0
commit d951fb57da
2 changed files with 5 additions and 7 deletions

View file

@ -1,7 +1,7 @@
import { Link } from "inferno-router"; import { Link } from "inferno-router";
import { import {
CommunityAggregates, CommunityAggregates,
CommunityView, CommunityId,
SiteAggregates, SiteAggregates,
} from "lemmy-js-client"; } from "lemmy-js-client";
import { i18n } from "../../i18next"; import { i18n } from "../../i18next";
@ -9,7 +9,7 @@ import { numToSI } from "../../utils";
interface BadgesProps { interface BadgesProps {
counts: CommunityAggregates | SiteAggregates; counts: CommunityAggregates | SiteAggregates;
community_view: CommunityView; communityId?: CommunityId;
} }
const isCommunityAggregates = ( const isCommunityAggregates = (
@ -24,7 +24,7 @@ const isSiteAggregates = (
return "communities" in counts; return "communities" in counts;
}; };
export const Badges = ({ counts, community_view }: BadgesProps) => { export const Badges = ({ counts, communityId }: BadgesProps) => {
return ( return (
<ul className="my-1 list-inline"> <ul className="my-1 list-inline">
<li <li
@ -118,9 +118,7 @@ export const Badges = ({ counts, community_view }: BadgesProps) => {
<li className="list-inline-item"> <li className="list-inline-item">
<Link <Link
className="badge badge-primary" className="badge badge-primary"
to={`/modlog${ to={`/modlog${communityId ? `/${communityId}` : ""}`}
community_view ? `/${community_view.community.id}` : ""
}`}
> >
{i18n.t("modlog")} {i18n.t("modlog")}
</Link> </Link>

View file

@ -159,7 +159,7 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
<div className="card-body"> <div className="card-body">
{this.description()} {this.description()}
<Badges <Badges
community_view={this.props.community_view} communityId={this.props.community_view.community.id}
counts={this.props.community_view.counts} counts={this.props.community_view.counts}
/> />
{this.mods()} {this.mods()}