Add FeaturedPost Support (#873)
This commit is contained in:
parent
a6c0643428
commit
003b177f6e
9 changed files with 108 additions and 50 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue