Show confirmation ETA for proposed reimbursements
This commit is contained in:
@@ -1,20 +1,12 @@
|
|||||||
import Component from '@glimmer/component';
|
import Component from '@glimmer/component';
|
||||||
import { tracked } from '@glimmer/tracking';
|
|
||||||
import { inject as service } from '@ember/service';
|
import { inject as service } from '@ember/service';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
|
||||||
export default class ConfirmedInComponent extends Component {
|
export default class ConfirmedInComponent extends Component {
|
||||||
@service kredits;
|
@service kredits;
|
||||||
|
|
||||||
@tracked confirmedAtBlock = null;
|
|
||||||
|
|
||||||
constructor(confirmedAtBlock) {
|
|
||||||
super(...arguments);
|
|
||||||
this.confirmedAtBlock = confirmedAtBlock;
|
|
||||||
}
|
|
||||||
|
|
||||||
get confirmedInBlocks () {
|
get confirmedInBlocks () {
|
||||||
return this.confirmedAtBlock - this.kredits.currentBlock;
|
return this.args.confirmedAtBlock - this.kredits.currentBlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
get confirmedInSeconds () {
|
get confirmedInSeconds () {
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
Confirming in <strong>{{this.confirmedInBlocks}}</strong> blocks (~ {{this.confirmedInHumanTime}})
|
||||||
@@ -3,12 +3,12 @@
|
|||||||
<li data-reimbursement-id={{reimbursement.id}}
|
<li data-reimbursement-id={{reimbursement.id}}
|
||||||
class="{{item-status reimbursement}}">
|
class="{{item-status reimbursement}}">
|
||||||
<p class="meta">
|
<p class="meta">
|
||||||
<span class="title">
|
|
||||||
Expenses covered by {{reimbursement.contributor.name}}
|
|
||||||
</span>
|
|
||||||
<span class="recipient">
|
<span class="recipient">
|
||||||
<UserAvatar @contributor={{reimbursement.contributor}} />
|
<UserAvatar @contributor={{reimbursement.contributor}} />
|
||||||
</span>
|
</span>
|
||||||
|
<span class="title">
|
||||||
|
Expenses covered by {{reimbursement.contributor.name}}
|
||||||
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<p class="token-amount">
|
<p class="token-amount">
|
||||||
<span class="amount">
|
<span class="amount">
|
||||||
@@ -30,17 +30,22 @@
|
|||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
||||||
{{#if this.kredits.currentUserIsCore}}
|
<div class="meta">
|
||||||
<p>
|
<p class="confirmation-eta">
|
||||||
|
<ConfirmedIn @confirmedAtBlock={{reimbursement.confirmedAt}} />
|
||||||
|
</p>
|
||||||
|
<p class="actions">
|
||||||
<a href="{{this.ipfsGatewayUrl}}/{{reimbursement.ipfsHash}}"
|
<a href="{{this.ipfsGatewayUrl}}/{{reimbursement.ipfsHash}}"
|
||||||
class="button small" target="_blank" rel="noopener noreferrer">
|
class="button small" target="_blank" rel="noopener noreferrer">
|
||||||
Inspect IPFS data
|
Inspect IPFS data
|
||||||
</a>
|
</a>
|
||||||
|
{{#if this.kredits.currentUserIsCore}}
|
||||||
<button {{on "click" (fn this.veto reimbursement.id)}}
|
<button {{on "click" (fn this.veto reimbursement.id)}}
|
||||||
disabled={{reimbursement.vetoed}}
|
disabled={{reimbursement.vetoed}}
|
||||||
class="button small danger" type="button">veto</button>
|
class="button small danger" type="button">veto</button>
|
||||||
</p>
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
||||||
@@ -31,4 +31,24 @@ ul.reimbursement-list {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.meta {
|
||||||
|
grid-column-start: 1;
|
||||||
|
grid-column-end: 3;
|
||||||
|
margin-top: 0.6rem;
|
||||||
|
border-top: 1px solid $item-border-color;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
p {
|
||||||
|
flex: 1;
|
||||||
|
padding: 1.6rem 0 1rem 0;
|
||||||
|
|
||||||
|
&.confirmation-eta {
|
||||||
|
}
|
||||||
|
|
||||||
|
&.actions {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user