-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[Wave Collect] [Xero] More features text #42662
Merged
lakchote
merged 18 commits into
Expensify:xero-merge-freeze
from
mananjadhav:xero-more-features-text
May 28, 2024
Merged
Changes from 7 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
a082fc4
feat: add lock icon for switch
mananjadhav e68aba9
feat: state modal
mananjadhav 1e6dc10
feat: added features modal
mananjadhav 4ed381b
refactor: modal state
mananjadhav 8033a8c
refactor: language format
mananjadhav 9dab55a
refactor: language and connection name
mananjadhav b4f8164
style: prettier fixes
mananjadhav c857d39
Merge branch 'xero-merge-freeze' of https://github.com/Expensify/App …
mananjadhav 9ebe047
feat: added es translations
mananjadhav 835e953
refactor: remove title
mananjadhav 369f92e
fix: added dependency
mananjadhav 90f0c0f
style: lint fixes
mananjadhav a38c2ee
fix: update copy
mananjadhav c2c741b
refactor: remove unused var
mananjadhav 0c0b5d1
fix: spanish copy
mananjadhav 59770a4
style: lint fixes
mananjadhav a2ffb3b
fix: spanish copy
mananjadhav e610704
fix: captilize
mananjadhav File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
We repeated this piece of code few times, I think we should reuse it with an
useCallback
?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.
I am not sure if it is necessary, we're not relying on the previous state that we really need to put it inside useCallback. The
hasAccountingConnection
is also dependent on the prop.And about repetition, it's a setState call. I could wrap it inside the method but looks like an overkill.
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.
I think we should, including
Policy.enablePolicyCategories(policy?.id ?? '', isEnabled);
line below.Also can you complete the checklist please 😄 ?
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.
Working through the checklist.
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.
With enablePolicyCategories it might make sense. Let me check.
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.
@lakchote Do you think it makes sense to move this code inside a useCallback?
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.
I do agree with @mananjadhav, I don't think there's a benefit here to use
useCallback()
. It's not a computational intensive operation, we're just setting state. It can be tempting to use it to avoid repetition, but using these memorized functions come at a cost on intial render. Given the fact it's just setting state, I'd say it's a premature optimization scenario and we can keep it that way.Happy to be proven wrong though, if you can give me arguments proving me otherwise @hungvu193 😄
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.
I think that's fine though. We can keep it this way :)