-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
feat: create usePolicy hook #46956
feat: create usePolicy hook #46956
Conversation
@ishpaul777 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
@roryabraham thanks for the recommendation. I updated the PR. |
Reviewer Checklist
Screenshots/VideosAndroid: NativeWhatsApp.Video.2024-08-08.at.11.16.20.PM.mp4Android: mWeb ChromeWhatsApp.Video.2024-08-08.at.11.13.08.PM.mp4iOS: NativeScreen.Recording.2024-08-08.at.10.52.46.PM.moviOS: mWeb SafariScreen.Recording.2024-08-08.at.10.58.20.PM.movMacOS: Chrome / SafariScreen.Recording.2024-08-08.at.10.54.36.PM.movMacOS: DesktopScreen.Recording.2024-08-08.at.11.25.29.PM.mov |
@@ -52,7 +53,7 @@ function ReportActionItemContentCreated({contextValue, parentReportAction, trans | |||
|
|||
const {report, action, transactionThreadReport} = contextValue; | |||
|
|||
const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${report.policyID === CONST.POLICY.OWNER_EMAIL_FAKE ? '-1' : report.policyID ?? '-1'}`); | |||
const policy = usePolicy(report.policyID === CONST.POLICY.OWNER_EMAIL_FAKE ? '-1' : report.policyID ?? '-1'); |
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.
NAB, passing report.policyID should be enough here
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
FYI I believe this was deployed to prod yesterday, from this checklist - #47219 |
Details
Fixed Issues
$ #46805
PROPOSAL: #46805 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Screen.Recording.2024-08-07.at.22.20.39.mp4
Android: mWeb Chrome
Screen.Recording.2024-08-07.at.22.06.21.mp4
iOS: Native
Screen.Recording.2024-08-07.at.23.21.37.mp4
iOS: mWeb Safari
Screen.Recording.2024-08-07.at.22.10.39.mp4
MacOS: Chrome / Safari
Screen.Recording.2024-08-07.at.17.52.35.mp4
MacOS: Desktop
Screen.Recording.2024-08-07.at.22.14.46.mp4