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

cherry-pick: add fallback method for currency formatter in useFiatFormatter #24584

Conversation

OGPoyraz
Copy link
Member

… hook (#24563)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

This PR goal is to add a fallback for unknown currency formats to render
it `${amount} ${currency}` format.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/24563?quickstart=1)

## **Related issues**

Fixes: #24558

## **Manual testing steps**

1. Go to Settings > General
2. Change your currency to Storj
3. Start a send transaction on Ethereum with any value
4. MM doesn't crash and shows `amount storj`

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [X] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
@OGPoyraz OGPoyraz requested a review from a team as a code owner May 17, 2024 11:54
@OGPoyraz OGPoyraz changed the title fix: add fallback method for currency formatter in useFiatFormatter cherry-pick: add fallback method for currency formatter in useFiatFormatter May 17, 2024
@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label May 17, 2024
@danjm danjm merged commit a22b13d into Version-v11.16.0 May 21, 2024
14 checks passed
@danjm danjm deleted the Version-v11.16.0-cherry-pick-add-fallback-fiat-formatter branch May 21, 2024 08:05
@github-actions github-actions bot locked and limited conversation to collaborators May 21, 2024
@metamaskbot metamaskbot added the release-11.16.0 Issue or pull request that will be included in release 11.16.0 label May 21, 2024
@metamaskbot
Copy link
Collaborator

No release label on PR. Adding release label release-11.16.0 on PR, as PR was cherry-picked in branch 11.16.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
INVALID-PR-TEMPLATE PR's body doesn't match template release-11.16.0 Issue or pull request that will be included in release 11.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants