mattermost-mobile/app/components/markdown/markdown_list.js
enahum 23fa46fad6 Various UI fixes (#398)
* PLT-6001 Fix right margin on markdown lists

* PLT-6036 Fix post commented on spacing

* PLT-5902 Close keyboard when drawer opens
2017-03-26 22:23:09 -03:00

31 lines
957 B
JavaScript

// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import React, {PropTypes, PureComponent} from 'react';
import {View} from 'react-native';
export default class MarkdownList extends PureComponent {
static propTypes = {
children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf([PropTypes.node])]).isRequired,
ordered: PropTypes.bool.isRequired,
startAt: PropTypes.number,
tight: PropTypes.bool
};
render() {
const children = React.Children.map(this.props.children, (child, i) => {
return React.cloneElement(child, {
ordered: this.props.ordered,
startAt: this.props.startAt,
index: i,
tight: this.props.tight
});
});
return (
<View style={{marginRight: 20}}>
{children}
</View>
);
}
}