-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add network tables for Hubble Stats #1452
Conversation
✅ Deploy Preview for webb hubble statistic is ready! Thanks for the contribution @vutuanlinh2k2
To edit notification comments on pull requests, go to your Netlify site settings. |
Looks good. Quick heads up there may be updates required to this table based on recent discussions in displaying pool & token data. Will create a separate issue to address the updates. |
const [chains, setChains] = useState<number[]>([]); | ||
const [tvlData, setTvlData] = useState<TokenCompositionType[]>([]); | ||
const [volumeData, setVolumeData] = useState<TokenCompositionType[]>([]); | ||
const [depositsData, setDepositsData] = useState<TokenCompositionType[]>([]); | ||
const [feesData, setFeesData] = useState<TokenCompositionType[]>([]); |
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.
It would be a good idea to transform this component into a server component. You could do this by eliminating all instances of useState. To emulate data fetching, you can create a data fetching function outside of the component, which returns dummy data.
Next, transform this component into an asynchronous one and call the newly created data fetching function to obtain data. Once you have the data, you can pass it into the child components for rendering. This way, you'll maintain a smoother and more efficient component structure.
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.
Left some comments.
✅ Deploy Preview for webb hubble statistic is ready! Thanks for the contribution @vutuanlinh2k2
To edit notification comments on pull requests, go to your Netlify site settings. |
…mn in PoolMetadata table
✅ Deploy Preview for webb hubble statistic is ready! Thanks for the contribution @vutuanlinh2k2
To edit notification comments on pull requests, go to your Netlify site settings. |
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.
LGTM!
Quick question: could we implement a sorting mechanism for the order in which we display the chains within the table? One idea is that we could display them alphabetically (i.e., Arbitrum Goerli
, Avalanche Fuji
, Ethereum Goerli
, Ethereum Sepolia
.... -> Scroll Alpha
etc.)
Open to other ideas too, let me know your thoughts.
I think this can be implemented, I will try and update soon! |
Sounds good 💪 It'd be nice to have consistent order when users navigate between various pools. |
@monaiuu I have added new code to sort the chains alphabetically! |
✅ Deploy Preview for webb hubble statistic is ready! Thanks for the contribution @AtelyPham
To edit notification comments on pull requests, go to your Netlify site settings. |
Hmm, if following the logic of the first letter, I think the order would be as follow: Arbitrum Otherwise looks good! We want to make sure the logic is valid and can be scaled across various pools. Let's get it merged after fixing this small ordering issue. |
@AtelyPham @vutuanlinh2k2 If this takes too much effort to do, we can overlook it for now and revisit it later on. Otherwise everything looks good and I think it is ready to merge. |
@monaiuu I made a small adjustment to the code so the chain with the same group will be next to each other. @AtelyPham please review the code one last time and merge! |
7360a50
to
bc7b6d2
Compare
✅ Deploy Preview for webb hubble statistic is ready! Thanks for the contribution @AtelyPham
To edit notification comments on pull requests, go to your Netlify site settings. |
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.
I left some comments.
<div className="w-full text-center"> | ||
<ChainChip | ||
chainName={chainsConfig[chainId].name} | ||
chainType={chainsConfig[chainId].group as ChainGroup} |
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.
I believe it would be beneficial if we consider changing the type of the group
property to ChainGroup
. This is due to the observation that all the chains in the chainsConfig
seem to have a predefined value for the group
property. Hence, the need for ChainGroup | undefined
may not be necessary. What do you think?
apps/hubble-stats/components/NetworkPoolTable/NetworkPoolTable.tsx
Outdated
Show resolved
Hide resolved
apps/hubble-stats/components/NetworkPoolTable/NetworkPoolTable.tsx
Outdated
Show resolved
Hide resolved
apps/hubble-stats/components/NetworkPoolTable/NetworkPoolTable.tsx
Outdated
Show resolved
Hide resolved
apps/hubble-stats/components/NetworkTokenTable/NetworkTokenTable.tsx
Outdated
Show resolved
Hide resolved
✅ Deploy Preview for webb hubble statistic is ready! Thanks for the contribution @vutuanlinh2k2
To edit notification comments on pull requests, go to your Netlify site settings. |
Summary of changes
Provide a detailed description of proposed changes.
Proposed area of change
Put an
x
in the boxes that apply.apps/bridge-dapp
apps/hubble-stats
apps/stats-dapp
apps/webbsite
apps/faucet
apps/tangle-website
libs/webb-ui-components
Reference issue to close (if applicable)
Specify any issues that can be closed from these changes (e.g. Closes #233).
Screen Recording (with dummy data)
If possible provide a screen recording of proposed change.
Screen.Recording.2023-07-24.at.20.04.24.mov
Code Checklist
Please be sure to add .stories documentation if any additions are made to
libs/webb-ui-components
.