Skip to content

Commit 95187dc

Browse files
committed
Show asset images in the asset balances list
1 parent 0e1725c commit 95187dc

File tree

5 files changed

+38
-4
lines changed

5 files changed

+38
-4
lines changed

package-lock.json

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/mobile-app/app/(tabs)/index.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
Modal,
1414
} from "@ui-kitten/components";
1515
import { StyleSheet } from "react-native";
16+
import { Image } from "expo-image";
1617
import { setStringAsync } from "expo-clipboard";
1718
import Animated, {
1819
useAnimatedScrollHandler,
@@ -270,6 +271,11 @@ export default function Balances() {
270271
verified={
271272
getIronAsset.data?.verification.status === "verified"
272273
}
274+
image={
275+
getIronAsset.data?.verification.status === "verified"
276+
? getIronAsset.data.verification.logoURI
277+
: undefined
278+
}
273279
/>
274280

275281
{/* Custom Assets */}
@@ -292,6 +298,11 @@ export default function Balances() {
292298
: undefined,
293299
)}
294300
verified={asset?.verification.status === "verified"}
301+
image={
302+
asset?.verification.status === "verified"
303+
? asset.verification.logoURI
304+
: undefined
305+
}
295306
/>
296307
);
297308
})}
@@ -329,15 +340,19 @@ function AssetRow({
329340
name,
330341
amount,
331342
verified,
343+
image,
332344
}: {
333345
name: string;
334346
amount: string;
335347
verified: boolean;
348+
image?: string;
336349
}) {
337350
return (
338351
<Card style={styles.assetCard}>
339352
<Layout style={styles.assetCardContent}>
340-
<Layout style={styles.assetBadge} />
353+
<Layout style={styles.assetBadge}>
354+
<Image source={image} style={styles.assetBadge} />
355+
</Layout>
341356
<Layout style={styles.assetInfo}>
342357
<Text category="s1">
343358
{name} {verified ? "(Verified)" : ""}

packages/mobile-app/data/api/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export interface SerializedVerifiedAssetMetadata {
1717
updated_at: string;
1818
symbol: string;
1919
decimals?: number;
20-
logo_uri?: string;
20+
logoURI?: string;
2121
website?: string;
2222
}
2323

packages/mobile-app/data/wallet/db.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,7 +1730,7 @@ export class WalletDb {
17301730
updatedAt: new Date(),
17311731
verified: !!serializedAsset.verified_metadata,
17321732
decimals: serializedAsset.verified_metadata?.decimals ?? null,
1733-
logoURI: serializedAsset.verified_metadata?.logo_uri ?? null,
1733+
logoURI: serializedAsset.verified_metadata?.logoURI ?? null,
17341734
supply: serializedAsset.supply ?? null,
17351735
symbol: serializedAsset.verified_metadata?.symbol ?? null,
17361736
website: serializedAsset.verified_metadata?.website ?? null,
@@ -1749,7 +1749,7 @@ export class WalletDb {
17491749
updatedAt: new Date(),
17501750
verified: !!serializedAsset.verified_metadata,
17511751
decimals: serializedAsset.verified_metadata?.decimals ?? null,
1752-
logoURI: serializedAsset.verified_metadata?.logo_uri ?? null,
1752+
logoURI: serializedAsset.verified_metadata?.logoURI ?? null,
17531753
supply: serializedAsset.supply ?? null,
17541754
symbol: serializedAsset.verified_metadata?.symbol ?? null,
17551755
website: serializedAsset.verified_metadata?.website ?? null,

packages/mobile-app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"expo-crypto": "~14.0.2",
2626
"expo-document-picker": "~13.0.3",
2727
"expo-font": "~13.0.3",
28+
"expo-image": "~2.0.5",
2829
"expo-linear-gradient": "~14.0.2",
2930
"expo-linking": "~7.0.4",
3031
"expo-router": "~4.0.17",

0 commit comments

Comments
 (0)