summaryrefslogtreecommitdiffstats
path: root/ui/src/components/sidebar.tsx
blob: c8e80de62d98c0149f41f30e84275a6da6ecb7e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { Component, linkEvent } from 'inferno';
import { Community } from '../interfaces';
import { mdToHtml } from '../utils';

interface SidebarProps {
  community: Community;
}

interface SidebarState {
}

export class Sidebar extends Component<SidebarProps, SidebarState> {

  constructor(props, context) {
    super(props, context);
  }


  render() {
    let community = this.props.community;
    return (
      <div>
        <h4>{community.title}</h4>
        <ul class="list-inline">
          <li className="list-inline-item badge badge-light">{community.category_name}</li>
          <li className="list-inline-item badge badge-light">{community.number_of_subscribers} Subscribers</li>
          <li className="list-inline-item badge badge-light">{community.number_of_posts} Posts</li>
          <li className="list-inline-item badge badge-light">{community.number_of_comments} Comments</li>
        </ul>
        <div><button type="button" class="btn btn-secondary mb-2">Subscribe</button></div>
        <hr />
        {community.description && <div className="md-div" dangerouslySetInnerHTML={mdToHtml(community.description)} />}
      </div>
    );
  }
}