Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/components/layout/LabelValue.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script>

import { createEventDispatcher } from 'svelte'
import tooltip from '@lib/tooltip'
import { formatForDisplay } from '@lib/formatters'
import { PENCIL_ICON, RULER_ICON, RULER_FILLED_ICON } from '@lib/icons'
Expand All @@ -14,12 +15,18 @@
export let hasPadding = false;
export let hasSemiPadding = false;
export let fullOpacityLabel = false;

const dispatch = createEventDispatcher();

let tooltipOptions = {
content: note,
allowHTML: true
};

function handleValueClick(event) {
if (isClickable) dispatch('click', event);
}

</script>

<style>
Expand Down Expand Up @@ -72,11 +79,11 @@

<div class='flex-row' class:padded={hasPadding} class:semipadded={hasSemiPadding} class:noPadding={noPadding}>
<div class='label' class:fullOpacity={fullOpacityLabel} class:hasNote={note != false} use:tooltip={tooltipOptions}>{label}</div>
<div class='value' on:click|stopPropagation class:clickable={isClickable} class:secondary={isSecondaryColor}>
<div class='value' on:click|stopPropagation={handleValueClick} class:clickable={isClickable} class:secondary={isSecondaryColor}>
{#if formatValue}
{formatForDisplay(value)}
{:else}
{@html value}
{/if}
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion src/components/modals/Deposit.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@

<div class="group">
<div class='group-row'>
<LabelValue label='Available' value={numberWithCommas($balances[asset])} isClickable={true} on:click={() => {amount = $balances[asset]}} />
<LabelValue label='Wallet Balance' value={numberWithCommas($balances[asset])} isClickable={true} on:click={() => {amount = $balances[asset]}} />
</div>
<div class='group-row'><LabelValue label='Total Trader UP/L' value={numberWithCommas($globalUPLs[asset])} /></div>
<LabelValue label='Deposit Cost' value={`${costBps || 0}%`} />
Expand Down
4 changes: 2 additions & 2 deletions src/components/modals/Withdraw.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
</div>

<div class="group">
<div class='group-row'><LabelValue label='Available' value={formatForDisplay($poolStakes[asset])} isClickable={true} on:click={() => {amount = $poolStakes[asset]}} /></div>
<div class='group-row'><LabelValue label='Available to Withdraw' value={formatForDisplay($poolStakes[asset])} isClickable={true} on:click={() => {amount = $poolStakes[asset]}} /></div>
<div class='group-row'><LabelValue label='Total Trader UP/L' value={numberWithCommas($globalUPLs[asset])} /></div>
<LabelValue label='Withdrawal Cost' value={`${costBps || 0}%`} />
</div>
Expand All @@ -107,4 +107,4 @@

</div>

</Modal>
</Modal>