Skip to content
This repository has been archived by the owner on Oct 21, 2020. It is now read-only.

Commit

Permalink
feat(account-card): add notification when account address copied
Browse files Browse the repository at this point in the history
Closes #9.
  • Loading branch information
devinus committed Mar 20, 2018
1 parent f6881e8 commit ae90ba2
Show file tree
Hide file tree
Showing 9 changed files with 89 additions and 64 deletions.
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
nodejs 8.10.0
nodejs 9.8.0
python 2.7.14
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:8.10.0
FROM node:9.8.0
LABEL maintainer="Nano <desktop@nano.org>"

RUN curl -fsSL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
Expand Down
14 changes: 14 additions & 0 deletions app/components/account-card/component.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
import Component from '@ember/component';

import { service } from 'ember-decorators/service';
import { action } from 'ember-decorators/object';

export default Component.extend({
@service intl: null,
@service flashMessages: null,

account: null,

@action
copyAddress(address) {
const intl = this.get('intl');
const flashMessages = this.get('flashMessages');
flashMessages.success(intl.t('addressCopied', { address }));
return true;
},
});
26 changes: 18 additions & 8 deletions app/components/account-card/styles.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
a {
button {
border: 0;
outline: none;
background-color: transparent;

&.active .account-card-content {
transform: scale(1.10) !important;
Expand Down Expand Up @@ -54,18 +56,26 @@ a {
font-size: 14px;
}

.copy-btn {
.address {
cursor: pointer;
width: 100%;
overflow-wrap: break-word;
background-color: $dark-purple;
border: 0;
color: white;
display: block;
text-align: center;
}

.copy-btn {
border: 0;
outline: none;
cursor: pointer;
background-color: $dark-purple;
font-size: 0.7rem;
height: 60px;
color: white;
margin: 0;
outline: none;
overflow-wrap: break-word;
padding: 10px;
text-align: center;
height: 60px;
width: 100%;
overflow-wrap: break-word;
}
}
15 changes: 9 additions & 6 deletions app/components/account-card/template.hbs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{#link-to 'wallets.overview.accounts.history' account class="text-decoration-none"}}
{{#link-to 'wallets.overview.accounts.history' account tagName='button' disabled=(not account.id)}}
<div class="account-card-content">
{{#if account.id}}
{{#liquid-if hideHistory class="hide-qr"}}
{{#if hideHistory}}
{{qr-code text=account.id width=170 height=170}}
{{/liquid-if}}
{{/if}}
<p class="balance">
<sup>
<img src="images/nano-icon.svg" alt="{{t 'NANO'}}">
Expand All @@ -12,9 +12,12 @@
<br>
<sub>+{{format-amount account.pending}}</sub>
</p>
{{#copy-button clipboardText=account.id}}
{{account-address value=account.id}}
{{/copy-button}}
<div role="button" class="address" {{action (optional) bubbles=false}}>
{{bs-tooltip fade=true delayShow=1000 placement='bottom' title=(t 'copyValue' value=(concat (slice 0 9 account.id)))}}
{{#copy-button tagName='div' buttonType=null clipboardText=account.id success=(action 'copyAddress' (concat (slice 0 9 account.id) '...' (slice 59 64 account.id)))}}
{{account-address value=account.id}}
{{/copy-button}}
</div>
{{else}}
{{fa-icon "spinner" size=5 spin=true ariaLabel=(t 'loading')}}
{{/if}}
Expand Down
4 changes: 0 additions & 4 deletions config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ module.exports = (environment) => {
enabled: environment === 'production',
},

flashMessageDefaults: {
preventDuplicates: true,
},

assets: {
node: {
win32: {
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
},
"nodemonConfig": {
"events": {
"start": "notify -t 'ember-electron' -m 'Starting Electron app...' -i ember-electron/icons/notification.png",
"restart": "notify -t 'ember-electron' -m 'Restarting Electron app...' -i ember-electron/icons/notification.png",
"crash": "notify -t 'ember-electron' -m 'Electron app has crashed!' -s Funk -i ember-electron/icons/notification.png"
"start": "yarn notify -t 'ember-electron' -m 'Starting Electron app...' -i ember-electron/icons/notification.png",
"restart": "yarn notify -t 'ember-electron' -m 'Restarting Electron app...' -i ember-electron/icons/notification.png",
"crash": "yarn notify -t 'ember-electron' -m 'Electron app has crashed!' -s Funk -i ember-electron/icons/notification.png"
}
},
"build": {
Expand Down Expand Up @@ -112,7 +112,7 @@
"ember-changeset": "^1.5.0-beta.0",
"ember-changeset-validations": "^1.2.11",
"ember-chrome-devtools": "^0.2.0",
"ember-cli": "^3.0.0",
"ember-cli": "^3.0.1",
"ember-cli-app-version": "^3.1.3",
"ember-cli-babel": "^6.12.0",
"ember-cli-build-notifications": "^0.2.0",
Expand Down Expand Up @@ -174,7 +174,7 @@
"ember-source": "^3.0.0",
"ember-truth-helpers": "^2.0.0",
"ember-web-app": "^2.3.0",
"ember-window-mock": "^0.3.0",
"ember-window-mock": "^0.4.0",
"eslint": "^4.19.0",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-plugin-babel": "^4.1.2",
Expand Down
8 changes: 5 additions & 3 deletions translations/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ verifying: 'Verifying {asset}...'
extracting: 'Extracting {asset}...'
starting: 'Starting node'
currency: '{amount}'
copyValue: 'Copy {value}...'
addressCopied: 'Address copied: {address}'
status:
state: 'Status'
online: 'Online'
Expand Down Expand Up @@ -94,10 +96,10 @@ wallets:
passwordsDontMatch: "Passwords don't match!"
logout:
title: 'Confirm Logout'
lead: 'Are you absolutely sure you wish to logout?'
lead: 'Are you sure you wish to logout?'
warning: >
<strong>Warning</strong>: Logging out will forget your wallet and you will be unable to
retreive it again if you don't have your wallet seed!
<strong>Warning</strong>: If you logout and later don't remember your password you will
have to reimport your wallet using your seed!
setup:
lead: "Let's get your wallet set up."
instructions: >
Expand Down
72 changes: 36 additions & 36 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@
ember-compatibility-helpers "^0.1.2"

"@ember/test-helpers@^0.7.16":
version "0.7.18"
resolved "https://registry.yarnpkg.com/@ember/test-helpers/-/test-helpers-0.7.18.tgz#a0c474c3029588ec46d2e406252fc072b7f9aa3c"
version "0.7.20"
resolved "https://registry.yarnpkg.com/@ember/test-helpers/-/test-helpers-0.7.20.tgz#488b1c8ef23626f8831e5cb750ffca86e017e6dc"
dependencies:
broccoli-funnel "^2.0.1"
ember-cli-babel "^6.10.0"
Expand Down Expand Up @@ -427,11 +427,11 @@

"@types/node@^7.0.12":
version "7.0.56"
resolved "http://registry.npmjs.org/@types/node/-/node-7.0.56.tgz#b6b659049191822be43c14610c1785d4b9cddecf"
resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.56.tgz#b6b659049191822be43c14610c1785d4b9cddecf"

"@types/node@^8.0.24", "@types/node@^8.0.53":
version "8.9.5"
resolved "http://registry.npmjs.org/@types/node/-/node-8.9.5.tgz#162b864bc70be077e6db212b322754917929e976"
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.9.5.tgz#162b864bc70be077e6db212b322754917929e976"

"@types/rollup@^0.51.0":
version "0.51.4"
Expand Down Expand Up @@ -1890,8 +1890,8 @@ better-assert@~1.0.0:
callsite "1.0.0"

big-integer@^1.6.7:
version "1.6.26"
resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.26.tgz#3af1672fa62daf2d5ecafacf6e5aa0d25e02c1c8"
version "1.6.27"
resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.27.tgz#8e56c6f8b2dd6c4fe8d32102b83d4f25868e4b3a"

bignumber.js@^6.0.0:
version "6.0.0"
Expand Down Expand Up @@ -2395,7 +2395,7 @@ broccoli-merge-trees@^3.0.0:
broccoli-plugin "^1.3.0"
merge-trees "^2.0.0"

broccoli-middleware@^1.0.0:
broccoli-middleware@^1.0.0, broccoli-middleware@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/broccoli-middleware/-/broccoli-middleware-1.2.1.tgz#a21f255f8bfe5a21c2f0fbf2417addd9d24c9436"
dependencies:
Expand Down Expand Up @@ -2803,11 +2803,11 @@ browserslist@^2.1.2, browserslist@^2.2.2:
electron-to-chromium "^1.3.30"

browserslist@^3.1.0:
version "3.1.2"
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-3.1.2.tgz#893f29399d640ed35fe06bacd7eb1d78609a47e5"
version "3.2.0"
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-3.2.0.tgz#3d4a99710c12101e4567c9aeedade49c958cb883"
dependencies:
caniuse-lite "^1.0.30000813"
electron-to-chromium "^1.3.36"
caniuse-lite "^1.0.30000815"
electron-to-chromium "^1.3.39"

bser@^2.0.0:
version "2.0.0"
Expand Down Expand Up @@ -2982,7 +2982,7 @@ caniuse-db@^1.0.30000529, caniuse-db@^1.0.30000634, caniuse-db@^1.0.30000639:
version "1.0.30000815"
resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000815.tgz#0e218fa133d0d071c886aa041b435258cc746891"

caniuse-lite@^1.0.30000792, caniuse-lite@^1.0.30000813:
caniuse-lite@^1.0.30000792, caniuse-lite@^1.0.30000815:
version "1.0.30000815"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000815.tgz#3a4258e6850362185adb11b0d754a48402d35bf6"

Expand Down Expand Up @@ -3071,7 +3071,7 @@ chalk@^0.5.1:
strip-ansi "^0.3.0"
supports-color "^0.2.0"

chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.3.1:
chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.3.1, chalk@^2.3.2:
version "2.3.2"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.2.tgz#250dc96b07491bfd601e648d66ddf5f60c7a5c65"
dependencies:
Expand Down Expand Up @@ -5229,7 +5229,7 @@ electron-squirrel-startup@^1.0.0:
dependencies:
debug "^2.2.0"

electron-to-chromium@^1.2.7, electron-to-chromium@^1.3.30, electron-to-chromium@^1.3.36:
electron-to-chromium@^1.2.7, electron-to-chromium@^1.3.30, electron-to-chromium@^1.3.39:
version "1.3.39"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.39.tgz#d7a4696409ca0995e2750156da612c221afad84d"

Expand Down Expand Up @@ -5939,9 +5939,9 @@ ember-cli@^2.16.2:
walk-sync "^0.3.0"
yam "0.0.22"

ember-cli@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/ember-cli/-/ember-cli-3.0.0.tgz#3d44be3ea88345d4d03c95453eb3527b15dbaeb2"
ember-cli@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/ember-cli/-/ember-cli-3.0.1.tgz#3e91ef8222811cd0a8d35fd2b10b2478d0594c04"
dependencies:
amd-name-resolver "1.0.0"
babel-plugin-transform-es2015-modules-amd "^6.24.0"
Expand All @@ -5956,7 +5956,7 @@ ember-cli@^3.0.0:
broccoli-funnel "^2.0.0"
broccoli-funnel-reducer "^1.0.0"
broccoli-merge-trees "^2.0.0"
broccoli-middleware "^1.0.0"
broccoli-middleware "^1.2.1"
broccoli-source "^1.1.0"
broccoli-stew "^1.2.0"
calculate-cache-key-for-tree "^1.0.0"
Expand Down Expand Up @@ -6814,9 +6814,9 @@ ember-web-app@^2.3.0:
web-app-manifest-validator "^1.0.0"
xmlbuilder "^9.0.4"

ember-window-mock@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/ember-window-mock/-/ember-window-mock-0.3.0.tgz#94c0f762e243514600b73366fd55736aa4a27643"
ember-window-mock@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/ember-window-mock/-/ember-window-mock-0.4.0.tgz#87316623dd1a1414b82b08bb018889a210be91bd"
dependencies:
broccoli-funnel "^2.0.1"
ember-cli-babel "^6.6.0"
Expand Down Expand Up @@ -8918,8 +8918,8 @@ iconv-lite@0.4.19, iconv-lite@^0.4.17, iconv-lite@^0.4.5, iconv-lite@~0.4.13:
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b"

ieee754@^1.1.4:
version "1.1.8"
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4"
version "1.1.10"
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.10.tgz#719a6f7b026831e64bdb838b0de1bb0029bbf716"

ienoopen@1.0.0:
version "1.0.0"
Expand Down Expand Up @@ -11313,7 +11313,7 @@ mz@^2.6.0:
object-assign "^4.0.1"
thenify-all "^1.0.0"

nan@^2.3.0, nan@^2.3.2, nan@^2.4.0, nan@^2.9.2:
nan@^2.10.0, nan@^2.3.0, nan@^2.3.2, nan@^2.4.0:
version "2.10.0"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f"

Expand Down Expand Up @@ -11661,7 +11661,7 @@ npmlog@^2.0.3:
are-we-there-yet "~1.1.2"
gauge "~1.2.5"

nprogress@alexlafroscia/nprogress#allow-alternate-scheduler:
"nprogress@github:alexlafroscia/nprogress#allow-alternate-scheduler":
version "0.2.0"
resolved "https://codeload.github.com/alexlafroscia/nprogress/tar.gz/af37323172b98441d02aa02447f795f5766419b0"

Expand Down Expand Up @@ -11696,8 +11696,8 @@ number-is-nan@^1.0.0:
resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d"

"nwmatcher@>= 1.3.7 < 2.0.0", nwmatcher@^1.4.3:
version "1.4.3"
resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.4.3.tgz#64348e3b3d80f035b40ac11563d278f8b72db89c"
version "1.4.4"
resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.4.4.tgz#2285631f34a95f0d0395cd900c96ed39b58f346e"

oauth-sign@~0.8.1, oauth-sign@~0.8.2:
version "0.8.2"
Expand Down Expand Up @@ -12509,12 +12509,12 @@ postcss@^5.0.10, postcss@^5.0.11, postcss@^5.0.12, postcss@^5.0.13, postcss@^5.0
supports-color "^3.2.3"

postcss@^6.0.14, postcss@^6.0.19:
version "6.0.19"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-6.0.19.tgz#76a78386f670b9d9494a655bf23ac012effd1555"
version "6.0.20"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-6.0.20.tgz#686107e743a12d5530cb68438c590d5b2bf72c3c"
dependencies:
chalk "^2.3.1"
chalk "^2.3.2"
source-map "^0.6.1"
supports-color "^5.2.0"
supports-color "^5.3.0"

prebuild-install@^2.5.1:
version "2.5.1"
Expand Down Expand Up @@ -13435,8 +13435,8 @@ rollup-plugin-commonjs@^8.0.2:
rollup-pluginutils "^2.0.1"

rollup-plugin-node-resolve@^3.0.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-3.2.0.tgz#31534952f3ab21f9473c1d092be7ed43937ea4d4"
version "3.3.0"
resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-3.3.0.tgz#c26d110a36812cbefa7ce117cadcd3439aa1c713"
dependencies:
builtin-modules "^2.0.0"
is-module "^1.0.0"
Expand Down Expand Up @@ -13758,13 +13758,13 @@ sha.js@^2.4.0, sha.js@^2.4.8, sha.js@~2.4.4:
safe-buffer "^5.0.1"

sharp@^0.20.0:
version "0.20.0"
resolved "https://registry.yarnpkg.com/sharp/-/sharp-0.20.0.tgz#2ff9f1ae11f068ce7d7591f531cad52c7821d033"
version "0.20.1"
resolved "https://registry.yarnpkg.com/sharp/-/sharp-0.20.1.tgz#13adde896bc9ec0372b0907554e0329f35a7bce6"
dependencies:
color "^3.0.0"
detect-libc "^1.0.3"
fs-copy-file-sync "^1.0.1"
nan "^2.9.2"
nan "^2.10.0"
npmlog "^4.1.2"
prebuild-install "^2.5.1"
semver "^5.5.0"
Expand Down

0 comments on commit ae90ba2

Please sign in to comment.