]> Untitled Git - lemmy.git/blob - ui/src/components/create-community.tsx
Adding /f/ and /u/ in links now.
[lemmy.git] / ui / src / components / create-community.tsx
1 import { Component } from 'inferno';
2 import { CommunityForm } from './community-form';
3 import { Community } from '../interfaces';
4
5 export class CreateCommunity extends Component<any, any> {
6
7   constructor(props: any, context: any) {
8     super(props, context);
9     this.handleCommunityCreate = this.handleCommunityCreate.bind(this);
10   }
11
12   componentDidMount() {
13     document.title = "Create Forum - Lemmy";
14   }
15
16   render() {
17     return (
18       <div class="container">
19         <div class="row">
20           <div class="col-12 col-lg-6 mb-4">
21             <h5>Create Forum</h5>
22             <CommunityForm onCreate={this.handleCommunityCreate}/>
23           </div>
24         </div>
25       </div>
26     )
27   }
28
29   handleCommunityCreate(community: Community) {
30     this.props.history.push(`/f/${community.name}`);
31   }
32 }
33
34