Skip to content

Update the default state of the app#712

Merged
ebma merged 2 commits into
stagingfrom
fix/default-app-state
Jun 11, 2025
Merged

Update the default state of the app#712
ebma merged 2 commits into
stagingfrom
fix/default-app-state

Conversation

@Sharqiewicz
Copy link
Copy Markdown
Member

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 .prettierrc file 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 the getRampDirectionFromPath function to account for language-specific behavior. If the language is Portuguese (Brazil), the ramp direction defaults to ONRAMP.

Refactoring and maintainability:

@Sharqiewicz Sharqiewicz requested review from a team and Copilot June 10, 2025 14:47
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 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;

@netlify
Copy link
Copy Markdown

netlify Bot commented Jun 10, 2025

Deploy Preview for pendulum-pay ready!

Name Link
🔨 Latest commit fd6e57c
🔍 Latest deploy log https://app.netlify.com/projects/pendulum-pay/deploys/684981fbd1155e000866ab04
😎 Deploy Preview https://deploy-preview-712--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 project configuration.

@prayagd
Copy link
Copy Markdown
Member

prayagd commented Jun 11, 2025

@Sharqiewicz I see USDT, it should be USDC

@Sharqiewicz
Copy link
Copy Markdown
Member Author

@prayagd Changed ✅

@prayagd
Copy link
Copy Markdown
Member

prayagd commented Jun 11, 2025

LGTM, go from my end

@ebma ebma merged commit 112914a into staging Jun 11, 2025
4 of 5 checks passed
@ebma ebma deleted the fix/default-app-state branch June 11, 2025 14:47
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.

4 participants