Skip to content

Commit

Permalink
Make the new component a function component.
Browse files Browse the repository at this point in the history
  • Loading branch information
cristipaval committed Jun 7, 2023
1 parent e384cfa commit 859f3ba
Showing 1 changed file with 27 additions and 29 deletions.
56 changes: 27 additions & 29 deletions src/components/ValidateCode/JustSignedInModal.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {PureComponent} from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import {View} from 'react-native';
import colors from '../../styles/colors';
Expand All @@ -17,38 +17,36 @@ const propTypes = {
is2FARequired: PropTypes.bool.isRequired,
};

class JustSignedInModal extends PureComponent {
render() {
return (
<View style={styles.deeplinkWrapperContainer}>
<View style={styles.deeplinkWrapperMessage}>
<View style={styles.mb2}>
<Icon
width={variables.modalTopIconWidth}
height={this.props.is2FARequired ? variables.modalTopIconHeight : variables.modalTopBigIconHeight}
src={this.props.is2FARequired ? Illustrations.SafeBlue : Illustrations.Abracadabra}
/>
</View>
<Text style={[styles.textHeadline, styles.textXXLarge, styles.textAlignCenter]}>
{this.props.translate(this.props.is2FARequired ? 'validateCodeModal.tfaRequiredTitle' : 'validateCodeModal.successfulSignInTitle')}
</Text>
<View style={[styles.mt2, styles.mb2]}>
<Text style={[styles.fontSizeNormal, styles.textAlignCenter]}>
{this.props.translate(this.props.is2FARequired ? 'validateCodeModal.tfaRequiredDescription' : 'validateCodeModal.successfulSignInDescription')}
</Text>
</View>
</View>
<View style={styles.deeplinkWrapperFooter}>
function JustSignedInModal(props) {
return (
<View style={styles.deeplinkWrapperContainer}>
<View style={styles.deeplinkWrapperMessage}>
<View style={styles.mb2}>
<Icon
width={variables.modalWordmarkWidth}
height={variables.modalWordmarkHeight}
fill={colors.green}
src={Expensicons.ExpensifyWordmark}
width={variables.modalTopIconWidth}
height={props.is2FARequired ? variables.modalTopIconHeight : variables.modalTopBigIconHeight}
src={props.is2FARequired ? Illustrations.SafeBlue : Illustrations.Abracadabra}
/>
</View>
<Text style={[styles.textHeadline, styles.textXXLarge, styles.textAlignCenter]}>
{props.translate(props.is2FARequired ? 'validateCodeModal.tfaRequiredTitle' : 'validateCodeModal.successfulSignInTitle')}
</Text>
<View style={[styles.mt2, styles.mb2]}>
<Text style={[styles.fontSizeNormal, styles.textAlignCenter]}>
{props.translate(props.is2FARequired ? 'validateCodeModal.tfaRequiredDescription' : 'validateCodeModal.successfulSignInDescription')}
</Text>
</View>
</View>
<View style={styles.deeplinkWrapperFooter}>
<Icon
width={variables.modalWordmarkWidth}
height={variables.modalWordmarkHeight}
fill={colors.green}
src={Expensicons.ExpensifyWordmark}
/>
</View>
);
}
</View>
);
}

JustSignedInModal.propTypes = propTypes;
Expand Down

0 comments on commit 859f3ba

Please sign in to comment.