-
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.
- Loading branch information
1 parent
523edfe
commit 21d67d1
Showing
5 changed files
with
11 additions
and
83 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
import {useIsFocused} from '@react-navigation/native'; | ||
import React, {useEffect, useState} from 'react'; | ||
import type {NativeConfig} from 'react-native-config'; | ||
import Config from 'react-native-config'; | ||
import getUserLanguage from '@components/SignInButtons/GetUserLanguage'; | ||
import type {WithNavigationFocusProps} from '@components/withNavigationFocus'; | ||
import withNavigationFocus from '@components/withNavigationFocus'; | ||
import Log from '@libs/Log'; | ||
import * as Session from '@userActions/Session'; | ||
Check failure on line 7 in src/components/SignInButtons/AppleSignIn/index.tsx
|
||
import CONFIG from '@src/CONFIG'; | ||
|
@@ -19,11 +18,9 @@ type AppleSignInDivProps = { | |
onPointerDown?: () => void; | ||
}; | ||
|
||
type SingletonAppleSignInButtonProps = AppleSignInDivProps & { | ||
isFocused: boolean; | ||
}; | ||
type SingletonAppleSignInButtonProps = AppleSignInDivProps; | ||
|
||
type AppleSignInProps = WithNavigationFocusProps & { | ||
type AppleSignInProps = { | ||
isDesktopFlow?: boolean; | ||
onPointerDown?: () => void; | ||
// eslint-disable-next-line react/no-unused-prop-types | ||
|
@@ -110,7 +107,8 @@ function AppleSignInDiv({isDesktopFlow, onPointerDown}: AppleSignInDivProps) { | |
// The Sign in with Apple script may fail to render button if there are multiple | ||
// of these divs present in the app, as it matches based on div id. So we'll | ||
// only mount the div when it should be visible. | ||
function SingletonAppleSignInButton({isFocused, isDesktopFlow, onPointerDown}: SingletonAppleSignInButtonProps) { | ||
function SingletonAppleSignInButton({isDesktopFlow, onPointerDown}: SingletonAppleSignInButtonProps) { | ||
const isFocused = useIsFocused(); | ||
if (!isFocused) { | ||
return null; | ||
} | ||
|
@@ -122,9 +120,6 @@ function SingletonAppleSignInButton({isFocused, isDesktopFlow, onPointerDown}: S | |
); | ||
} | ||
|
||
// withNavigationFocus is used to only render the button when it is visible. | ||
const SingletonAppleSignInButtonWithFocus = withNavigationFocus(SingletonAppleSignInButton); | ||
|
||
function AppleSignIn({isDesktopFlow = false, onPointerDown}: AppleSignInProps) { | ||
const [scriptLoaded, setScriptLoaded] = useState(false); | ||
useEffect(() => { | ||
|
@@ -146,13 +141,13 @@ function AppleSignIn({isDesktopFlow = false, onPointerDown}: AppleSignInProps) { | |
} | ||
|
||
return ( | ||
<SingletonAppleSignInButtonWithFocus | ||
<SingletonAppleSignInButton | ||
isDesktopFlow={isDesktopFlow} | ||
onPointerDown={onPointerDown} | ||
/> | ||
); | ||
} | ||
|
||
AppleSignIn.displayName = 'AppleSignIn'; | ||
export default withNavigationFocus(AppleSignIn); | ||
export default AppleSignIn; | ||
export type {AppleSignInProps}; |
This file was deleted.
Oops, something went wrong.
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