Chore: Migrate MarkdownTableView to Typescript (#3500)

Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
Reinaldo Neto 2021-11-17 17:00:40 -03:00 committed by GitHub
parent afdc915499
commit 945fe235cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 8 deletions

View File

@ -1,22 +1,26 @@
import React from 'react'; import React from 'react';
import { ScrollView } from 'react-native'; import { ScrollView } from 'react-native';
import PropTypes from 'prop-types'; import { StackNavigationOptions } from '@react-navigation/stack';
import { RouteProp } from '@react-navigation/native';
import I18n from '../i18n'; import I18n from '../i18n';
import { isIOS } from '../utils/deviceInfo'; import { isIOS } from '../utils/deviceInfo';
import { themes } from '../constants/colors'; import { themes } from '../constants/colors';
import { withTheme } from '../theme'; import { withTheme } from '../theme';
class MarkdownTableView extends React.Component { interface IMarkdownTableViewProps {
static navigationOptions = () => ({ route: RouteProp<
{ MarkdownTableView: { renderRows: (drawExtraBorders?: boolean) => JSX.Element; tableWidth: number } },
'MarkdownTableView'
>;
theme: string;
}
class MarkdownTableView extends React.Component<IMarkdownTableViewProps> {
static navigationOptions = (): StackNavigationOptions => ({
title: I18n.t('Table') title: I18n.t('Table')
}); });
static propTypes = {
route: PropTypes.object,
theme: PropTypes.string
};
render() { render() {
const { route, theme } = this.props; const { route, theme } = this.props;
const renderRows = route.params?.renderRows; const renderRows = route.params?.renderRows;