Update the default state of the app#712
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR aims to update the default state of the app by standardizing configurations, improving ramp direction logic based on language settings, and refactoring default fiat token amounts for improved maintainability.
- Introduces a new .prettierrc configuration file.
- Updates ramp direction logic to default to ONRAMP for Portuguese (Brazil) while handling other cases appropriately.
- Refactors and centralizes default fiat token amounts and removes duplicate definitions.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| apps/frontend/src/stores/ramp/useRampFormStore.ts | Centralizes default fiat token amounts and updates the initial state. |
| apps/frontend/src/hooks/useRampUrlParams.ts | Removes a redundant definition of default fiat token amounts. |
| apps/frontend/src/helpers/path/index.tsx | Adjusts ramp direction logic to incorporate language-specific behavior. |
| .prettierrc | Adds a configuration file to enforce consistent code formatting. |
Comments suppressed due to low confidence (1)
apps/frontend/src/helpers/path/index.tsx:14
- [nitpick] Consider refactoring the nested ternary operator into an if/else statement for improved readability.
const rampDirection = rampParam === 'buy' ? RampDirection.ONRAMP : getLanguageFromPath() === Language.Portuguese_Brazil ? RampDirection.ONRAMP : RampDirection.OFFRAMP;
✅ Deploy Preview for pendulum-pay ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Member
|
@Sharqiewicz I see USDT, it should be USDC |
Member
Author
|
@prayagd Changed ✅ |
Member
|
LGTM, go from my end |
ebma
approved these changes
Jun 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several changes to improve code readability, standardize configurations, and enhance functionality in handling language-specific defaults. The most important changes include updates to the
.prettierrcfile for consistent formatting, adjustments to ramp direction logic based on language, and refactoring of default fiat token amounts for better maintainability.Code formatting and configuration:
.prettierrc: Added a configuration file to enforce consistent code formatting, including rules for semicolons, trailing commas, single quotes, and print width.Ramp direction logic improvements:
apps/frontend/src/helpers/path/index.tsx: Updated thegetRampDirectionFromPathfunction to account for language-specific behavior. If the language is Portuguese (Brazil), the ramp direction defaults toONRAMP.Refactoring and maintainability:
apps/frontend/src/stores/ramp/useRampFormStore.ts: Refactored default fiat token amounts into a centralizeddefaultFiatTokenAmountsobject for better maintainability. IntroduceddefaultFiatAmountto dynamically determine the default fiat amount based on language. [1] [2]apps/frontend/src/hooks/useRampUrlParams.ts: Removed redundantdefaultFiatTokenAmountsdefinition and imported the centralized version fromuseRampFormStore. [1] [2]