-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
chore: Componetize Tokens
screen
#11471
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Bitrise✅✅✅ Commit hash: 0fd9ad5 Note
|
Bitrise❌❌❌ Commit hash: 7f6ce57 Note
Tip
|
Bitrise❌❌❌ Commit hash: a531043 Note
Tip
|
Bitrise❌❌❌ Commit hash: 560a0a9 Note
Tip
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it LGTM✅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Bitrise✅✅✅ Commit hash: 3e8c909 Note
|
Quality Gate passedIssues Measures |
Description
Proposal: Break up monolithic
Tokens/index.tsx
file into smaller, more maintainable components.As I began working on my Token sorting task, I noticed that the
Tokens
screen code structure felt overly flat, which led to some challenges navigating through the logic (~800 lines). The reliance on multiple internal callbacks created lots of complexity, making it difficult to reason through the flow, and unclear where to reliably and maintainably introduce my sorting logic.In this PR, I’m proposing a refactor of the screen by breaking it down into smaller, more manageable components, with a utility directory to handle non TSX related helpers (like sorting or handling balances). So, instead of relying heavily on internal callbacks, we can just pass props and utilize selectors where needed for each component’s specific function.
While this may be a matter of personal preference, I believe that an over-reliance on internal callbacks can often result in a bit of an anti-pattern. I feel that this refactor will make these components more straightforward, reliable, and easier to maintain. Is there a reason why we wouldn't want to go with this approach instead?
I also realize that we have other tasks in-flight and I don't want to be a blocker, but I feel pretty strongly that this refactor will remove lots of technical debt and set us up really well for the long run.
Note: This isn't quite complete, and you'll notice a few areas where I can do things like tighten up TypeScript types. If you folks are fine with this approach, I can go ahead and polish this.
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Screen.Recording.2024-09-26.at.9.31.15.PM.mov
Pre-merge author checklist
Pre-merge reviewer checklist