diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..a8fab68 Binary files /dev/null and b/.DS_Store differ diff --git a/index.d.ts b/index.d.ts index f020784..9c370fa 100644 --- a/index.d.ts +++ b/index.d.ts @@ -28,4 +28,5 @@ export function QRCode({ logoSize?: number; ecl?: "L" | "M" | "Q" | "H"; svg?: any; + isRTL?: boolean; }); diff --git a/lib/QRCode.js b/lib/QRCode.js index 4f4e1ef..73c4bf1 100644 --- a/lib/QRCode.js +++ b/lib/QRCode.js @@ -62,6 +62,7 @@ export default class QRCode extends PureComponent { logoSize: PropTypes.number, ecl: PropTypes.oneOf(["L", "M", "Q", "H"]), svg: PropTypes.any, + isRTL: PropTypes.bool, }; static defaultProps = { @@ -76,6 +77,7 @@ export default class QRCode extends PureComponent { innerEyeStyle: "square", logoSize: 100, ecl: "H", + isRTL: false, }; //-----------------------Methods----------------------- @@ -396,7 +398,11 @@ export default class QRCode extends PureComponent { innerEyeStyle={this.props.innerEyeStyle} size={eyeSize} color={this.props.color} - x={eyeCoord[0]} + x={ + this.props.isRTL + ? this.props.size - eyeCoord[0] - eyeSize + : eyeCoord[0] + } y={eyeCoord[1]} ratio={this.ratio} />