From 62562ebba957832c7e9f54bb65e19d99fee1ce8e Mon Sep 17 00:00:00 2001 From: Reinaldo Neto <47038980+reinaldonetof@users.noreply.github.com> Date: Tue, 5 Oct 2021 10:54:08 -0300 Subject: [PATCH] Chore: Migrate AuthLoadingView to Typescript (#3424) * chore: Migrate AuthLoadingView from js to tsx * minor tweak --- ...AuthLoadingView.js => AuthLoadingView.tsx} | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) rename app/views/{AuthLoadingView.js => AuthLoadingView.tsx} (81%) diff --git a/app/views/AuthLoadingView.js b/app/views/AuthLoadingView.tsx similarity index 81% rename from app/views/AuthLoadingView.js rename to app/views/AuthLoadingView.tsx index e97c10d94..ef6e7b943 100644 --- a/app/views/AuthLoadingView.js +++ b/app/views/AuthLoadingView.tsx @@ -1,6 +1,5 @@ import React from 'react'; import { ActivityIndicator, StyleSheet, Text, View } from 'react-native'; -import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import I18n from '../i18n'; @@ -23,25 +22,25 @@ const styles = StyleSheet.create({ } }); -const AuthLoadingView = React.memo(({ theme, text }) => ( +interface IAuthLoadingView { + theme: string; + text: string; +} + +const AuthLoadingView = React.memo(({ theme, text }: IAuthLoadingView) => ( - {text && ( + {text ? ( <> {`${text}\n${I18n.t('Please_wait')}`} - )} + ) : null} )); -const mapStateToProps = state => ({ +const mapStateToProps = (state: any) => ({ text: state.app.text }); -AuthLoadingView.propTypes = { - theme: PropTypes.string, - text: PropTypes.string -}; - export default connect(mapStateToProps)(withTheme(AuthLoadingView));