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

Hubble Stats - Pool Overview #1431

Merged
merged 51 commits into from
Jul 20, 2023
Merged

Conversation

vutuanlinh2k2
Copy link
Contributor

Summary of changes

  • Add Pool Overview container for the Hubble Stats
  • Refactor PoolTypeChip component for the Hubble Stats
  • Update glass background to multiple components
  • Minor updates on icons and hooks in webb-ui-kit

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-15.at.14.37.21.mov

Code Checklist

Please be sure to add .stories documentation if any additions are made to libs/webb-ui-components.

  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Copy link
Contributor

@monaiuu monaiuu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering if we could implement the responsive breakpoints with appropriate margins that were added later on last week in Figma in this issue? Or if you think we should address responsiveness in a separate issue, let me know what works best.

Here's the link: https://www.figma.com/file/KWLQWPgzbMMIj0p5dylcgB/%F0%9F%93%88-Shielded-Pool-Stats?type=design&node-id=1298%3A203096&mode=dev

Screenshot 2023-07-17 at 12 13 49 PM

Looks good so far! Amazing job on the glass effects!! @vutuanlinh2k2

@vutuanlinh2k2
Copy link
Contributor Author

I am wondering if we could implement the responsive breakpoints with appropriate margins that were added later on last week in Figma in this issue? Or if you think we should address responsiveness in a separate issue, let me know what works best.

Here's the link: figma.com/file/KWLQWPgzbMMIj0p5dylcgB/%F0%9F%93%88-Shielded-Pool-Stats?type=design&node-id=1298%3A203096&mode=dev

Screenshot 2023-07-17 at 12 13 49 PM

Looks good so far! Amazing job on the glass effects!! @vutuanlinh2k2

@monaiuu, I think we should create a separate issue to address responsiveness; at least I find it more convenient for me if we choose that way 😅 You can assign that issue to me!

Comment on lines 27 to 31
{isDarkMode ? (
<ShieldedAssetDark width={40} height={48} />
) : (
<ShieldedAssetLight width={40} height={48} />
)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use TailwindCSS classes dark:hidden block and hidden dark:block to manage component visibility based on theme, rather than React state. This can transform the component into a server component, reducing client-side JavaScript.

<ShieldedAssetLight width={40} height={48} />
)}
<Typography variant="h5" fw="bold">
webbParachain
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should parameterize this value instead of hardcoding it here.

variant="body1"
className="text-mono-140 dark:text-mono-40"
>
{shortenHex('0x17488912174388', 4)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should parameterize this value instead of hardcoding it here.

</a>
</div>

<PoolTypeChip type="single" name="Single Asset" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should parameterize this as the component prop as well. Use single as the default value.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, the current state of this hook could be improved. I believe we should refactor it to read and synchronize the theme value from local storage. Moreover, the hook should also be able to support both client-side and server-side rendering. would you be so kind to help me create an issue for this? @vutuanlinh2k2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue for this is created here!

Copy link
Member

@AtelyPham AtelyPham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments.

@github-actions
Copy link

Deploy Preview for webb hubble statistic is ready! Thanks for the contribution @vutuanlinh2k2

Name Link
🔨 Latest commit 1b07d3c51845a637c073ba2436892d317a530c88
🔍 Latest deploy log https://app.netlify.com/sites/hubble-stats/deploys/64b76082dda55939cf7908d0
😎 Deploy Preview https://64b76082dda55939cf7908d0--hubble-stats.netlify.app

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions
Copy link

Deploy Preview for webb hubble statistic is ready! Thanks for the contribution @vutuanlinh2k2

Name Link
🔨 Latest commit 1fffcd36e3b713ed8b7048cd30f223690443b8d7
🔍 Latest deploy log https://app.netlify.com/sites/hubble-stats/deploys/64b7674dd57021445f12faab
😎 Deploy Preview https://64b7674dd57021445f12faab--hubble-stats.netlify.app

To edit notification comments on pull requests, go to your Netlify site settings.

};

const PoolOverviewContainer = () => {
const [poolOverviewData, setPoolOverviewData] = useState<PoolOverviewType>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we need the useState hook here @vutuanlinh2k2?

Copy link
Member

@AtelyPham AtelyPham Jul 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just remove this hook and make it as the server component, when we integrate API into this component, we can utilize the async component from React 18 to fetch and render the data without the useState hook here

Copy link
Member

@AtelyPham AtelyPham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a comment, otherwise LG 👍

@AtelyPham
Copy link
Member

AtelyPham commented Jul 19, 2023

Could you kindly ensure that all conflicts are resolved thoughtfully before proceeding with the merge of this PR? Thank you.

@github-actions
Copy link

Deploy Preview for webb hubble statistic is ready! Thanks for the contribution @vutuanlinh2k2

Name Link
🔨 Latest commit a482bc251d2e7926ec650c35b294af794b46a838
🔍 Latest deploy log https://app.netlify.com/sites/hubble-stats/deploys/64b8daf0bc76e354bc781a33
😎 Deploy Preview https://64b8daf0bc76e354bc781a33--hubble-stats.netlify.app

To edit notification comments on pull requests, go to your Netlify site settings.

@vutuanlinh2k2 vutuanlinh2k2 merged commit 659e707 into develop Jul 20, 2023
7 checks passed
@vutuanlinh2k2 vutuanlinh2k2 deleted the linh/hubble-stats-pool-overview branch July 20, 2023 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants