admins={admins}
counts={counts}
showLocal={showLocal(this.isoData)}
+ isMobile={true}
/>
)}
{showTrendingMobile && (
- <div className="col-12 card border-secondary mb-3">
+ <div className="card border-secondary mb-3">
<div className="card-body">{this.trendingCommunities(true)}</div>
</div>
)}
{showSubscribedMobile && (
- <div className="col-12 card border-secondary mb-3">
- <div className="card-body">{this.subscribedCommunities}</div>
+ <div className="card border-secondary mb-3">
+ {this.subscribedCommunities(true)}
</div>
)}
</div>
id="sidebarSubscribed"
className="card border-secondary mb-3"
>
- {this.subscribedCommunities}
+ {this.subscribedCommunities(false)}
</section>
</div>
)}
}
}
- get subscribedCommunities() {
+ subscribedCommunities(isMobile = false) {
const { subscribedCollapsed } = this.state;
return (
</Link>
</T>
</h5>
- <button
- type="button"
- className="btn btn-sm text-muted"
- onClick={linkEvent(this, this.handleCollapseSubscribe)}
- aria-label={
- subscribedCollapsed ? i18n.t("expand") : i18n.t("collapse")
- }
- data-tippy-content={
- subscribedCollapsed ? i18n.t("expand") : i18n.t("collapse")
- }
- data-bs-toggle="collapse"
- data-bs-target="#sidebarSubscribedBody"
- aria-expanded="true"
- aria-controls="sidebarSubscribedBody"
- >
- <Icon
- icon={`${subscribedCollapsed ? "plus" : "minus"}-square`}
- classes="icon-inline"
- />
- </button>
+ {!isMobile && (
+ <button
+ type="button"
+ className="btn btn-sm text-muted"
+ onClick={linkEvent(this, this.handleCollapseSubscribe)}
+ aria-label={
+ subscribedCollapsed ? i18n.t("expand") : i18n.t("collapse")
+ }
+ data-tippy-content={
+ subscribedCollapsed ? i18n.t("expand") : i18n.t("collapse")
+ }
+ data-bs-toggle="collapse"
+ data-bs-target="#sidebarSubscribedBody"
+ aria-expanded="true"
+ aria-controls="sidebarSubscribedBody"
+ >
+ <Icon
+ icon={`${subscribedCollapsed ? "plus" : "minus"}-square`}
+ classes="icon-inline"
+ />
+ </button>
+ )}
</header>
<div
id="sidebarSubscribedBody"
showLocal: boolean;
counts?: SiteAggregates;
admins?: PersonView[];
+ isMobile?: boolean;
}
interface SiteSidebarState {
return (
<>
<h5 className="mb-0 d-inline">{this.props.site.name}</h5>
- <button
- type="button"
- className="btn btn-sm"
- onClick={linkEvent(this, this.handleCollapseSidebar)}
- aria-label={
- this.state.collapsed ? i18n.t("expand") : i18n.t("collapse")
- }
- data-tippy-content={
- this.state.collapsed ? i18n.t("expand") : i18n.t("collapse")
- }
- data-bs-toggle="collapse"
- data-bs-target="#sidebarInfoBody"
- aria-expanded="true"
- aria-controls="sidebarInfoBody"
- >
- {this.state.collapsed ? (
- <Icon icon="plus-square" classes="icon-inline" />
- ) : (
- <Icon icon="minus-square" classes="icon-inline" />
- )}
- </button>
+ {!this.props.isMobile && (
+ <button
+ type="button"
+ className="btn btn-sm"
+ onClick={linkEvent(this, this.handleCollapseSidebar)}
+ aria-label={
+ this.state.collapsed ? i18n.t("expand") : i18n.t("collapse")
+ }
+ data-tippy-content={
+ this.state.collapsed ? i18n.t("expand") : i18n.t("collapse")
+ }
+ data-bs-toggle="collapse"
+ data-bs-target="#sidebarInfoBody"
+ aria-expanded="true"
+ aria-controls="sidebarInfoBody"
+ >
+ {this.state.collapsed ? (
+ <Icon icon="plus-square" classes="icon-inline" />
+ ) : (
+ <Icon icon="minus-square" classes="icon-inline" />
+ )}
+ </button>
+ )}
</>
);
}