2019-08-27 12:25:38 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { ScrollView } from 'react-native';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
import I18n from '../i18n';
|
|
|
|
import { isIOS } from '../utils/deviceInfo';
|
|
|
|
|
2019-11-25 20:01:17 +00:00
|
|
|
export default class MarkdownTableView extends React.Component {
|
2019-08-27 12:25:38 +00:00
|
|
|
static navigationOptions = () => ({
|
|
|
|
title: I18n.t('Table')
|
|
|
|
});
|
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
navigation: PropTypes.object
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
const { navigation } = this.props;
|
|
|
|
const renderRows = navigation.getParam('renderRows');
|
|
|
|
const tableWidth = navigation.getParam('tableWidth');
|
|
|
|
|
|
|
|
if (isIOS) {
|
|
|
|
return (
|
|
|
|
<ScrollView contentContainerStyle={{ width: tableWidth }}>
|
|
|
|
{renderRows()}
|
|
|
|
</ScrollView>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<ScrollView>
|
|
|
|
<ScrollView horizontal>
|
|
|
|
{renderRows()}
|
|
|
|
</ScrollView>
|
|
|
|
</ScrollView>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|