* PLT-6001 Fix right margin on markdown lists * PLT-6036 Fix post commented on spacing * PLT-5902 Close keyboard when drawer opens
31 lines
957 B
JavaScript
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>
|
|
);
|
|
}
|
|
}
|