Skip to content

Commit

Permalink
Merge branch 'develop' into refactor/remove-unusued-components
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkNerdi authored Sep 7, 2023
2 parents e658481 + 946ef8c commit a74ff7a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<script lang="ts">
import { localize, parseCurrency } from '@core/i18n'
import { activeProfile } from '@core/profile/stores'
import {
ITokenWithBalance,
TokenStandard,
convertToRawAmount,
formatTokenAmountDefault,
getUnitFromTokenMetadata,
} from '@core/token'
import { visibleSelectedAccountTokens } from '@core/token/stores'
import { getMaxDecimalsFromTokenMetadata } from '@core/token/utils'
import { AmountInput, InputContainer, SliderInput, Text, TokenLabel, UnitInput } from '@ui'
import Big from 'big.js'
Expand All @@ -17,8 +15,7 @@
export let disabled = false
export let isFocused = false
export let votingPower: number = 0
export let token: ITokenWithBalance | undefined =
$visibleSelectedAccountTokens?.[$activeProfile?.network?.id]?.baseCoin
export let token: ITokenWithBalance
export let rawAmount: string | undefined = undefined
export let unit: string | undefined = undefined
export let amount: string | undefined =
Expand All @@ -30,8 +27,8 @@
let error: string
$: isFocused && (error = '')
$: allowedDecimals = getMaxDecimalsFromTokenMetadata(token?.metadata, unit)
$: availableBalance = token?.balance?.available + votingPower
$: allowedDecimals = getMaxDecimalsFromTokenMetadata(token.metadata, unit)
$: availableBalance = (token.balance.available ?? 0) + votingPower
$: bigAmount = convertToRawAmount(amount, token?.metadata, unit)
$: max = parseCurrency(formatTokenAmountDefault(availableBalance, token?.metadata, unit, false))
$: rawAmount = bigAmount?.toString()
Expand Down
5 changes: 3 additions & 2 deletions packages/shared/src/components/labels/TokenLabel.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<script lang="ts">
import { IToken } from '@core/token'
import { FontWeight, Text, TokenIcon } from '@ui'
import { FontWeight, Text } from '@ui'
import TokenAvatar from '@ui/avatars/TokenAvatar.svelte'
export let token: IToken
</script>

{#if token}
<div class="flex flex-row items-center p-2 space-x-2 text-left bg-gray-100 dark:bg-gray-700 rounded-md">
<TokenIcon small persistedToken={token} networkId={token.networkId} />
<TokenAvatar size="xs" {token} />
<div class="w-full relative" style="max-width: 75px;">
<Text
color="gray-600"
Expand Down

0 comments on commit a74ff7a

Please sign in to comment.