-
Notifications
You must be signed in to change notification settings - Fork 1.7k
abbreviated enode, CopyToClipboard
component
#3131
Conversation
import Theme from '../Theme'; | ||
const { textColor, disabledTextColor } = Theme.flatButton; | ||
|
||
export default class CopyToClipboard extends Component { |
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.
General comment - would prefer the filename as "copyToClipboard.js" since that is actually the standard through the codebase. (Some differently named files have slipped-in along the way, obviously none of us was paying attention).
); | ||
} | ||
|
||
onCopy = () => { |
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.
Really nice start. Only thing missing (maybe log an issue) is that in some places we have the SnackBar popping up, the component should do the same on copy. Apart from that, it will clean things up nicely.
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.
Oh yeah, I forgot that.
@@ -68,9 +69,14 @@ class Status extends Component { | |||
return null; | |||
} | |||
|
|||
const [protocol, rest] = enode.split('://'); | |||
const [id, host] = rest.split('@'); | |||
const abbreviated = `${protocol}://${id.slice(0, 3)}…${id.slice(-3)}@${host}`; |
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.
Definately better. Looking at it now, we should probably just move it completely to the status page and not have it here at all - as you suggested earlier, it is not really user-facing.
Minor comments. |
filename changed according to @jacogr 's suggestion. moving the enode to the status page can probably happen in a second PR. @derhuerst you can log an issue for the "SnackBar popping up". |
Agreed with the 2 issues, didn't mean in this PR. Move enode to status page - https://github.com/ethcore/parity/issues/3151 |
done because of https://github.com/ethcore/parity/pull/3108#issuecomment-258114170
Fixes #3124 partially. Noticed that it doesn't make sense to do all the refactoring in this PR, so will open another one that replaces homegrown code by
CopyToClipboard
everywhere.