Create a <HashLink> component
willgarrett64 opened this issue · comments
Currently a number of modals display truncated tx hash / wallet id that link to Explorer or Etherscan. We will refactor these links into a single reusable <HashLink>
component.
The component will need:
-
to
prop: this should be limited toexplorer
oretherscan
-
transaction
,stake
,wallet
props: these will contain the full hash/id/address string. (If linking to a wallet,stake
andtransaction
props should be null) -
url
computed prop: calculated fromto
andtransaction/stake/wallet
props -
title
computed prop: which should beStake ID / Tx Hash / Wallet Address
depending on whichstake / transaction / wallet
has a value -
truncatedHash
prop: this will shorten the hash/id/address as is currently done in the existing modals
The component also needs to contain appropriate styling for the modals. Just following how they are already styled.
See below an example of a link to both Explorer and Etherscan
Link to Explorer
wallet/src/components/stakes/CreateStakeModal.vue
Lines 128 to 146 in be9eae1
Link to Etherscan
wallet/src/components/tx/DepositModal.vue
Lines 203 to 210 in be9eae1