MetaMask / MetaMask/metamask-extension
Delete confirm-token-transaction-switch component
- Dominant language
- TypeScript
- Stars
- 13.2k
- Forks
- 5.6k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 451
Description
Component [confirm-token-transaction-switch](https://github.com/MetaMask/metamask-extension/blob/develop/ui/pages/confirm-transaction/confirm-token-transaction-switch.js) takes care to get token relates data from using selectors and other hooks and rendering token routes passing this data. We need to do following refactor:
1. Minimise props passing from confirm-token-transaction-switch. This can be done by getting this data directly in `confirm-approve` and `confirm-token-transaction-base` components. Both of these are functional components. Only 1 prop `transaction` should be required to pass down to various components.
2. Move the 5 routes mapping to `/pages/confirm-transaction.component.js`
3. Add more unit test coverage here `/pages/confirm-transaction.test.js` for the 5 routes added to it
4. Delete `/pages/confirm-token-transaction-switch.js`
Contributor guide
Research direction
Start by reading ui/pages/confirm-transaction/confirm-token-transaction-switch.js, then inspect confirm-approve, confirm-token-transaction-base, and /pages/confirm-transaction.component.js. Run the tests in /pages/confirm-transaction.test.js before changing the five route mappings. Done means the switch component is deleted, only transaction is passed where required, routes are moved, and coverage is added for all five routes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 42/100