diff options
author | Dessalines <tyhou13@gmx.com> | 2019-10-18 17:20:27 -0700 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2019-10-18 17:20:27 -0700 |
commit | 4e5561283392d2ab1545cabb4455a8ffc490f86b (patch) | |
tree | a4ee9cc096826dc32faf3675212c7f95f1b3ea5e /ui/src/components/create-post.tsx | |
parent | 82ea5ae9186e5a8e631c87a61077e16713eb87a4 (diff) |
Running prettier on code.
- #305 , #309
Diffstat (limited to 'ui/src/components/create-post.tsx')
-rw-r--r-- | ui/src/components/create-post.tsx | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/ui/src/components/create-post.tsx b/ui/src/components/create-post.tsx index 3e00bd80..eeb9bc6c 100644 --- a/ui/src/components/create-post.tsx +++ b/ui/src/components/create-post.tsx @@ -6,14 +6,15 @@ import { i18n } from '../i18next'; import { T } from 'inferno-i18next'; export class CreatePost extends Component<any, any> { - constructor(props: any, context: any) { super(props, context); this.handlePostCreate = this.handlePostCreate.bind(this); } componentDidMount() { - document.title = `${i18n.t('create_post')} - ${WebSocketService.Instance.site.name}`; + document.title = `${i18n.t('create_post')} - ${ + WebSocketService.Instance.site.name + }`; } render() { @@ -21,21 +22,23 @@ export class CreatePost extends Component<any, any> { <div class="container"> <div class="row"> <div class="col-12 col-lg-6 offset-lg-3 mb-4"> - <h5><T i18nKey="create_post">#</T></h5> + <h5> + <T i18nKey="create_post">#</T> + </h5> <PostForm onCreate={this.handlePostCreate} params={this.params} /> </div> </div> </div> - ) + ); } get params(): PostFormParams { let urlParams = new URLSearchParams(this.props.location.search); let params: PostFormParams = { - name: urlParams.get("name"), - community: urlParams.get("community") || this.prevCommunityName, - body: urlParams.get("body"), - url: urlParams.get("url"), + name: urlParams.get('name'), + community: urlParams.get('community') || this.prevCommunityName, + body: urlParams.get('body'), + url: urlParams.get('url'), }; return params; @@ -46,9 +49,9 @@ export class CreatePost extends Component<any, any> { return this.props.match.params.name; } else if (this.props.location.state) { let lastLocation = this.props.location.state.prevPath; - if (lastLocation.includes("/c/")) { - return lastLocation.split("/c/")[1]; - } + if (lastLocation.includes('/c/')) { + return lastLocation.split('/c/')[1]; + } } return undefined; } @@ -57,5 +60,3 @@ export class CreatePost extends Component<any, any> { this.props.history.push(`/post/${id}`); } } - - |