Skip to content

Commit

Permalink
feat(tauri/ui): price symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
mattyg committed Feb 12, 2024
1 parent 829cb76 commit fed2213
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tauri-app/src/lib/components/ChartHistogram.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
export let loading = false;
export let emptyMessage = "None found"
export let title: string | undefined = undefined;
export let priceSymbol: string | undefined = undefined;
const TIME_DELTA_24_HOURS = 60 * 60 * 24;
const TIME_DELTA_7_DAYS = TIME_DELTA_24_HOURS * 7;
Expand Down Expand Up @@ -43,7 +44,7 @@
function setOptions() {
if(chart === undefined) return;
chart.applyOptions({ ...$lightweightChartsTheme, autoSize: true, localization: { priceFormatter: (p: BarPrice) => p }});
chart.applyOptions({ ...$lightweightChartsTheme, autoSize: true, localization: { priceFormatter: (p: BarPrice) => priceSymbol ? `${p} ${priceSymbol}` : p }});
}
function setupChart() {
Expand Down
2 changes: 1 addition & 1 deletion tauri-app/src/routes/vaults/[id]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
{/if}
</Card>

<ChartHistogram title="Deposits & Withdrawals" priceUnit={vault.token.symbol} data={vaultListBalanceChangesAllChartDataSorted} loading={$vaultListBalanceChanges.isFetchingAll} emptyMessage="No deposits or withdrawals found" />
<ChartHistogram title="Deposits & Withdrawals" priceSymbol={vault.token.symbol} data={vaultListBalanceChangesAllChartDataSorted} loading={$vaultListBalanceChanges.isFetchingAll} emptyMessage="No deposits or withdrawals found" />
</div>

<div class="space-y-12">
Expand Down

0 comments on commit fed2213

Please sign in to comment.