Skip to content

Commit

Permalink
fix: add clickable explorer URL for claiming
Browse files Browse the repository at this point in the history
  • Loading branch information
jeeanribeiro committed Aug 31, 2023
1 parent cdad8d0 commit 384b978
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
<script lang="ts">
import { Table } from '@bloomwalletio/ui'
import { getNameFromNetworkId } from '@core/network'
import { ExplorerEndpoint, getDefaultExplorerUrl, getNameFromNetworkId } from '@core/network'
import { Activity } from '@core/activity'
import { getFormattedTimeStamp, localize } from '@core/i18n'
import { getBaseToken } from '@core/profile/actions'
import { formatTokenAmountPrecise } from '@core/token'
import { openUrlInBrowser } from '@core/app'
import { activeProfile } from '@core/profile/stores'
import { setClipboard } from '@core/utils'
export let activity: Activity
const explorerUrl = getDefaultExplorerUrl($activeProfile?.network?.id, ExplorerEndpoint.Transaction)
function onTransactionIdClick(): void {
explorerUrl
? openUrlInBrowser(`${explorerUrl}/${activity?.asyncData?.claimingTransactionId}`)
: setClipboard(activity?.asyncData?.claimingTransactionId)
}
$: expirationTime = getFormattedTimeStamp(activity?.asyncData?.expirationDate)
$: claimedTime = getFormattedTimeStamp(activity?.asyncData?.claimedDate)
$: hasStorageDeposit =
Expand Down Expand Up @@ -80,6 +91,7 @@
value: activity?.asyncData?.claimingTransactionId,
copyable: true,
truncate: { firstCharCount: 12, endCharCount: 12 },
onClick: onTransactionIdClick,
},
]}
/>

0 comments on commit 384b978

Please sign in to comment.