Chore: Migrate MarkdownTableView to Typescript (#3500)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
parent
afdc915499
commit
945fe235cd
|
@ -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;
|
Loading…
Reference in New Issue