-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds multichain support in BuySell view
- Loading branch information
1 parent
df243f7
commit b099298
Showing
13 changed files
with
173 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 0 additions & 50 deletions
50
packages/desktop/views/dashboard/buy-sell/components/TokenTile.svelte
This file was deleted.
Oops, something went wrong.
41 changes: 41 additions & 0 deletions
41
packages/desktop/views/dashboard/buy-sell/components/TransakCryptoCurrencyAvatar.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<script lang="ts"> | ||
import { TransakCryptoCurrency } from '@auxiliary/transak' | ||
import { Avatar } from '@bloomwalletio/ui' | ||
import { CoinGeckoCoinImage } from '@core/market/interfaces' | ||
import { NetworkBadge } from '@ui/badges' | ||
export let cryptoCurrency: TransakCryptoCurrency | ||
export let size: 'xxs' | 'xs' | 'sm' | 'base' | 'md' | 'lg' = 'md' | ||
export let hideNetworkBadge: boolean = false | ||
const IMAGE_SIZES: Record<typeof size, keyof CoinGeckoCoinImage> = { | ||
xxs: 'thumb', | ||
xs: 'thumb', | ||
sm: 'thumb', | ||
base: 'small', | ||
md: 'small', | ||
lg: 'small', | ||
} | ||
let imageLoadError = false | ||
$: image = cryptoCurrency?.image[IMAGE_SIZES[size]] | ||
</script> | ||
|
||
<div class="avatar"> | ||
<Avatar {size} backgroundColor="brand/10"> | ||
{#if image && !imageLoadError} | ||
<img | ||
src={image} | ||
alt={cryptoCurrency.name} | ||
class="w-full h-full object-cover" | ||
on:error={() => (imageLoadError = true)} | ||
/> | ||
{/if} | ||
</Avatar> | ||
{#if (size === 'base' || size === 'md' || size === 'lg') && !hideNetworkBadge} | ||
<span class="relative flex justify-center items-center bottom-0 right-0"> | ||
<NetworkBadge size="xs" networkId={cryptoCurrency.networkName} /> | ||
</span> | ||
{/if} | ||
</div> |
24 changes: 24 additions & 0 deletions
24
packages/desktop/views/dashboard/buy-sell/components/TransakCryptoCurrencyTile.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<script lang="ts"> | ||
import { Tile, Text, Pill } from '@bloomwalletio/ui' | ||
import { TransakCryptoCurrency } from '@auxiliary/transak/stores' | ||
import TransakCryptoCurrencyAvatar from './TransakCryptoCurrencyAvatar.svelte' | ||
export let cryptoCurrency: TransakCryptoCurrency | ||
export let onClick: (() => unknown) | undefined = undefined | ||
export let selected = false | ||
</script> | ||
|
||
<Tile {onClick} {selected} surface={1} width="full"> | ||
<div class="w-full flex items-center gap-2"> | ||
<TransakCryptoCurrencyAvatar {cryptoCurrency} hideNetworkBadge /> | ||
<div class="flex w-full justify-between items-center"> | ||
<div class="flex flex-col"> | ||
<Text>{cryptoCurrency.symbol}</Text> | ||
<Text fontWeight="medium">{cryptoCurrency.name}</Text> | ||
</div> | ||
<Pill color="brand" compact> | ||
<Text type="xs" textColor="brand" transform="uppercase">{cryptoCurrency.networkName}</Text> | ||
</Pill> | ||
</div> | ||
</div> | ||
</Tile> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.