Chore: Migrate LegalView to typescript (#3425)

Co-authored-by: AlexAlexandre <alexalexandrejr@gmail.com>
This commit is contained in:
Reinaldo Neto 2021-10-06 17:36:46 -03:00 committed by GitHub
parent ada2aed90b
commit fb71b60d54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 11 deletions

View File

@ -1,6 +1,6 @@
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { StackNavigationOptions } from '@react-navigation/stack';
import I18n from '../i18n'; import I18n from '../i18n';
import StatusBar from '../containers/StatusBar'; import StatusBar from '../containers/StatusBar';
@ -9,13 +9,17 @@ import { withTheme } from '../theme';
import SafeAreaView from '../containers/SafeAreaView'; import SafeAreaView from '../containers/SafeAreaView';
import * as List from '../containers/List'; import * as List from '../containers/List';
class LegalView extends React.Component { interface ILegalView {
static propTypes = { server: string;
server: PropTypes.string, theme: string;
theme: PropTypes.string }
class LegalView extends React.Component<ILegalView, any> {
static navigationOptions: StackNavigationOptions = {
title: I18n.t('Legal')
}; };
onPressItem = ({ route }) => { onPressItem = ({ route }: { route: string }) => {
const { server, theme } = this.props; const { server, theme } = this.props;
if (!server) { if (!server) {
return; return;
@ -51,12 +55,8 @@ class LegalView extends React.Component {
} }
} }
const mapStateToProps = state => ({ const mapStateToProps = (state: any) => ({
server: state.server.server server: state.server.server
}); });
LegalView.navigationOptions = {
title: I18n.t('Legal')
};
export default connect(mapStateToProps)(withTheme(LegalView)); export default connect(mapStateToProps)(withTheme(LegalView));