Add FeaturedPost Support (#873)

This commit is contained in:
Anon 2022-12-14 09:03:18 -06:00 committed by GitHub
parent a6c0643428
commit 003b177f6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 108 additions and 50 deletions

View file

@ -140,7 +140,7 @@ export class Home extends Component<any, HomeState> {
dataType: getDataTypeFromProps(this.props),
sort: getSortTypeFromProps(this.props),
page: getPageFromProps(this.props),
tagline: None
tagline: None,
};
constructor(props: any, context: any) {
@ -179,7 +179,7 @@ export class Home extends Component<any, HomeState> {
...this.state,
trendingCommunities: trendingRes.communities,
loading: false,
tagline: taglines.map(tls => getRandomFromList(tls).content)
tagline: taglines.map(tls => getRandomFromList(tls).content),
};
} else {
this.fetchTrendingCommunities();
@ -336,7 +336,12 @@ export class Home extends Component<any, HomeState> {
<div className="row">
<main role="main" className="col-12 col-md-8">
{this.state.tagline.match({
some: tagline => <div id="tagline" dangerouslySetInnerHTML={mdToHtml(tagline)}></div>,
some: tagline => (
<div
id="tagline"
dangerouslySetInnerHTML={mdToHtml(tagline)}
></div>
),
none: <></>,
})}
<div className="d-block d-md-none">{this.mobileView()}</div>
@ -804,7 +809,7 @@ export class Home extends Component<any, HomeState> {
op == UserOperation.DeletePost ||
op == UserOperation.RemovePost ||
op == UserOperation.LockPost ||
op == UserOperation.StickyPost ||
op == UserOperation.FeaturePost ||
op == UserOperation.SavePost
) {
let data = wsJsonToRes<PostResponse>(msg, PostResponse);