-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38039 from lukemorawski/36038-fix-selection_list_…
…footer_extra_padding_2 36038 fix selection list footer extra padding 2
- Loading branch information
Showing
21 changed files
with
274 additions
and
223 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import {useOnyx} from 'react-native-onyx'; | ||
import * as User from '@userActions/User'; | ||
import type CONST from '@src/CONST'; | ||
import ONYXKEYS from '@src/ONYXKEYS'; | ||
|
||
type UseDismissedReferralBannersProps = { | ||
referralContentType: | ||
| typeof CONST.REFERRAL_PROGRAM.CONTENT_TYPES.MONEY_REQUEST | ||
| typeof CONST.REFERRAL_PROGRAM.CONTENT_TYPES.START_CHAT | ||
| typeof CONST.REFERRAL_PROGRAM.CONTENT_TYPES.SEND_MONEY | ||
| typeof CONST.REFERRAL_PROGRAM.CONTENT_TYPES.REFER_FRIEND; | ||
}; | ||
|
||
function useDismissedReferralBanners({referralContentType}: UseDismissedReferralBannersProps): {isDismissed: boolean; setAsDismissed: () => void} { | ||
const [dismissedReferralBanners] = useOnyx(ONYXKEYS.NVP_DISMISSED_REFERRAL_BANNERS); | ||
const isDismissed = dismissedReferralBanners?.[referralContentType] ?? false; | ||
|
||
const setAsDismissed = () => { | ||
if (!referralContentType) { | ||
return; | ||
} | ||
// Set the banner as dismissed | ||
User.dismissReferralBanner(referralContentType); | ||
}; | ||
|
||
return {isDismissed, setAsDismissed}; | ||
} | ||
|
||
export default useDismissedReferralBanners; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import {useContext} from 'react'; | ||
import {ScreenWrapperStatusContext} from '@components/ScreenWrapper'; | ||
|
||
/** | ||
* Hook to get the transition status of a screen inside a ScreenWrapper. | ||
* Use this hook if you can't get the transition status from the ScreenWrapper itself. Usually when ScreenWrapper is used inside TopTabNavigator. | ||
* @returns `didScreenTransitionEnd` flag to indicate if navigation transition ended. | ||
*/ | ||
export default function useScreenWrapperTranstionStatus() { | ||
const value = useContext(ScreenWrapperStatusContext); | ||
|
||
if (value === undefined) { | ||
throw new Error("Couldn't find values for screen ScreenWrapper transition status. Are you inside a screen in ScreenWrapper?"); | ||
} | ||
|
||
return value; | ||
} |
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.