From 8b0c3d4bc8247b3a163543ce98ed913eecc0822c Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Mon, 20 Sep 2021 17:59:20 -0600 Subject: [PATCH 1/5] remove financial data text --- src/languages/en.js | 1 - src/languages/es.js | 1 - src/pages/ReimbursementAccount/RequestorStep.js | 3 --- 3 files changed, 5 deletions(-) diff --git a/src/languages/en.js b/src/languages/en.js index b34a3852f9d1..201051384eb4 100755 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -542,7 +542,6 @@ export default { requestorStep: { headerTitle: 'Personal information', subtitle: 'Please provide your personal information.', - financialRegulations: 'Financial regulation and bank rules require us to validate the identity of any individual setting up bank accounts on behalf of a company. ', learnMore: 'Learn more', isMyDataSafe: 'Is my data safe?', onFidoConditions: 'By continuing with the request to add this bank account, you confirm that you have read, understand and accept ', diff --git a/src/languages/es.js b/src/languages/es.js index 6cb589a87126..d5a573d98ee0 100644 --- a/src/languages/es.js +++ b/src/languages/es.js @@ -544,7 +544,6 @@ export default { requestorStep: { headerTitle: 'Información personal', subtitle: 'Dé más información sobre tí.', - financialRegulations: 'Las leyes fiscales y el reglamento bancario nos obliga a verificar la identidad de todo individuo que desee añadir una cuenta bancaria representando a una compañía. ', learnMore: 'Más información', isMyDataSafe: '¿Están seguros mis datos?', onFidoConditions: 'Al continuar con la solicitud de añadir esta cuenta bancaria, confirma que ha leído, entiende y acepta ', diff --git a/src/pages/ReimbursementAccount/RequestorStep.js b/src/pages/ReimbursementAccount/RequestorStep.js index 8e933e0543df..cf814515c99c 100644 --- a/src/pages/ReimbursementAccount/RequestorStep.js +++ b/src/pages/ReimbursementAccount/RequestorStep.js @@ -205,9 +205,6 @@ class RequestorStep extends React.Component { errorText={this.props.reimbursementAccount.error === this.props.translate('requestorStep.isControllingOfficerError') ? this.props.translate('requestorStep.isControllingOfficerError') : ''} /> - - {this.props.translate('requestorStep.financialRegulations')} - {this.props.translate('requestorStep.onFidoConditions')} Date: Tue, 21 Sep 2021 11:38:42 -0600 Subject: [PATCH 2/5] refactor textlink --- src/components/TextLink.js | 89 ++++++++++++++----- .../ReimbursementAccount/RequestorStep.js | 4 +- 2 files changed, 68 insertions(+), 25 deletions(-) diff --git a/src/components/TextLink.js b/src/components/TextLink.js index 4403c55715c2..20bc99a17058 100644 --- a/src/components/TextLink.js +++ b/src/components/TextLink.js @@ -29,29 +29,72 @@ const defaultProps = { onPress: undefined, }; -const TextLink = (props) => { - const additionalStyles = _.isArray(props.style) ? props.style : [props.style]; - return ( - { - e.preventDefault(); - if (props.onPress) { - props.onPress(); - return; - } - - Linking.openURL(props.href); - }} - accessibilityRole="link" - href={props.href} - > - {({hovered, pressed}) => ( - - {props.children} - - )} - - ); +class TextLink extends React.Component { + constructor(props) { + super(props); + + this.state = { + linkHovered: false, + }; + + this.additionalStyles = _.isArray(this.props.style) ? this.props.style : [this.props.style]; + } + + render() { + return ( + typeof this.props.children === 'string' ? + <> + {this.props.children.split(' ').map((word, i) => ( + this.setState({linkHovered: true})} + onHoverOut={() => this.setState({linkHovered: false})} + onPressIn={() => this.setState({linkHovered: true})} + onPressOut={() => this.setState({linkHovered: false})} + onPress={(e) => { + e.preventDefault(); + if (this.props.onPress) { + this.props.onPress(); + return; + } + + Linking.openURL(this.props.href); + }} + accessibilityRole="link" + href={this.props.href} + > + {({hovered, pressed}) => { + return ( + + {`${word}${i === this.props.children.split(' ').length - 1 ? '' : ' '}`} + + ) + }} + + ))} + + : + { + e.preventDefault(); + if (this.props.onPress) { + this.props.onPress(); + return; + } + + Linking.openURL(this.props.href); + }} + accessibilityRole="link" + href={this.props.href} + > + {({hovered, pressed}) => ( + + {this.props.children} + + )} + + ); + } }; TextLink.defaultProps = defaultProps; diff --git a/src/pages/ReimbursementAccount/RequestorStep.js b/src/pages/ReimbursementAccount/RequestorStep.js index cf814515c99c..72ee05cc209b 100644 --- a/src/pages/ReimbursementAccount/RequestorStep.js +++ b/src/pages/ReimbursementAccount/RequestorStep.js @@ -213,14 +213,14 @@ class RequestorStep extends React.Component { > {`${this.props.translate('requestorStep.onFidoFacialScan')}`} - {', '} + {', '} {`${this.props.translate('common.privacyPolicy')}`} - {` ${this.props.translate('common.and')} `} + {` ${this.props.translate('common.and')} `} Date: Wed, 22 Sep 2021 09:28:07 -0600 Subject: [PATCH 3/5] revert changes to TextLink --- src/components/TextLink.js | 91 ++++++++++---------------------------- 1 file changed, 24 insertions(+), 67 deletions(-) diff --git a/src/components/TextLink.js b/src/components/TextLink.js index 20bc99a17058..6e03dcf81008 100644 --- a/src/components/TextLink.js +++ b/src/components/TextLink.js @@ -29,75 +29,32 @@ const defaultProps = { onPress: undefined, }; -class TextLink extends React.Component { - constructor(props) { - super(props); - - this.state = { - linkHovered: false, - }; - - this.additionalStyles = _.isArray(this.props.style) ? this.props.style : [this.props.style]; - } - - render() { - return ( - typeof this.props.children === 'string' ? - <> - {this.props.children.split(' ').map((word, i) => ( - this.setState({linkHovered: true})} - onHoverOut={() => this.setState({linkHovered: false})} - onPressIn={() => this.setState({linkHovered: true})} - onPressOut={() => this.setState({linkHovered: false})} - onPress={(e) => { - e.preventDefault(); - if (this.props.onPress) { - this.props.onPress(); - return; - } - - Linking.openURL(this.props.href); - }} - accessibilityRole="link" - href={this.props.href} - > - {({hovered, pressed}) => { - return ( - - {`${word}${i === this.props.children.split(' ').length - 1 ? '' : ' '}`} - - ) - }} - - ))} - - : - { - e.preventDefault(); - if (this.props.onPress) { - this.props.onPress(); - return; - } - - Linking.openURL(this.props.href); - }} - accessibilityRole="link" - href={this.props.href} - > - {({hovered, pressed}) => ( - - {this.props.children} - - )} - - ); - } +const TextLink = (props) => { + const additionalStyles = _.isArray(props.style) ? props.style : [props.style]; + return ( + { + e.preventDefault(); + if (props.onPress) { + props.onPress(); + return; + } + + Linking.openURL(props.href); + }} + accessibilityRole="link" + href={props.href} + > + {({hovered, pressed}) => ( + + {props.children} + + )} + + ); }; TextLink.defaultProps = defaultProps; TextLink.propTypes = propTypes; TextLink.displayName = 'TextLink'; -export default TextLink; +export default TextLink; \ No newline at end of file From 472e8ac092d047f62de3f0de6e9c48e3c6a9f6d7 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Wed, 22 Sep 2021 09:29:06 -0600 Subject: [PATCH 4/5] change TextLink to Text --- .../ReimbursementAccount/RequestorStep.js | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/pages/ReimbursementAccount/RequestorStep.js b/src/pages/ReimbursementAccount/RequestorStep.js index 72ee05cc209b..a74164d62510 100644 --- a/src/pages/ReimbursementAccount/RequestorStep.js +++ b/src/pages/ReimbursementAccount/RequestorStep.js @@ -1,6 +1,6 @@ import React from 'react'; import lodashGet from 'lodash/get'; -import {View} from 'react-native'; +import {View, Linking} from 'react-native'; import {withOnyx} from 'react-native-onyx'; import styles from '../../styles/styles'; import withLocalize, {withLocalizePropTypes} from '../../components/withLocalize'; @@ -207,26 +207,29 @@ class RequestorStep extends React.Component { /> {this.props.translate('requestorStep.onFidoConditions')} - Linking.openURL('https://onfido.com/facial-scan-policy-and-release/')} + style={[styles.textMicro, styles.link]} + accessibilityRole='link' > {`${this.props.translate('requestorStep.onFidoFacialScan')}`} - - {', '} - + {', '} + Linking.openURL('https://onfido.com/privacy/')} + style={[styles.textMicro, styles.link]} + accessibilityRole='link' > {`${this.props.translate('common.privacyPolicy')}`} - - {` ${this.props.translate('common.and')} `} - + {` ${this.props.translate('common.and')} `} + Linking.openURL('https://onfido.com/terms-of-service/')} + style={[styles.textMicro, styles.link]} + accessibilityRole='link' > {`${this.props.translate('common.termsOfService')}`} - + )} From 20d45b49a14fd57e7dc80c2db1adf37d0bac19d4 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Wed, 22 Sep 2021 09:41:09 -0600 Subject: [PATCH 5/5] fix style ; --- src/components/TextLink.js | 2 +- src/pages/ReimbursementAccount/RequestorStep.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/TextLink.js b/src/components/TextLink.js index 6e03dcf81008..4403c55715c2 100644 --- a/src/components/TextLink.js +++ b/src/components/TextLink.js @@ -57,4 +57,4 @@ const TextLink = (props) => { TextLink.defaultProps = defaultProps; TextLink.propTypes = propTypes; TextLink.displayName = 'TextLink'; -export default TextLink; \ No newline at end of file +export default TextLink; diff --git a/src/pages/ReimbursementAccount/RequestorStep.js b/src/pages/ReimbursementAccount/RequestorStep.js index a74164d62510..60d8ab10e568 100644 --- a/src/pages/ReimbursementAccount/RequestorStep.js +++ b/src/pages/ReimbursementAccount/RequestorStep.js @@ -210,7 +210,7 @@ class RequestorStep extends React.Component { Linking.openURL('https://onfido.com/facial-scan-policy-and-release/')} style={[styles.textMicro, styles.link]} - accessibilityRole='link' + accessibilityRole="link" > {`${this.props.translate('requestorStep.onFidoFacialScan')}`} @@ -218,7 +218,7 @@ class RequestorStep extends React.Component { Linking.openURL('https://onfido.com/privacy/')} style={[styles.textMicro, styles.link]} - accessibilityRole='link' + accessibilityRole="link" > {`${this.props.translate('common.privacyPolicy')}`} @@ -226,7 +226,7 @@ class RequestorStep extends React.Component { Linking.openURL('https://onfido.com/terms-of-service/')} style={[styles.textMicro, styles.link]} - accessibilityRole='link' + accessibilityRole="link" > {`${this.props.translate('common.termsOfService')}`}