Skip to content

[READY] add token disable config/logic in the frontend#607

Merged
Sharqiewicz merged 13 commits into
stagingfrom
chore/disable-eur
Apr 30, 2025
Merged

[READY] add token disable config/logic in the frontend#607
Sharqiewicz merged 13 commits into
stagingfrom
chore/disable-eur

Conversation

@Sharqiewicz
Copy link
Copy Markdown
Member

No description provided.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 30, 2025

Deploy Preview for pendulum-pay ready!

Name Link
🔨 Latest commit 5daac65
🔍 Latest deploy log https://app.netlify.com/sites/pendulum-pay/deploys/68126e7feb55ea00094bff63
😎 Deploy Preview https://deploy-preview-607--pendulum-pay.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.

@Sharqiewicz Sharqiewicz changed the title add token disable config/logic in the frontend [READY] add token disable config/logic in the frontend Apr 30, 2025
@Sharqiewicz Sharqiewicz requested review from a team, Copilot, ebma and gianfra-t and removed request for Copilot, ebma and gianfra-t April 30, 2025 15:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces token disable configuration and logic in the frontend to control the availability of fiat tokens. Key changes include adding default token constants and updating stores, enhancing URL parameter processing and validation for token availability, and integrating token unavailability events in the events context.

Reviewed Changes

Copilot reviewed 9 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
frontend/src/stores/rampDirectionStore.ts Introduces a default ramp direction constant used in the store initialization.
frontend/src/stores/ramp/useRampFormStore.ts Adds default fiat token constants and uses them in the initial store values.
frontend/src/hooks/useRampUrlParams.ts Updates URL parameter handling to leverage token defaults and fiat token status.
frontend/src/hooks/ramp/useRampValidation.ts Adds token availability validation with event tracking for disabled tokens.
frontend/src/contexts/events.tsx Introduces a new TokenUnavailableErrorEvent interface in the events context.
frontend/src/config/tokenAvailability.ts Provides a central configuration for fiat token availability and associated helpers.
frontend/src/components/Ramp/Onramp/index.tsx Removes an unused hook import.
frontend/src/components/InputKeys/SelectionModal.tsx Adds a check for disabled tokens when handling token selection.
frontend/src/components/InputKeys/PoolListItem/index.tsx Updates the UI to visually indicate unavailable tokens with styling and messaging.
Files not reviewed (2)
  • frontend/src/translations/en.json: Language not supported
  • frontend/src/translations/pt.json: Language not supported

Comment thread frontend/src/components/InputKeys/SelectionModal.tsx
Comment thread frontend/src/hooks/ramp/useRampValidation.ts
Copy link
Copy Markdown
Member

@ebma ebma left a comment

Choose a reason for hiding this comment

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

Looks good overall. Thanks for the refactor 👍 We should fix that translation key though before merging.

},
"insufficientFunds": "Saldo insuficiente. Seu saldo é {{userInputTokenBalance}} {{assetSymbol}}",
"moreThanMaximumWithdrawal": {
"sell": "O valor máximo de compra é {{maxAmountUnits}} {{assetSymbol}}.",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think the problem here is not a duplicate but the same key name, ie both being called "sell". Please re-add the key and call it "buy" instead.

@Sharqiewicz Sharqiewicz merged commit b6a7627 into staging Apr 30, 2025
4 of 5 checks passed
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.

3 participants