Skip to content

Commit

Permalink
feat: updated assets page for the EVM account (#900)
Browse files Browse the repository at this point in the history
* feat: combine EVM assets panel

* feat: added native token on top

* styling: native token in EVM

* feat: added test code

* fix: hid XVM assets panel

* styling: added border line
  • Loading branch information
impelcrypto authored Aug 25, 2023
1 parent 7b005b8 commit 0294f2e
Show file tree
Hide file tree
Showing 10 changed files with 243 additions and 259 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"dependencies": {
"@astar-network/astar-sdk-core": "^0.2.5",
"@astar-network/astar-ui": "^0.0.94",
"@astar-network/astar-ui": "^0.0.104",
"@ethersproject/bignumber": "^5.5.0",
"@polkadot/api": "^10.9.1",
"@polkadot/api-contract": "^10.9.1",
Expand Down
5 changes: 5 additions & 0 deletions src/components/assets/Account.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
</div>
</div>
</div>
<div v-if="isH160">
<evm-native-token />
</div>
<div v-if="multisig" class="row--details-signatory">
<div class="column-account-name">
<img v-if="iconWallet" width="24" :src="signatoryIconWallet" alt="wallet-icon" />
Expand Down Expand Up @@ -107,6 +110,7 @@ import { useStore } from 'src/store';
import { computed, defineComponent, ref, watch, watchEffect } from 'vue';
import { useI18n } from 'vue-i18n';
import NativeAssetList from 'src/components/assets/NativeAssetList.vue';
import EvmNativeToken from 'src/components/assets/EvmNativeToken.vue';
import ModalLockdropWarning from 'src/components/assets/modals/ModalLockdropWarning.vue';
import { ETHEREUM_EXTENSION } from 'src/hooks';
import { supportWalletObj } from 'src/config/wallets';
Expand All @@ -115,6 +119,7 @@ export default defineComponent({
components: {
NativeAssetList,
ModalLockdropWarning,
EvmNativeToken,
},
props: {
ttlErc20Amount: {
Expand Down
8 changes: 3 additions & 5 deletions src/components/assets/Assets.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
<evm-asset-list :tokens="evmAssets.assets" />
</div>
<div v-else class="container--assets">
<xvm-native-asset-list v-if="isSupportXvmTransfer" :xvm-assets="xvmAssets.xvmAssets" />
<!-- Memo: hide xvm panel because AA might replace it -->
<!-- <xvm-native-asset-list v-if="isSupportXvmTransfer" :xvm-assets="xvmAssets.xvmAssets" /> -->
<xcm-native-asset-list v-if="isEnableXcm" :xcm-assets="xcmAssets.assets" />
</div>
</div>
Expand All @@ -46,7 +47,6 @@ import Account from 'src/components/assets/Account.vue';
import DynamicLinks from 'src/components/assets/DynamicLinks.vue';
import EvmAssetList from 'src/components/assets/EvmAssetList.vue';
import XcmNativeAssetList from 'src/components/assets/XcmNativeAssetList.vue';
import XvmNativeAssetList from 'src/components/assets/XvmNativeAssetList.vue';
import { endpointKey, providerEndpoints } from 'src/config/chainEndpoints';
import { LOCAL_STORAGE } from 'src/config/localStorage';
import { isValidEvmAddress } from '@astar-network/astar-sdk-core';
Expand All @@ -62,7 +62,6 @@ export default defineComponent({
DynamicLinks,
EvmAssetList,
XcmNativeAssetList,
XvmNativeAssetList,
},
setup() {
const token = ref<Asset | null>(null);
Expand All @@ -72,7 +71,7 @@ export default defineComponent({
const store = useStore();
const { currentAccount } = useAccount();
const { accountData } = useBalance(currentAccount);
const { isMainnet, currentNetworkIdx, evmNetworkIdx, isSupportXvmTransfer } = useNetworkInfo();
const { isMainnet, currentNetworkIdx, evmNetworkIdx } = useNetworkInfo();
// Memo: load the dApps data in advance, so that users can access to dApp staging page smoothly
useDispatchGetDapps();
Expand Down Expand Up @@ -182,7 +181,6 @@ export default defineComponent({
accountData,
isModalXcmBridge,
isLoading,
isSupportXvmTransfer,
};
},
});
Expand Down
Loading

0 comments on commit 0294f2e

Please sign in to comment.