mattermost-mobile/app/components/slack_attachments/index.js
Jesse Hallam 58b72302d6 update eslint's comma-dangle rule to always-multiline (#1457)
* update eslint's `comma-dangle` rule to `always-multiline`

* add check and fix scripts to package.json

* Invoke `yarn fix` to adopt the updated eslint rules. No other changes are included.
2018-02-23 09:06:02 -05:00

50 lines
1.6 KiB
JavaScript

// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import React, {PureComponent} from 'react';
import {View} from 'react-native';
import PropTypes from 'prop-types';
import CustomPropTypes from 'app/constants/custom_prop_types';
import SlackAttachment from './slack_attachment';
export default class SlackAttachments extends PureComponent {
static propTypes = {
attachments: PropTypes.array.isRequired,
baseTextStyle: CustomPropTypes.Style,
blockStyles: PropTypes.object,
postId: PropTypes.string.isRequired,
navigator: PropTypes.object.isRequired,
onLongPress: PropTypes.func.isRequired,
theme: PropTypes.object,
textStyles: PropTypes.object,
};
render() {
const {attachments, baseTextStyle, blockStyles, navigator, onLongPress, postId, theme, textStyles} = this.props;
const content = [];
attachments.forEach((attachment, i) => {
content.push(
<SlackAttachment
attachment={attachment}
baseTextStyle={baseTextStyle}
blockStyles={blockStyles}
key={'att_' + i}
navigator={navigator}
onLongPress={onLongPress}
postId={postId}
theme={theme}
textStyles={textStyles}
/>
);
});
return (
<View style={{flex: 1, flexDirection: 'column'}}>
{content}
</View>
);
}
}