Skip to content

Commit

Permalink
Show amountSats as title of expense item amounts
Browse files Browse the repository at this point in the history
  • Loading branch information
raucao committed Jan 20, 2025
1 parent aad2aae commit f02e557
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/components/expense-list/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<span class="date">{{fmt-date-localized expense.date}}:</span>
<span class="title">{{expense.title}}</span>
</h4>
<div class="amount">
<div class="amount" title="{{fmt-amount-sats-title expense.amountSats}}">
{{fmt-fiat-currency expense.amount expense.currency}}
</div>
<p class="description">
Expand Down
11 changes: 11 additions & 0 deletions app/helpers/fmt-amount-sats-title.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { helper } from '@ember/component/helper';

export default helper(function fmtAmountSatsTitle(params) {
const amountSats = params[0];

if (typeof amountSats === 'number' && amountSats > 0) {
return `${amountSats} sats`;
} else {
return '';
}
});

0 comments on commit f02e557

Please sign in to comment.