diff --git a/client/me/security-2fa-enable/index.jsx b/client/me/security-2fa-enable/index.jsx index b12721ad89be1..285995f17fefd 100644 --- a/client/me/security-2fa-enable/index.jsx +++ b/client/me/security-2fa-enable/index.jsx @@ -3,7 +3,8 @@ */ var React = require( 'react' ), debug = require( 'debug' )( 'calypso:me:security:2fa-enable' ), - QRCode = require( 'qrcode.react' ); + QRCode = require( 'qrcode.react' ), + classNames = require( 'classnames' ); /** * Internal dependencies @@ -178,22 +179,58 @@ module.exports = React.createClass( { } }, + getToggleLink: function() { + return ( + + ); + }, + renderQRCode: function() { + var qrClasses = classNames( 'security-2fa-enable__qr-code', { + 'is-placeholder': ! this.state.otpAuthUri + } ); + return ( -
-

- { this.translate( 'Scan this QR code with your mobile app:' ) } +

+

+ { + this.translate( + "Scan this QR code with your mobile app. {{toggleMethodLink}}Can't scan the barcode?{{/toggleMethodLink}}", { + components: { + toggleMethodLink: this.getToggleLink() + } + } + ) + }

- { this.state.otpAuthUri ? : null } +
+ { this.state.otpAuthUri && + + } +
); }, renderTimeCode: function() { return ( -
-

- { this.translate( 'Enter this time code into your mobile app:' ) } +

+

+ { + this.translate( + 'Enter this time code into your mobile app. {{toggleMethodLink}}Prefer to scan the barcode?{{/toggleMethodLink}}', { + components: { + toggleMethodLink: this.getToggleLink() + } + } + ) + }

{ this.state.timeCode } @@ -208,11 +245,8 @@ module.exports = React.createClass( { } return ( -

-

- { this.translate( 'First', { context: 'The first thing we want the user to do for Two-Step setup.' } ) } -

- { ( 'scan' === this.state.method ) ? this.renderQRCode() : this.renderTimeCode() } +
+ { 'scan' === this.state.method ? this.renderQRCode() : this.renderTimeCode() }
); }, @@ -226,11 +260,7 @@ module.exports = React.createClass( { return (

- { - 'scan' === this.state.method - ? this.translate( 'Enter the code your app gives you after scanning:' ) - : this.translate( 'Enter the code your app gives you after entering the time code:' ) - } + { this.translate( 'Then enter the six digit code provided by the app:' ) }

); }, @@ -275,17 +305,6 @@ module.exports = React.createClass( { ) }

-

- - { 'scan' === this.state.method ? this.translate( "Can't scan the barcode?" ) : this.translate( 'Prefer to scan the barcode?' ) } - -

); }, @@ -312,15 +331,6 @@ module.exports = React.createClass( { renderInputBlock: function() { return (
- { - 'sms' !== this.state.method - ? ( -

- { this.translate( 'Next', { context: 'The next thing we want the user to do for Two-Step setup.' } ) } -

- ) - : null - } { this.renderInputHelp() } +