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

fix: transfer amount #6729

Merged
merged 3 commits into from
Aug 16, 2023
Merged

fix: transfer amount #6729

merged 3 commits into from
Aug 16, 2023

Conversation

Jarsen136
Copy link
Contributor

@Jarsen136 Jarsen136 commented Aug 15, 2023

Thank you for your contribution to the KodaDot - One Stop Shop for Polkadot NFTs.

👇 __ Let's make a quick check before the contribution.

PR Type

  • Bugfix
  • Feature
  • Refactoring

Needs QA check

  • @kodadot/qa-guild please review

Context

Did your issue had any of the "$" label on it?

Screenshot 📸

  • My fix has changed UI

Old design of transfer

image

Redesigned transfer page

image

I have made a test transfer with 0.0022KSM($0.05)

image

tx: https://kusama.subscan.io/extrinsic/19246871-3

Copilot Summary

🤖 Generated by Copilot at 75a6ec1

This pull request improves the calculation and display of USD values for different tokens in the top collections and transfer components. It also refactors some utility functions and hooks to enhance code quality and consistency.

🤖 Generated by Copilot at 75a6ec1

To calculate tokens in bucks
They refactored some utility funcs
They also replaced
The hooks that they faced
And used getters instead of state flux

@Jarsen136 Jarsen136 requested a review from a team as a code owner August 15, 2023 16:01
@Jarsen136 Jarsen136 requested review from preschian and roiLeo and removed request for a team August 15, 2023 16:01
@kodabot
Copy link
Collaborator

kodabot commented Aug 15, 2023

SUCCESS @Jarsen136 PR for issue #6711 which is assigned to you. Please wait for review and don't hesitate to grab another issue in the meantime!

@netlify
Copy link

netlify bot commented Aug 15, 2023

Deploy Preview for koda-canary ready!

Name Link
🔨 Latest commit 0756032
🔍 Latest deploy log https://app.netlify.com/sites/koda-canary/deploys/64dc8c906dda350008061ade
😎 Deploy Preview https://deploy-preview-6729--koda-canary.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@reviewpad
Copy link
Contributor

reviewpad bot commented Aug 15, 2023

AI-Generated Summary: This pull request contains changes related to the transfer amount calculations in the codebase. It replaces the previously used calculateUsdFromKsm and calculateKsmFromUsd functions with more generalized calculateUsdFromToken and calculateTokenFromUsd functions respectively. These new functions are used in TopCollectionsItem.vue, Transfer.vue, TransferOld.vue, and calculation.ts files. This way, the new implementation works for tokens other than KMS. These changes result in better maintainability, readability, and ease of incorporating other tokens in future. It changes four files with 21 insertions and 15 deletions.

@reviewpad reviewpad bot added small Pull request is small waiting-for-review labels Aug 15, 2023
utils/calculation.ts Show resolved Hide resolved
utils/calculation.ts Show resolved Hide resolved
@prury
Copy link
Member

prury commented Aug 15, 2023

@prury prury added the S-works-for-me-✅ qa-guild has tested PR from end user perspective and functionality worked label Aug 15, 2023
@roiLeo roiLeo added the S-code-lgtm-✅ code review guild has reviewed this PR and it's code is approved label Aug 16, 2023
Copy link
Member

@preschian preschian left a comment

Choose a reason for hiding this comment

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

otherwise lgtm

components/landing/topCollections/TopCollectionsItem.vue Outdated Show resolved Hide resolved
Jarsen136 and others added 2 commits August 16, 2023 15:28
Co-authored-by: Preschian Febryantara <preschian@users.noreply.github.com>
@codeclimate
Copy link

codeclimate bot commented Aug 16, 2023

Code Climate has analyzed commit 0756032 and detected 2 issues on this pull request.

Here's the issue category breakdown:

Category Count
Duplication 2

View more on Code Climate.

@sonarcloud
Copy link

sonarcloud bot commented Aug 16, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
2.2% 2.2% Duplication

@vikiival vikiival merged commit 865bb5e into kodadot:main Aug 16, 2023
13 of 14 checks passed
@vikiival
Copy link
Member

Thanks for followup!

This was referenced Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-code-lgtm-✅ code review guild has reviewed this PR and it's code is approved S-works-for-me-✅ qa-guild has tested PR from end user perspective and functionality worked small Pull request is small waiting-for-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show correct value with decimals in new Transfer page and allow user to send less than 0.01 KSM
6 participants