-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Select account - unified account display (#995)
* Load mapped EVM account * Display unified account modal * Merge branch 'main' into feat/au-select-account * Connected account dot and radio button fixes * Revert radio changes * Cleanup * Amount repositioned * Fix for dark theme * dot margin
- Loading branch information
Showing
8 changed files
with
351 additions
and
78 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
<template> | ||
<div class="wrapper--account-detail"> | ||
<div class="box--account"> | ||
<div v-if="accountName" class="row--account"> | ||
<div class="account-name"> | ||
{{ accountName }} | ||
</div> | ||
</div> | ||
<div class="row--account"> | ||
<div class="address"> | ||
{{ getShortenAddress(accountAddress) }} | ||
</div> | ||
</div> | ||
<div v-if="showBalance" class="row--balance-icons"> | ||
<div> | ||
<span v-if="showBalanceValue" class="text--balance"> | ||
{{ $n(getBalance(accountAddress)) }} | ||
{{ nativeTokenSymbol }} | ||
</span> | ||
<span v-else class="text--balance-hide"> ----- {{ nativeTokenSymbol }} </span> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="icons"> | ||
<button class="box--share btn--primary" @click="copyAddress(accountAddress)"> | ||
<div class="icon--primary"> | ||
<astar-icon-copy /> | ||
</div> | ||
<q-tooltip> | ||
<span class="text--tooltip">{{ $t('copy') }}</span> | ||
</q-tooltip> | ||
</button> | ||
<a :href="explorerUrl + accountAddress" target="_blank" rel="noopener noreferrer"> | ||
<button class="box--share btn--primary"> | ||
<div class="icon--primary"> | ||
<astar-icon-external-link /> | ||
</div> | ||
<q-tooltip> | ||
<span class="text--tooltip">{{ $t('assets.explorer') }}</span> | ||
</q-tooltip> | ||
</button> | ||
</a> | ||
</div> | ||
</div> | ||
</template> | ||
<script lang="ts"> | ||
import { defineComponent } from 'vue'; | ||
import { getShortenAddress } from '@astar-network/astar-sdk-core'; | ||
import copy from 'copy-to-clipboard'; | ||
import { useStore } from 'src/store'; | ||
import { useI18n } from 'vue-i18n'; | ||
export default defineComponent({ | ||
props: { | ||
accountName: { | ||
type: String, | ||
required: false, | ||
default: '', | ||
}, | ||
accountAddress: { | ||
type: String, | ||
required: true, | ||
}, | ||
explorerUrl: { | ||
type: String, | ||
required: true, | ||
}, | ||
showBalanceValue: { | ||
type: Boolean, | ||
required: true, | ||
}, | ||
showBalance: { | ||
type: Boolean, | ||
required: false, | ||
default: true, | ||
}, | ||
nativeTokenSymbol: { | ||
type: String, | ||
required: true, | ||
}, | ||
getBalance: { | ||
type: Function, | ||
required: true, | ||
}, | ||
}, | ||
setup() { | ||
const store = useStore(); | ||
const { t } = useI18n(); | ||
const copyAddress = (address: string): void => { | ||
copy(address); | ||
store.dispatch('general/showAlertMsg', { | ||
msg: t('toast.copyAddressSuccessfully'), | ||
alertType: 'copied', | ||
}); | ||
}; | ||
return { getShortenAddress, copyAddress }; | ||
}, | ||
}); | ||
</script> | ||
<style lang="scss" scoped> | ||
@use 'src/components/header/styles/modal-account.scss'; | ||
</style> |
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.