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