summaryrefslogtreecommitdiffstats
path: root/ui/src/components/create-community.tsx
blob: e98352a2285ef4baec636ddb3db4b1afd28fcfaf (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
import { Component, linkEvent } from 'inferno';
import { CommunityForm } from './community-form';

export class CreateCommunity extends Component<any, any> {

  constructor(props, context) {
    super(props, context);
    this.handleCommunityCreate = this.handleCommunityCreate.bind(this);
  }

  render() {
    return (
      <div class="container">
        <div class="row">
          <div class="col-12 col-lg-6 mb-4">
            <h4>Create Forum</h4>
            <CommunityForm onCreate={this.handleCommunityCreate}/>
          </div>
        </div>
      </div>
    )
  }

  handleCommunityCreate(id: number) {
    this.props.history.push(`/community/${id}`);
  }
}