8000 chore: display prices as full number on sales page by rajk93 · Pull Request #11554 · polkadot-js/apps · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

chore: display prices as full number on sales page #11554

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
8000
from

Conversation

rajk93
Copy link
Contributor
@rajk93 rajk93 commented May 14, 2025

fixes #11465

Previous behaviour

Screenshot 2025-05-14 at 6 34 51 PM

Current behaviour

Screenshot 2025-05-14 at 6 35 11 PM

@TarikGul
Copy link
Member

cc: @piggydoughnut @ap211unitech

Copy link
Member
@ap211unitech ap211unitech left a comment

Choose a reason for hiding this comment

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

I would suggest creating a new helper function outside the component and making use of it.

const helper = (num: BN) => `${(num.toNumber() / 10 ** formatBalance.getDefaults().decimals)} ${formatBalance.getDefaults().unit}`;

and use it like:

const formattedCoretimePrice = useMemo(() => {
    return !coretimePrice ? null : helper(coretimePrice);
  }, [coretimePrice])

Similarly, use it with startPrice and endPrice as well. This makes the code cleaner and more readable.

@rajk93
Copy link
Contributor Author
rajk93 commented May 15, 2025

I would suggest creating a new helper function outside the component and making use of it.

const helper = (num: BN) => `${(num.toNumber() / 10 ** formatBalance.getDefaults().decimals)} ${formatBalance.getDefaults().unit}`;

and use it like:

const formattedCoretimePrice = useMemo(() => {
    return !coretimePrice ? null : helper(coretimePrice);
  }, [coretimePrice])

Similarly, use it with startPrice and endPrice as well. This makes the code cleaner and more readable.

That makes sense. I'll make the requested changes.

@rajk93
Copy link
Contributor Author
rajk93 commented May 15, 2025

@ap211unitech I’ve made the suggested change in 404698b.

Also, the Sale Timeline box looked cluttered when the price value was large on smaller screens, so I updated the layout to a 2×3 grid to improve readability.

Here’s how it looks now on smaller screens:
Screenshot 2025-05-15 at 2 22 05 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Coretime: Sales Page: Display prices as full numbers instead of using nano or micro notation.
3 participants
0