updateCommunityBlock,
updatePersonBlock,
} from "@utils/app";
-import { isBrowser } from "@utils/browser";
import {
getPageFromString,
getQueryParams,
} from "@utils/helpers";
import type { QueryParams } from "@utils/types";
import { RouteDataResponse } from "@utils/types";
-import { Component, linkEvent } from "inferno";
+import { Component, RefObject, createRef, linkEvent } from "inferno";
import { RouteComponentProps } from "inferno-router/dist/Route";
import {
AddAdmin,
finished: new Map(),
isIsomorphic: false,
};
-
+ private readonly mainContentRef: RefObject<HTMLElement>;
constructor(props: RouteComponentProps<{ name: string }>, context: any) {
super(props, context);
this.handleSavePost = this.handleSavePost.bind(this);
this.handlePurgePost = this.handlePurgePost.bind(this);
this.handleFeaturePost = this.handleFeaturePost.bind(this);
-
+ this.mainContentRef = createRef();
// Only fetch the data if coming from another route
- if (!isBrowser() || FirstLoadService.isFirstLoad) {
+ if (FirstLoadService.isFirstLoad) {
const { communityRes, commentsRes, postsRes } = this.isoData.routeData;
this.state = {
/>
<div className="row">
- <div className="col-12 col-md-8">
+ <main
+ className="col-12 col-md-8 col-lg-9"
+ ref={this.mainContentRef}
+ >
{this.communityInfo(res)}
<div className="d-block d-md-none">
<button
{this.selects(res)}
{this.listings(res)}
<Paginator page={page} onChange={this.handlePageChange} />
- </div>
- <div className="d-none d-md-block col-md-4">
+ </main>
+ <aside className="d-none d-md-block col-md-4 col-lg-3">
{this.sidebar(res)}
- </div>
+ </aside>
</div>
</>
);
community && (
<div className="mb-2">
<BannerIconHeader banner={community.banner} icon={community.icon} />
- <h5 className="mb-0 overflow-wrap-anywhere">{community.title}</h5>
+ <h1 className="h4 mb-0 overflow-wrap-anywhere">{community.title}</h1>
<CommunityLink
community={community}
realLink