Skip to content

Commit

Permalink
Add an image for QR code, fix some styling and translations bitshares…
Browse files Browse the repository at this point in the history
  • Loading branch information
svk31 committed Oct 11, 2017
1 parent 733e855 commit 38906a6
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 42 deletions.
2 changes: 1 addition & 1 deletion app/assets/locales/locale-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,7 @@
"qrcode":{
"label":"二维码",
"title":"私钥二维码",
"input_messate":"请输入用于加密二维码的密码,密码为空表示不加密"
"input_message":"请输入用于加密二维码的密码,密码为空表示不加密"
}
},
"init_error": {
Expand Down
2 changes: 1 addition & 1 deletion app/assets/locales/locale-en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1191,7 +1191,7 @@
"qrcode":{
"label":"qrcode",
"title":"Private key QR code",
"input_messate":"Please enter the password used to encrypt the QR code, the password is empty that does not encrypt."
"input_message":"Please enter a password used to encrypt the QR code.<br />An empty password will show an unencrypted QR code."
}
},
"init_error": {
Expand Down
Binary file added app/assets/qr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
75 changes: 38 additions & 37 deletions app/components/Modal/QrcodeModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,46 +63,48 @@ class QrcodeModal extends React.Component {
if(this.state.isShowQrcode)pos = {textAlign: "center"};
return (
<BaseModal onClose={this.onClose} id={this.props.modalId} ref="modal" overlay={true} overlayClose={false}>
<h3>
<Translate content="modal.qrcode.title"/>
</h3>
<form onSubmit={this.onPasswordEnter} noValidate>
<div className="form-group">
{this.state.isShowQrcode ?
<section style={pos}>
<QRCode size={256} value={this.state.keyString}/>
</section>
:
<section>
<label className="left-label"><Translate content="modal.qrcode.input_messate"/></label>
<input
name="password"
type="text"
onFocus={() => {
this.refs.password_input.setAttribute("type", "password");
}}
ref="password_input"
autoComplete="off"
onKeyDown={this.onKeyDown}
/>
</section>
}
<div className="text-center">
<div style={{margin: "1.5rem 0"}}>
<Translate component="h4" content="modal.qrcode.title"/>
</div>
<div style={pos}>
<div className="button-group">
{this.state.isShowQrcode == false ?
<button className="button" data-place="bottom" data-html onClick={this.onPasswordEnter}>
<Translate content="modal.ok"/>
</button>
<form className="full-width" style={{margin: "0 3.5rem"}} onSubmit={this.onPasswordEnter} noValidate>
<div className="form-group">
{this.state.isShowQrcode ?
<section style={pos}>
<QRCode size={256} value={this.state.keyString}/>
</section>
:
null
<section>
<label className="left-label"><Translate unsafe content="modal.qrcode.input_message"/></label>
<input
name="password"
type="text"
onFocus={() => {
this.refs.password_input.setAttribute("type", "password");
}}
ref="password_input"
autoComplete="off"
onKeyDown={this.onKeyDown}
/>
</section>
}
<button className="button" data-place="bottom" data-html onClick={this.onCancel}>
<Translate content="cancel"/>
</button>
</div>
</div>
</form>
<div style={pos}>
<div className="button-group">
{this.state.isShowQrcode == false ?
<button className="button" data-place="bottom" data-html onClick={this.onPasswordEnter}>
<Translate content="modal.ok"/>
</button>
:
null
}
<button className="button" data-place="bottom" data-html onClick={this.onCancel}>
<Translate content="cancel"/>
</button>
</div>
</div>
</form>
</div>
</BaseModal>
);
}
Expand All @@ -116,4 +118,3 @@ QrcodeModal.defaultProps = {
modalId: "qr_code_password_modal"
};
export default QrcodeModal;

11 changes: 8 additions & 3 deletions app/components/PrivateKeyView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,15 @@ export default class PrivateKeyView extends Component {
<label><Translate content="account.perm.private" /></label>
<div>
{this.state.wif ? <span>
{this.state.wif}
&nbsp;(<a onClick={this.onHide.bind(this)}>hide</a>,<a onClick={this.showQrCode.bind(this)}><Translate content="modal.qrcode.label" /></a>)
<p style={{fontWeight: 600}}>{this.state.wif}</p>
<div className="button-group">
<div className="button" onClick={this.onHide.bind(this)}>hide</div>
<div className="clickable" onClick={this.showQrCode.bind(this)}>
<img style={{height: 50}} src={require("assets/qr.png")} />
</div>
</div>
</span>:<span>
(<a onClick={this.onShow.bind(this)}><Translate content="account.perm.show" /></a>)
<div className="button" onClick={this.onShow.bind(this)}><Translate content="account.perm.show" /></div>
</span>}
</div>
</div>
Expand Down

0 comments on commit 38906a6

Please sign in to comment.