From 4ef0cfe5811af2b7327cba33388ad7fa6927185e Mon Sep 17 00:00:00 2001 From: Reinaldo Neto <47038980+reinaldonetof@users.noreply.github.com> Date: Wed, 17 Nov 2021 17:04:48 -0300 Subject: [PATCH] Chore: Migrate E2EHowItWorksView to Typescript (#3492) Co-authored-by: Diego Mello --- ...owItWorksView.js => E2EHowItWorksView.tsx} | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) rename app/views/{E2EHowItWorksView.js => E2EHowItWorksView.tsx} (68%) diff --git a/app/views/E2EHowItWorksView.js b/app/views/E2EHowItWorksView.tsx similarity index 68% rename from app/views/E2EHowItWorksView.js rename to app/views/E2EHowItWorksView.tsx index 0ac1c756..0fbdf77a 100644 --- a/app/views/E2EHowItWorksView.js +++ b/app/views/E2EHowItWorksView.tsx @@ -1,5 +1,6 @@ import React from 'react'; -import PropTypes from 'prop-types'; +import { StackNavigationProp } from '@react-navigation/stack'; +import { RouteProp } from '@react-navigation/native'; import { StyleSheet } from 'react-native'; import SafeAreaView from '../containers/SafeAreaView'; @@ -21,8 +22,17 @@ const styles = StyleSheet.create({ } }); -class E2EHowItWorksView extends React.Component { - static navigationOptions = ({ route, navigation }) => { +interface INavigation { + navigation: StackNavigationProp; + route: RouteProp<{ E2EHowItWorksView: { showCloseModal: boolean } }, 'E2EHowItWorksView'>; +} + +interface IE2EHowItWorksViewProps extends INavigation { + theme: string; +} + +class E2EHowItWorksView extends React.Component { + static navigationOptions = ({ route, navigation }: INavigation) => { const showCloseModal = route.params?.showCloseModal; return { title: I18n.t('How_It_Works'), @@ -30,20 +40,21 @@ class E2EHowItWorksView extends React.Component { }; }; - static propTypes = { - theme: PropTypes.string - }; - render() { const { theme } = this.props; const infoStyle = [styles.info, { color: themes[theme].bodyText }]; + // TODO: Refactor when migrate Markdown return ( + {/* @ts-ignore */} + {/* @ts-ignore */} + {/* @ts-ignore */} + {/* @ts-ignore */} );