From 8dd75053be26b86f300599384d39ef8412ab6aae Mon Sep 17 00:00:00 2001 From: Salar Abbasi Date: Sat, 24 Aug 2019 14:58:06 +0430 Subject: [PATCH] Add RTL support --- components/ConfirmationCodeInput.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/ConfirmationCodeInput.js b/components/ConfirmationCodeInput.js index 239c85a..469f66e 100644 --- a/components/ConfirmationCodeInput.js +++ b/components/ConfirmationCodeInput.js @@ -22,6 +22,7 @@ export default class ConfirmationCodeInput extends Component { codeInputStyle: TextInput.propTypes.style, containerStyle: viewPropTypes.style, onFulfill: PropTypes.func, + rtl: PropTypes.bool, }; static defaultProps = { @@ -36,6 +37,7 @@ export default class ConfirmationCodeInput extends Component { space: 8, compareWithCode: '', ignoreCase: false + rtl: false, }; constructor(props) { @@ -239,6 +241,7 @@ export default class ConfirmationCodeInput extends Component { className, size, activeColor + rtl, } = this.props; const initialCodeInputStyle = { @@ -248,7 +251,7 @@ export default class ConfirmationCodeInput extends Component { let codeInputs = []; for (let i = 0; i < codeLength; i++) { - const id = i; + const id = rtl ? codeLength - i - 1 : i; codeInputs.push(