-
Notifications
You must be signed in to change notification settings - Fork 9
[Explorer] Custom hook for getting explorer data for BlockExplorerLink component when it is not a gpv2 tx #930
Conversation
|
Hey @matextrem , can we finish this task? |
@elena-zh Sure. Do we have a design for this? Where will the link be located? |
I'm in doubt as to how to evaluate this PR, since I'm not sure where this hook should be implemented in the first instance. Would be in the link from the detail view? Maybe @alfetopito can clarify it. |
@matextrem , the only thing I could clarify is that we have already discussed it in the 'parent' issue: #857 (comment) |
@elena-zh regarding that comment, the logic is already done. The only thing left is where to show the Explorer link. |
This should be used when searching for a tx by hash. The steps are basically:
For example, if I search right now for a non-protocol tx I get a not found https://explorer.cow.fi/search/0x46abe93685cc328f908f44695cd2cc2e65bf75c45b69fc787867468e8735653c |
Regarding where to display it, I think the appropriate place is in the not found page with a sentence like:
Feel free to propose a better sentence |
Hey @matextrem , great changes! However, I'd move the message outside the search block area Besides, I'd add an etherscan icon to the link like we do for the all the rest external links in the Explorer Also, I noticed that the app navigates always to Etherscan for external transactions: I searched for GC TXHash, and was navigated to the 404 page in Etherscan: I searched for this TxHash https://blockscout.com/xdai/mainnet/tx/0xb97a644f31364f47efa2a8e3cb98b2c6ed29846aa6a71f514087523b1f2df845 Could you please fix it? |
Hey @matextrem , looks much-much better! Also, it would be nice to increase margin between lines in the mobile view: |
@elena-zh I've just tested it and it is working for me. Maybe you have it cached? Besides, I'm working on your feedback regarding styling. |
@matextrem , hmm, thanks. Will check. |
@elena-zh done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matextrem , changes LGTM now.
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments, looking good otherwise
Co-authored-by: Leandro Boscariol <[email protected]>
LGTM now! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@matextrem Just Nitpick: How about not explicitly using undefined
in the state initialization? in order to be consistent with the rest of the state definitions
Summary
Closes #857
Added a custom hook
useTxOrderExplorerLink
that returns the data needed to be used inBlockExplorerLink
component in case it is not a Gpv2 tx otherwise returns an empty object.To Test
Since tx table is not ready yet, there's no UI to reproduce this behaviour. You can test it by importing
useTxOrderExplorerLink
fromhooks/useGetOrders
and use it with atx
hash. i.e:const explorerLinkData = useTxOrderExplorerLink('0xd51f28edffcaaa76be4a22f6375ad289272c037f3cc072345676e88d92ced8b5')
And then use this data in
BlockExplorerLink
component:<BlockExplorerLink {...explorerLinkData} />