Chore: Migrate E2EHowItWorksView to Typescript (#3492)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
parent
c93e4420dc
commit
4ef0cfe581
|
@ -1,5 +1,6 @@
|
||||||
import React from 'react';
|
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 { StyleSheet } from 'react-native';
|
||||||
|
|
||||||
import SafeAreaView from '../containers/SafeAreaView';
|
import SafeAreaView from '../containers/SafeAreaView';
|
||||||
|
@ -21,8 +22,17 @@ const styles = StyleSheet.create({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
class E2EHowItWorksView extends React.Component {
|
interface INavigation {
|
||||||
static navigationOptions = ({ route, navigation }) => {
|
navigation: StackNavigationProp<any, 'E2EHowItWorksView'>;
|
||||||
|
route: RouteProp<{ E2EHowItWorksView: { showCloseModal: boolean } }, 'E2EHowItWorksView'>;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface IE2EHowItWorksViewProps extends INavigation {
|
||||||
|
theme: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
class E2EHowItWorksView extends React.Component<IE2EHowItWorksViewProps, any> {
|
||||||
|
static navigationOptions = ({ route, navigation }: INavigation) => {
|
||||||
const showCloseModal = route.params?.showCloseModal;
|
const showCloseModal = route.params?.showCloseModal;
|
||||||
return {
|
return {
|
||||||
title: I18n.t('How_It_Works'),
|
title: I18n.t('How_It_Works'),
|
||||||
|
@ -30,20 +40,21 @@ class E2EHowItWorksView extends React.Component {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
static propTypes = {
|
|
||||||
theme: PropTypes.string
|
|
||||||
};
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { theme } = this.props;
|
const { theme } = this.props;
|
||||||
|
|
||||||
const infoStyle = [styles.info, { color: themes[theme].bodyText }];
|
const infoStyle = [styles.info, { color: themes[theme].bodyText }];
|
||||||
|
|
||||||
|
// TODO: Refactor when migrate Markdown
|
||||||
return (
|
return (
|
||||||
<SafeAreaView style={[styles.container, { backgroundColor: themes[theme].backgroundColor }]} testID='e2e-how-it-works-view'>
|
<SafeAreaView style={[styles.container, { backgroundColor: themes[theme].backgroundColor }]} testID='e2e-how-it-works-view'>
|
||||||
|
{/* @ts-ignore */}
|
||||||
<Markdown msg={I18n.t('E2E_How_It_Works_info1')} style={infoStyle} theme={theme} />
|
<Markdown msg={I18n.t('E2E_How_It_Works_info1')} style={infoStyle} theme={theme} />
|
||||||
|
{/* @ts-ignore */}
|
||||||
<Markdown msg={I18n.t('E2E_How_It_Works_info2')} style={infoStyle} theme={theme} />
|
<Markdown msg={I18n.t('E2E_How_It_Works_info2')} style={infoStyle} theme={theme} />
|
||||||
|
{/* @ts-ignore */}
|
||||||
<Markdown msg={I18n.t('E2E_How_It_Works_info3')} style={infoStyle} theme={theme} />
|
<Markdown msg={I18n.t('E2E_How_It_Works_info3')} style={infoStyle} theme={theme} />
|
||||||
|
{/* @ts-ignore */}
|
||||||
<Markdown msg={I18n.t('E2E_How_It_Works_info4')} style={infoStyle} theme={theme} />
|
<Markdown msg={I18n.t('E2E_How_It_Works_info4')} style={infoStyle} theme={theme} />
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
);
|
);
|
Loading…
Reference in New Issue