From fb71b60d54105fca6c6ffe5e7cb4d94142c8cb71 Mon Sep 17 00:00:00 2001 From: Reinaldo Neto <47038980+reinaldonetof@users.noreply.github.com> Date: Wed, 6 Oct 2021 17:36:46 -0300 Subject: [PATCH] Chore: Migrate LegalView to typescript (#3425) Co-authored-by: AlexAlexandre --- app/views/{LegalView.js => LegalView.tsx} | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) rename app/views/{LegalView.js => LegalView.tsx} (77%) diff --git a/app/views/LegalView.js b/app/views/LegalView.tsx similarity index 77% rename from app/views/LegalView.js rename to app/views/LegalView.tsx index b9db90572..02ac172d9 100644 --- a/app/views/LegalView.js +++ b/app/views/LegalView.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import PropTypes from 'prop-types'; import { connect } from 'react-redux'; +import { StackNavigationOptions } from '@react-navigation/stack'; import I18n from '../i18n'; import StatusBar from '../containers/StatusBar'; @@ -9,13 +9,17 @@ import { withTheme } from '../theme'; import SafeAreaView from '../containers/SafeAreaView'; import * as List from '../containers/List'; -class LegalView extends React.Component { - static propTypes = { - server: PropTypes.string, - theme: PropTypes.string +interface ILegalView { + server: string; + theme: string; +} + +class LegalView extends React.Component { + static navigationOptions: StackNavigationOptions = { + title: I18n.t('Legal') }; - onPressItem = ({ route }) => { + onPressItem = ({ route }: { route: string }) => { const { server, theme } = this.props; if (!server) { return; @@ -51,12 +55,8 @@ class LegalView extends React.Component { } } -const mapStateToProps = state => ({ +const mapStateToProps = (state: any) => ({ server: state.server.server }); -LegalView.navigationOptions = { - title: I18n.t('Legal') -}; - export default connect(mapStateToProps)(withTheme(LegalView));