-
Notifications
You must be signed in to change notification settings - Fork 37
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
Feature password hint #206
Open
snow-lpc
wants to merge
3
commits into
master
Choose a base branch
from
feature-password-hint
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import React from 'react'; | ||
import copy from 'app/assets/images/copy.png'; | ||
import { CopyToClipboard } from 'react-copy-to-clipboard'; | ||
import tt from 'counterpart'; | ||
import Toast from 'app/components/elements/Toast'; | ||
|
||
export default class CopyPassword extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
password: '', | ||
showToast: false, | ||
copySuccess: false, | ||
}; | ||
this.copySuccess = this.copySuccess.bind(this); | ||
this.close = this.close.bind(this); | ||
} | ||
|
||
copySuccess() { | ||
this.setState({ | ||
copySuccess: true, | ||
showToast: true, | ||
}); | ||
setTimeout(() => { | ||
this.setState({ | ||
showToast: false, | ||
}); | ||
}, 2000); | ||
} | ||
|
||
close() { | ||
if (!this.state.copySuccess) return; | ||
this.props.close(); | ||
this.setState({ | ||
copySuccess: false, | ||
}); | ||
} | ||
render() { | ||
return ( | ||
<div> | ||
{this.props.visible ? ( | ||
<div className="copy_password"> | ||
<div className="copy_password_cover" /> | ||
<div className="copy_password_modal"> | ||
<div className="title"> | ||
{tt('copy_password.back_up')} | ||
</div> | ||
<div className="content"> | ||
{tt('copy_password.back_up_tips')} | ||
</div> | ||
<div className="input_password"> | ||
{this.props.newWif} | ||
<CopyToClipboard | ||
text={this.props.newWif} | ||
onCopy={this.copySuccess} | ||
> | ||
<img src={copy} /> | ||
</CopyToClipboard> | ||
</div> | ||
<div | ||
className={`footer ${ | ||
this.state.copySuccess ? 'footer_blue' : '' | ||
}`} | ||
onClick={this.close} | ||
> | ||
{tt('copy_password.back_up_success')} | ||
</div> | ||
</div> | ||
</div> | ||
) : null} | ||
{ | ||
<Toast | ||
text={tt('copy_password.copy_success')} | ||
showToast={this.state.showToast} | ||
/> | ||
} | ||
</div> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
|
||
.copy_password { | ||
.copy_password_modal{ | ||
position: fixed; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
padding: 20px; | ||
width: 533px; | ||
height: 324px; | ||
background: #FFFFFF; | ||
border-radius: 12px; | ||
z-index: 99; | ||
.title { | ||
font-family: PingFang SC; | ||
font-style: normal; | ||
font-weight: 600; | ||
font-size: 16px; | ||
line-height: 22px; | ||
|
||
color: #252736; | ||
margin-bottom: 14px; | ||
} | ||
.content { | ||
font-family: PingFang SC; | ||
font-style: normal; | ||
font-weight: normal; | ||
font-size: 14px; | ||
line-height: 20px; | ||
color: rgba(47, 47, 47, 0.5); | ||
margin-bottom: 29px; | ||
} | ||
.input_password { | ||
position: relative; | ||
background: #FFFFFF; | ||
border: 1px solid #CACACA; | ||
box-sizing: border-box; | ||
border-radius: 4px; | ||
margin-bottom: 64px; | ||
padding: 12px; | ||
font-family: PingFang SC; | ||
font-style: normal; | ||
font-weight: normal; | ||
font-size: 12px; | ||
line-height: 17px; | ||
color: #939393; | ||
img { | ||
position: absolute; | ||
right: 11px; | ||
cursor: pointer; | ||
} | ||
} | ||
.footer { | ||
background: #F7F7F7; | ||
border-radius: 10px; | ||
font-family: PingFang SC; | ||
font-style: normal; | ||
font-weight: 500; | ||
font-size: 14px; | ||
line-height: 20px; | ||
color: rgba(47, 47, 47, 0.5); | ||
text-align: center; | ||
padding: 10px; | ||
} | ||
.footer_blue { | ||
color: #fff; | ||
background: #1720C9; | ||
cursor: pointer; | ||
} | ||
} | ||
.copy_password_cover { | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
background-color: rgba(0,0,0,0.5); | ||
z-index: 9; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react'; | ||
|
||
export default class Toast extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
} | ||
|
||
render() { | ||
return ( | ||
<div className={`copy_toast ${this.props.showToast ? 'show' : ''}`}> | ||
{this.props.text} | ||
</div> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
|
||
.copy_toast { | ||
visibility: hidden; | ||
max-width: 160px; | ||
height: 50px; | ||
/*margin-left: -125px;*/ | ||
margin: auto; | ||
background-color: #333; | ||
color: #fff; | ||
text-align: center; | ||
border-radius: 4px; | ||
line-height: 50px; | ||
position: fixed; | ||
z-index: 1; | ||
left: 0;right:0; | ||
bottom: 30px; | ||
font-size: 16px; | ||
white-space: nowrap; | ||
z-index: 100; | ||
} | ||
|
||
.copy_toast.show { | ||
visibility: visible; | ||
-webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s; | ||
animation: fadein 0.5s, fadeout 0.5s 4.5s; | ||
} | ||
|
||
@-webkit-keyframes fadein { | ||
from {bottom: 0; opacity: 0;} | ||
to {bottom: 30px; opacity: 1;} | ||
} | ||
|
||
@keyframes fadein { | ||
from {bottom: 0; opacity: 0;} | ||
to {bottom: 30px; opacity: 1;} | ||
} | ||
|
||
@-webkit-keyframes expand { | ||
from {min-width: 50px} | ||
to {min-width: 350px} | ||
} | ||
|
||
@keyframes expand { | ||
from {min-width: 50px} | ||
to {min-width: 350px} | ||
} | ||
@-webkit-keyframes stay { | ||
from {min-width: 350px} | ||
to {min-width: 350px} | ||
} | ||
|
||
@keyframes stay { | ||
from {min-width: 350px} | ||
to {min-width: 350px} | ||
} | ||
@-webkit-keyframes shrink { | ||
from {min-width: 350px;} | ||
to {min-width: 50px;} | ||
} | ||
|
||
@keyframes shrink { | ||
from {min-width: 350px;} | ||
to {min-width: 50px;} | ||
} | ||
|
||
@-webkit-keyframes fadeout { | ||
from {bottom: 30px; opacity: 1;} | ||
to {bottom: 60px; opacity: 0;} | ||
} | ||
|
||
@keyframes fadeout { | ||
from {bottom: 30px; opacity: 1;} | ||
to {bottom: 60px; opacity: 0;} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove useless console.log info.