Format all source code using Prettier

This commit is contained in:
Daniel Gasienica 2018-04-27 17:25:04 -04:00
parent b4dee3f30b
commit 1dd87ad197
149 changed files with 17847 additions and 15439 deletions

View file

@ -4,7 +4,6 @@ import classnames from 'classnames';
import * as MIME from '../../../ts/types/MIME';
import * as GoogleChrome from '../../../ts/util/GoogleChrome';
interface Props {
attachments: Array<QuotedAttachment>;
authorColor: string;
@ -54,9 +53,9 @@ function getObjectUrl(thumbnail: Attachment | undefined): string | null {
export class Quote extends React.Component<Props, {}> {
public renderImage(url: string, icon?: string) {
const iconElement = icon
? <div className={classnames('icon', 'with-image', icon)} />
: null;
const iconElement = icon ? (
<div className={classnames('icon', 'with-image', icon)} />
) : null;
return (
<div className="icon-container">
@ -98,9 +97,7 @@ export class Quote extends React.Component<Props, {}> {
: this.renderIcon('movie');
}
if (GoogleChrome.isImageTypeSupported(contentType)) {
return objectUrl
? this.renderImage(objectUrl)
: this.renderIcon('image');
return objectUrl ? this.renderImage(objectUrl) : this.renderIcon('image');
}
if (MIME.isAudio(contentType)) {
return this.renderIcon('microphone');
@ -113,7 +110,9 @@ export class Quote extends React.Component<Props, {}> {
const { i18n, text, attachments } = this.props;
if (text) {
return <div className="text" dangerouslySetInnerHTML={{ __html: text}} />;
return (
<div className="text" dangerouslySetInnerHTML={{ __html: text }} />
);
}
if (!attachments || attachments.length === 0) {
@ -140,7 +139,13 @@ export class Quote extends React.Component<Props, {}> {
}
public renderIOSLabel() {
const { i18n, isIncoming, isFromMe, authorTitle, authorProfileName } = this.props;
const {
i18n,
isIncoming,
isFromMe,
authorTitle,
authorProfileName,
} = this.props;
const profileString = authorProfileName ? ` ~${authorProfileName}` : '';
const authorName = `${authorTitle}${profileString}`;
@ -185,27 +190,25 @@ export class Quote extends React.Component<Props, {}> {
isFromMe,
} = this.props;
const authorProfileElement = authorProfileName
? <span className="profile-name">~{authorProfileName}</span>
: null;
const authorProfileElement = authorProfileName ? (
<span className="profile-name">~{authorProfileName}</span>
) : null;
return (
<div className={classnames(authorColor, 'author')}>
{ isFromMe
? i18n('you')
: <span>{authorTitle}{' '}{authorProfileElement}</span>
}
{isFromMe ? (
i18n('you')
) : (
<span>
{authorTitle} {authorProfileElement}
</span>
)}
</div>
);
}
public render() {
const {
authorColor,
onClick,
isFromMe,
} = this.props;
const { authorColor, onClick, isFromMe } = this.props;
if (!validateQuote(this.props)) {
return null;