Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
Merge pull request #410 from LiskHQ/407-transactions-pending-state
Browse files Browse the repository at this point in the history
Add pending status spinner to transactions list - Closes #407
  • Loading branch information
reyraa authored Jun 14, 2017
2 parents ab55b37 + d792c05 commit 130206f
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 43 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ app/report.html
app/*.map
*.sw[pon]
app/app.js
.vscode
.idea
38 changes: 0 additions & 38 deletions src/components/delegates/delegates.less
Original file line number Diff line number Diff line change
Expand Up @@ -84,46 +84,8 @@ delegates {
}

.spinner {
width: 40px;
text-align: center;
margin-left: -10px;
}

.spinner > div {
width: 8px;
height: 8px;
background-color: #aaa;

border-radius: 100%;
display: inline-block;
-webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
animation: sk-bouncedelay 1.4s infinite ease-in-out both;
}

.spinner .bounce1 {
-webkit-animation-delay: -0.32s;
animation-delay: -0.32s;
}

.spinner .bounce2 {
-webkit-animation-delay: -0.16s;
animation-delay: -0.16s;
}

@-webkit-keyframes sk-bouncedelay {
0%, 80%, 100% { -webkit-transform: scale(0.5) }
40% { -webkit-transform: scale(1.0) }
}

@keyframes sk-bouncedelay {
0%, 80%, 100% {
-webkit-transform: scale(0.5);
transform: scale(0.5);
} 40% {
-webkit-transform: scale(1.0);
transform: scale(1.0);
}
}
}

.lsk-vote-remove-button {
Expand Down
5 changes: 1 addition & 4 deletions src/components/delegates/delegates.pug
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@ div.offline-hide
td(md-cell, colspan='6') No delegates found
tr(md-row, ng-repeat="delegate in ($ctrl.filteredDelegates = ($ctrl.delegates | filter : {username: search} )) | limitTo : $ctrl.delegatesDisplayedCount", ng-class='{"downvote": delegate.status.voted && !delegate.status.selected, "upvote": !delegate.status.voted && delegate.status.selected, "pending": delegate.status.pending, "voted": delegate.status.voted && delegate.status.selected}')
td(md-cell)
.spinner(ng-show='delegate.status.pending')
.bounce1
.bounce2
.bounce3
spinner(ng-show='delegate.status.pending')
md-checkbox.md-primary(ng-show='!delegate.status.pending', ng-model='delegate.status.selected', ng-change='$ctrl.selectionChange(delegate)', aria-label='delegate selected for voting')
td(md-cell, ng-bind='delegate.rank')
td(md-cell, ng-bind='delegate.username')
Expand Down
11 changes: 11 additions & 0 deletions src/components/spinner/spinner.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import './spinner.less';

/**
* This component can be used to show pending state of a transaction
*
* @module app
* @submodule spinner
*/
app.component('spinner', {
template: require('./spinner.pug')(),
});
40 changes: 40 additions & 0 deletions src/components/spinner/spinner.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
.spinner {
width: 40px;
text-align: center;
display: inline-block;
& > div {
width: 8px;
height: 8px;
background-color: #aaa;

border-radius: 100%;
display: inline-block;
-webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
animation: sk-bouncedelay 1.4s infinite ease-in-out both;
}

.bounce1 {
-webkit-animation-delay: -0.32s;
animation-delay: -0.32s;
}
.bounce2 {
-webkit-animation-delay: -0.16s;
animation-delay: -0.16s;
}
}

// Spinner animations
@-webkit-keyframes sk-bouncedelay {
0%, 80%, 100% { -webkit-transform: scale(0.5) }
40% { -webkit-transform: scale(1.0) }
}

@keyframes sk-bouncedelay {
0%, 80%, 100% {
-webkit-transform: scale(0.5);
transform: scale(0.5);
} 40% {
-webkit-transform: scale(1.0);
transform: scale(1.0);
}
}
4 changes: 4 additions & 0 deletions src/components/spinner/spinner.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.spinner
.bounce1
.bounce2
.bounce3
2 changes: 1 addition & 1 deletion src/components/transactions/transactions.pug
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ md-card.offline-hide
tr(md-row, ng-repeat="transaction in $ctrl.transactions track by transaction.id | orderBy:'-timestamp'")
td(md-cell)
timestamp(data='transaction.timestamp', ng-show='transaction.confirmations')
span(ng-bind='transaction.confirmations ? "" : "PENDING"')
spinner(ng-show='!transaction.confirmations')
td(md-cell)
span(ng-bind='transaction.id')
md-tooltip(md-direction='top', md-delay='350') {{ transaction.confirmations }} confirmations
Expand Down
1 change: 1 addition & 0 deletions src/liskNano.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import './components/login/newAccount';
import './components/lsk/lsk';
import './components/main/main';
import './components/main/secondPass';
import './components/spinner/spinner';
import './components/openDialog/openDialog';
import './components/passphrase/passphrase';
import './components/passphrase/passphraseService';
Expand Down

0 comments on commit 130206f

Please sign in to comment.