From 97e21f6fd905d0ecf5f26f5a0f537a82cc0f0800 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 18 Oct 2019 17:20:27 -0700 Subject: [PATCH] Running prettier on code. - #305 , #309 --- ui/src/components/comment-form.tsx | 188 +++++-- ui/src/components/comment-node.tsx | 586 +++++++++++++++------ ui/src/components/comment-nodes.tsx | 32 +- ui/src/components/communities.tsx | 191 ++++--- ui/src/components/community-form.tsx | 134 +++-- ui/src/components/community.tsx | 189 ++++--- ui/src/components/create-community.tsx | 15 +- ui/src/components/create-post.tsx | 27 +- ui/src/components/footer.tsx | 19 +- ui/src/components/inbox.tsx | 172 ++++-- ui/src/components/login.tsx | 162 ++++-- ui/src/components/main.tsx | 431 ++++++++++----- ui/src/components/modlog.tsx | 413 +++++++++++---- ui/src/components/moment-time.tsx | 13 +- ui/src/components/navbar.tsx | 201 ++++--- ui/src/components/post-form.tsx | 281 +++++++--- ui/src/components/post-listing.tsx | 700 ++++++++++++++++++------- ui/src/components/post-listings.tsx | 36 +- ui/src/components/post.tsx | 271 ++++++---- ui/src/components/search.tsx | 358 ++++++++----- ui/src/components/setup.tsx | 105 +++- ui/src/components/sidebar.tsx | 253 ++++++--- ui/src/components/site-form.tsx | 65 ++- ui/src/components/sponsors.tsx | 99 ++-- ui/src/components/symbols.tsx | 123 +++-- ui/src/components/user.tsx | 528 +++++++++++++------ ui/src/env.ts | 6 +- ui/src/i18next.ts | 18 +- ui/src/index.tsx | 27 +- ui/src/interfaces.ts | 268 ++++++---- ui/src/services/UserService.ts | 24 +- ui/src/services/WebSocketService.ts | 107 +++- ui/src/translations/de.ts | 38 +- ui/src/translations/en.ts | 51 +- ui/src/translations/eo.ts | 32 +- ui/src/translations/es.ts | 49 +- ui/src/translations/fr.ts | 75 +-- ui/src/translations/nl.ts | 36 +- ui/src/translations/ru.ts | 35 +- ui/src/translations/sv.ts | 20 +- ui/src/translations/zh.ts | 26 +- ui/src/utils.ts | 176 ++++--- ui/src/version.ts | 2 +- 43 files changed, 4523 insertions(+), 2059 deletions(-) diff --git a/ui/src/components/comment-form.tsx b/ui/src/components/comment-form.tsx index 2095e9e..bebe626 100644 --- a/ui/src/components/comment-form.tsx +++ b/ui/src/components/comment-form.tsx @@ -1,7 +1,22 @@ import { Component, linkEvent } from 'inferno'; -import { CommentNode as CommentNodeI, CommentForm as CommentFormI, SearchForm, SearchType, SortType, UserOperation, SearchResponse } from '../interfaces'; -import { Subscription } from "rxjs"; -import { capitalizeFirstLetter, mentionDropdownFetchLimit, msgOp, mdToHtml, randomStr, markdownHelpUrl } from '../utils'; +import { + CommentNode as CommentNodeI, + CommentForm as CommentFormI, + SearchForm, + SearchType, + SortType, + UserOperation, + SearchResponse, +} from '../interfaces'; +import { Subscription } from 'rxjs'; +import { + capitalizeFirstLetter, + mentionDropdownFetchLimit, + msgOp, + mdToHtml, + randomStr, + markdownHelpUrl, +} from '../utils'; import { WebSocketService, UserService } from '../services'; import * as autosize from 'autosize'; import { i18n } from '../i18next'; @@ -25,7 +40,6 @@ interface CommentFormState { } export class CommentForm extends Component { - private id = `comment-form-${randomStr()}`; private userSub: Subscription; private communitySub: Subscription; @@ -34,13 +48,21 @@ export class CommentForm extends Component { commentForm: { auth: null, content: null, - post_id: this.props.node ? this.props.node.comment.post_id : this.props.postId, - creator_id: UserService.Instance.user ? UserService.Instance.user.id : null, + post_id: this.props.node + ? this.props.node.comment.post_id + : this.props.postId, + creator_id: UserService.Instance.user + ? UserService.Instance.user.id + : null, }, - buttonTitle: !this.props.node ? capitalizeFirstLetter(i18n.t('post')) : this.props.edit ? capitalizeFirstLetter(i18n.t('edit')) : capitalizeFirstLetter(i18n.t('reply')), + buttonTitle: !this.props.node + ? capitalizeFirstLetter(i18n.t('post')) + : this.props.edit + ? capitalizeFirstLetter(i18n.t('edit')) + : capitalizeFirstLetter(i18n.t('reply')), previewMode: false, imageLoading: false, - } + }; constructor(props: any, context: any) { super(props, context); @@ -57,7 +79,9 @@ export class CommentForm extends Component { selectTemplate: (item: any) => { return `:${item.original.key}:`; }, - values: Object.entries(emojiShortName).map(e => {return {'key': e[1], 'val': e[0]}}), + values: Object.entries(emojiShortName).map(e => { + return { key: e[1], val: e[0] }; + }), allowSpaces: false, autocompleteMode: true, menuItemLimit: mentionDropdownFetchLimit, @@ -88,8 +112,8 @@ export class CommentForm extends Component { allowSpaces: false, autocompleteMode: true, menuItemLimit: mentionDropdownFetchLimit, - } - ] + }, + ], }); this.state = this.emptyState; @@ -104,7 +128,7 @@ export class CommentForm extends Component { // A reply gets a new parent id this.state.commentForm.parent_id = this.props.node.comment.id; } - } + } } componentDidMount() { @@ -124,27 +148,82 @@ export class CommentForm extends Component {
-