]> Untitled Git - lemmy.git/blob - ui/src/components/create-community.tsx
Fix page titles for custom site name
[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 import { WebSocketService } from '../services';
5
6 export class CreateCommunity extends Component<any, any> {
7
8   constructor(props: any, context: any) {
9     super(props, context);
10     this.handleCommunityCreate = this.handleCommunityCreate.bind(this);
11   }
12
13   componentDidMount() {
14     document.title = `Create Community - ${WebSocketService.Instance.site.name}`;
15   }
16
17   render() {
18     return (
19       <div class="container">
20         <div class="row">
21           <div class="col-12 col-lg-6 mb-4">
22             <h5>Create Community</h5>
23             <CommunityForm onCreate={this.handleCommunityCreate}/>
24           </div>
25         </div>
26       </div>
27     )
28   }
29
30   handleCommunityCreate(community: Community) {
31     this.props.history.push(`/c/${community.name}`);
32   }
33 }
34
35