From: Jay Sitter Date: Sat, 17 Jun 2023 00:35:44 +0000 (-0400) Subject: Merge remote-tracking branch 'origin/main' into feat/add-badges-common-component X-Git-Url: http://these/git/%7B%60%24%7BghostArchiveUrl%7D/static/%7Bthis.state.thumbnail%7D?a=commitdiff_plain;h=8bbb6c9652bbbfda1ca9cc41592c413549f16c75;p=lemmy-ui.git Merge remote-tracking branch 'origin/main' into feat/add-badges-common-component * origin/main: handle login failures correctly wrap login call in try/catch for error handling Remove extra div in post sidebar Add a class to the more button on a comment node Switch navbar classes to ids Adding a few more 0.18.0 API changes. (#1324) Use aside semantic HTML tag for sidebars Use article semantic HTML tag for posts/comments Use footer semantic HTML tag Adding codeowners. Add lemmy-site class for easier detection Add ID's and classes to sidebars Add clases and ID's to post form/listing Add classes to post and comment repy textareas Rename markdown-textarea ID's Add nav and footer ID's --- 8bbb6c9652bbbfda1ca9cc41592c413549f16c75 diff --cc src/shared/components/common/badges.tsx index 188d92c,0000000..4427895 mode 100644,000000..100644 --- a/src/shared/components/common/badges.tsx +++ b/src/shared/components/common/badges.tsx @@@ -1,113 -1,0 +1,106 @@@ +import { Link } from "inferno-router"; +import { + CommunityAggregates, + CommunityView, + SiteAggregates, +} from "lemmy-js-client"; +import { i18n } from "../../i18next"; +import { numToSI } from "../../utils"; + +interface BadgesProps { + counts: CommunityAggregates | SiteAggregates; - online: number; + community_view?: CommunityView; +} + +const isCommunityAggregates = ( + counts: CommunityAggregates | SiteAggregates +): counts is CommunityAggregates => { + return "subscribers" in counts; +}; + - export const Badges = ({ counts, community_view, online }: BadgesProps) => { ++export const Badges = ({ counts, community_view }: BadgesProps) => { + return ( + + ); +}; diff --cc src/shared/components/community/sidebar.tsx index 7023d13,f4c7452..711ab5e --- a/src/shared/components/community/sidebar.tsx +++ b/src/shared/components/community/sidebar.tsx @@@ -132,41 -131,39 +131,42 @@@ export class Sidebar extends Component< const myUSerInfo = UserService.Instance.myUserInfo; const { name, actor_id } = this.props.community_view.community; return ( -
-
-
- {this.communityTitle()} - {this.props.editable && this.adminButtons()} - {myUSerInfo && this.subscribe()} - {this.canPost && this.createPost()} - {myUSerInfo && this.blockCommunity()} - {!myUSerInfo && ( -
- - ### - -
- )} -
-
-
-
- {this.description()} - - {this.mods()} -
+
+ ); } diff --cc src/shared/components/home/site-sidebar.tsx index 5f32e59,8603c36..66a48ca --- a/src/shared/components/home/site-sidebar.tsx +++ b/src/shared/components/home/site-sidebar.tsx @@@ -72,9 -71,7 +71,7 @@@ export class SiteSidebar extends Compon
{site.description &&
{site.description}
} {site.sidebar && this.siteSidebar(site.sidebar)} - {this.props.counts && ( - - )} - {this.props.counts && this.badges(this.props.counts)} ++ {this.props.counts && } {this.props.admins && this.admins(this.props.admins)}
);