Skip to content

Add RTL support #63

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion components/ConfirmationCodeInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -36,6 +37,7 @@ export default class ConfirmationCodeInput extends Component {
space: 8,
compareWithCode: '',
ignoreCase: false

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need comma

rtl: false,
};

constructor(props) {
Expand Down Expand Up @@ -239,6 +241,7 @@ export default class ConfirmationCodeInput extends Component {
className,
size,
activeColor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need comma

rtl,
} = this.props;

const initialCodeInputStyle = {
Expand All @@ -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(
<TextInput
key={id}
Expand Down