Skip to content

Commit

Permalink
fix: select asset animation
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarkhanzadian committed Dec 23, 2024
1 parent 4fad817 commit fda7be0
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 50 deletions.
28 changes: 12 additions & 16 deletions apps/mobile/src/features/receive/receive-sheets/select-asset.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { ScrollView } from 'react-native-gesture-handler';

import { FullHeightSheetHeader } from '@/components/full-height-sheet/full-height-sheet-header';
import { FullHeightSheetLayout } from '@/components/full-height-sheet/full-height-sheet.layout';
import { HeaderBackButton } from '@/components/headers/components/header-back-button';
Expand Down Expand Up @@ -71,20 +69,18 @@ export function SelectAsset() {
/>
}
>
<ScrollView>
{assets.map(asset => (
<ReceiveAssetItem
key={asset.address}
address={truncateMiddle(asset.address)}
addressType={asset.addressType}
assetName={asset.assetName}
assetSymbol={asset.assetSymbol}
icon={<TokenIcon ticker={asset.assetSymbol} />}
onCopy={() => onCopyAddress(asset.address)}
onPress={() => onSelectAccount(asset)}
/>
))}
</ScrollView>
{assets.map(asset => (
<ReceiveAssetItem
key={asset.address}
address={truncateMiddle(asset.address)}
addressType={asset.addressType}
assetName={asset.assetName}
assetSymbol={asset.assetSymbol}
icon={<TokenIcon ticker={asset.assetSymbol} />}
onCopy={() => onCopyAddress(asset.address)}
onPress={() => onSelectAccount(asset)}
/>
))}
</FullHeightSheetLayout>
</>
);
Expand Down
64 changes: 30 additions & 34 deletions apps/mobile/src/features/send/send-sheets/select-asset-sheet.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { ScrollView } from 'react-native-gesture-handler';

import { FullHeightSheetHeader } from '@/components/full-height-sheet/full-height-sheet-header';
import { FullHeightSheetLayout } from '@/components/full-height-sheet/full-height-sheet.layout';
import { BitcoinBalanceByAccount } from '@/features/balances/bitcoin/bitcoin-balance';
Expand Down Expand Up @@ -42,38 +40,36 @@ export function SelectAssetSheet() {
/>
}
>
<ScrollView>
<BitcoinPayerLoader fingerprint={account.fingerprint} accountIndex={account.accountIndex}>
{({ nativeSegwitPayer }) => (
<BitcoinBalanceByAccount
accountIndex={accountIndex}
fingerprint={fingerprint}
onPress={() =>
navigation.navigate('send-form-btc', {
account,
address: nativeSegwitPayer.address,
publicKey: bytesToHex(nativeSegwitPayer.publicKey),
})
}
/>
)}
</BitcoinPayerLoader>
<StacksSignerLoader fingerprint={account.fingerprint} accountIndex={account.accountIndex}>
{({ stxSigner }) => (
<StacksBalanceByAccount
accountIndex={accountIndex}
fingerprint={fingerprint}
onPress={() =>
navigation.navigate('send-form-stx', {
account,
address: stxSigner.address,
publicKey: bytesToHex(stxSigner.publicKey),
})
}
/>
)}
</StacksSignerLoader>
</ScrollView>
<BitcoinPayerLoader fingerprint={account.fingerprint} accountIndex={account.accountIndex}>
{({ nativeSegwitPayer }) => (
<BitcoinBalanceByAccount
accountIndex={accountIndex}
fingerprint={fingerprint}
onPress={() =>
navigation.navigate('send-form-btc', {
account,
address: nativeSegwitPayer.address,
publicKey: bytesToHex(nativeSegwitPayer.publicKey),
})
}
/>
)}
</BitcoinPayerLoader>
<StacksSignerLoader fingerprint={account.fingerprint} accountIndex={account.accountIndex}>
{({ stxSigner }) => (
<StacksBalanceByAccount
accountIndex={accountIndex}
fingerprint={fingerprint}
onPress={() =>
navigation.navigate('send-form-stx', {
account,
address: stxSigner.address,
publicKey: bytesToHex(stxSigner.publicKey),
})
}
/>
)}
</StacksSignerLoader>
</FullHeightSheetLayout>
);
}

0 comments on commit fda7be0

Please sign in to comment.