From 945fe235cd2436a072cf6d20eee15acc7d4e6c56 Mon Sep 17 00:00:00 2001 From: Reinaldo Neto <47038980+reinaldonetof@users.noreply.github.com> Date: Wed, 17 Nov 2021 17:00:40 -0300 Subject: [PATCH] Chore: Migrate MarkdownTableView to Typescript (#3500) Co-authored-by: Diego Mello --- ...downTableView.js => MarkdownTableView.tsx} | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) rename app/views/{MarkdownTableView.js => MarkdownTableView.tsx} (63%) diff --git a/app/views/MarkdownTableView.js b/app/views/MarkdownTableView.tsx similarity index 63% rename from app/views/MarkdownTableView.js rename to app/views/MarkdownTableView.tsx index a95118d30..a65994eef 100644 --- a/app/views/MarkdownTableView.js +++ b/app/views/MarkdownTableView.tsx @@ -1,22 +1,26 @@ import React from 'react'; 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 { isIOS } from '../utils/deviceInfo'; import { themes } from '../constants/colors'; import { withTheme } from '../theme'; -class MarkdownTableView extends React.Component { - static navigationOptions = () => ({ +interface IMarkdownTableViewProps { + route: RouteProp< + { MarkdownTableView: { renderRows: (drawExtraBorders?: boolean) => JSX.Element; tableWidth: number } }, + 'MarkdownTableView' + >; + theme: string; +} + +class MarkdownTableView extends React.Component { + static navigationOptions = (): StackNavigationOptions => ({ title: I18n.t('Table') }); - static propTypes = { - route: PropTypes.object, - theme: PropTypes.string - }; - render() { const { route, theme } = this.props; const renderRows = route.params?.renderRows;