]> Untitled Git - lemmy.git/blob - ui/src/components/create-post.tsx
Adding document titles.
[lemmy.git] / ui / src / components / create-post.tsx
1 import { Component } from 'inferno';
2 import { PostForm } from './post-form';
3
4 export class CreatePost extends Component<any, any> {
5
6   constructor(props: any, context: any) {
7     super(props, context);
8     this.handlePostCreate = this.handlePostCreate.bind(this);
9   }
10
11   componentDidMount() {
12     document.title = "Create Post - Lemmy";
13   }
14
15   render() {
16     return (
17       <div class="container">
18         <div class="row">
19           <div class="col-12 col-lg-6 mb-4">
20             <h5>Create a Post</h5>
21             <PostForm onCreate={this.handlePostCreate}/>
22           </div>
23         </div>
24       </div>
25     )
26   }
27
28   handlePostCreate(id: number) {
29     this.props.history.push(`/post/${id}`);
30   }
31 }
32
33