Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat/open-in-explorer-for-wallets-on-account-screen #695

Merged
merged 5 commits into from
Dec 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions src/components/ShareURIDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
{{ $t('home.show_qr_code') }}
</v-list-item-title>
</v-list-item>
<v-list-item
v-if="crypto !== cryptos.USDT && crypto !== cryptos.USDC"
bludnic marked this conversation as resolved.
Show resolved Hide resolved
@click="openInExplorer"
>
<v-list-item-title :class="`${className}__list-item-title`">
{{ $t('home.explorer') }}
</v-list-item-title>
</v-list-item>
</v-list>
</v-card-text>
</v-card>
Expand All @@ -32,7 +40,9 @@
<script>
NikIvv marked this conversation as resolved.
Show resolved Hide resolved
import QrcodeRendererDialog from '@/components/QrcodeRendererDialog.vue'
import copyToClipboard from 'copy-to-clipboard'
import { generateURI } from '@/lib/uri'
import { generateURI, websiteUriToOnion } from '@/lib/uri'
import { Cryptos } from '@/lib/constants'
import config from '@/config/index'

export default {
components: { QrcodeRendererDialog },
Expand All @@ -57,7 +67,8 @@ export default {
emits: ['update:modelValue'],
data: () => ({
className: 'share-uri-dialog',
showQrcodeRendererDialog: false
showQrcodeRendererDialog: false,
cryptos: Cryptos
NikIvv marked this conversation as resolved.
Show resolved Hide resolved
}),
computed: {
show: {
Expand Down Expand Up @@ -86,6 +97,14 @@ export default {
openQRCodeRenderer() {
this.showQrcodeRendererDialog = true
this.show = false
},
openInExplorer() {
const explorerUri = config[this.crypto.toLowerCase()].explorerAddress.replace(
/\${([a-zA-Z_]+?)}/,
this.address
)
const explorerLink = this.isADM ? websiteUriToOnion(explorerUri) : explorerUri
window.open(explorerLink, '_blank', 'resizable,scrollbars,status,noopener')
NikIvv marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@
"show_qr_code": "Show QR code",
"stake_and_earn_btn": "Stake and earn",
"wallet": "wallet",
"wallet_crypto": "{crypto} wallet"
"wallet_crypto": "{crypto} wallet",
"explorer": "Open in Explorer"
},
"warning_on_addresses": {
"warning": "Warning",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@
"show_qr_code": "Показать QR-код",
"stake_and_earn_btn": "Застейкать и заработать",
"wallet": "кошелек",
"wallet_crypto": "Кошелек {crypto}"
"wallet_crypto": "Кошелек {crypto}",
"explorer": "Посмотреть в Explorer'е"
},
"warning_on_addresses": {
"warning": "Внимание",
Expand Down
Loading