-
Notifications
You must be signed in to change notification settings - Fork 283
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
Showing
18 changed files
with
3,001 additions
and
562 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
module.exports = { | ||
root: true, | ||
extends: ['@clerk/custom/node', '@clerk/custom/typescript', '@clerk/custom/jest', '@clerk/custom/react'], | ||
settings: { | ||
'import/ignore': ['node_modules/react-native/index\\.js$'], | ||
}, | ||
}; |
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 @@ | ||
export { ClerkLoaded, ClerkLoading, SignedIn, SignedOut } from '@clerk/clerk-react'; |
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,2 @@ | ||
export * from './controlComponents'; | ||
export * from './uiComponents'; |
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,30 @@ | ||
import { | ||
OrganizationList as BaseOrganizationList, | ||
OrganizationProfile as BaseOrganizationProfile, | ||
OrganizationSwitcher as BaseOrganizationSwitcher, | ||
SignIn as BaseSignIn, | ||
SignUp as BaseSignUp, | ||
UserButton as BaseUserButton, | ||
} from '@clerk/clerk-react'; | ||
import React from 'react'; | ||
import { Platform, Text } from 'react-native'; | ||
|
||
const ErrorComponent = () => { | ||
return <Text>Component not supported on ths platform</Text>; | ||
}; | ||
|
||
function WrapComponent<T extends { displayName: string }>(component: T) { | ||
// @ts-expect-error - This is a hack to make the function signature match the original | ||
return Platform.select<T>({ | ||
// @ts-expect-error - This is a hack to make the function signature match the original | ||
native: () => ErrorComponent, | ||
default: () => component, | ||
})(); | ||
} | ||
|
||
export const SignIn: typeof BaseSignIn = WrapComponent(BaseSignIn); | ||
export const SignUp: typeof BaseSignUp = WrapComponent(BaseSignUp); | ||
export const UserButton: typeof BaseUserButton = WrapComponent(BaseUserButton); | ||
export const OrganizationProfile: typeof BaseOrganizationProfile = WrapComponent(BaseOrganizationProfile); | ||
export const OrganizationSwitcher: typeof BaseOrganizationSwitcher = WrapComponent(BaseOrganizationSwitcher); | ||
export const OrganizationList: typeof BaseOrganizationList = WrapComponent(BaseOrganizationList); |
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,14 @@ | ||
export { | ||
useAuth, | ||
useClerk, | ||
useEmailLink, | ||
useOrganization, | ||
useOrganizationList, | ||
useSession, | ||
useSessionList, | ||
useSignIn, | ||
useSignUp, | ||
useUser, | ||
} from '@clerk/clerk-react'; | ||
|
||
export * from './useOAuth'; |
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 @@ | ||
export * from './useOAuthImpl'; |
File renamed without changes.
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,13 @@ | ||
import type { OAuthStrategy } from '@clerk/types'; | ||
import { Platform } from 'react-native'; | ||
|
||
export type UseOAuthFlowParams = { | ||
strategy: OAuthStrategy; | ||
redirectUrl?: string; | ||
unsafeMetadata?: SignUpUnsafeMetadata; | ||
}; | ||
export function useOAuth(_useOAuthParams: UseOAuthFlowParams) { | ||
if (Platform.OS === 'web') { | ||
throw new Error('OAuth flow is not supported in web'); | ||
} | ||
} |
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,28 +1,12 @@ | ||
export { | ||
ClerkLoaded, | ||
ClerkLoading, | ||
SignedIn, | ||
SignedOut, | ||
useAuth, | ||
useClerk, | ||
useEmailLink, | ||
useOrganization, | ||
useOrganizationList, | ||
useSession, | ||
useSessionList, | ||
useSignIn, | ||
useSignUp, | ||
useUser, | ||
} from '@clerk/clerk-react'; | ||
import { setErrorThrowerOptions } from '@clerk/clerk-react/internal'; | ||
|
||
export { isClerkAPIResponseError, isEmailLinkError, isKnownError, isMetamaskError } from '@clerk/clerk-react/errors'; | ||
|
||
export { clerk as Clerk } from './singleton'; | ||
|
||
export * from './ClerkProvider'; | ||
export * from './useOAuth'; | ||
export * from './hooks'; | ||
export * from './components'; | ||
|
||
// Override Clerk React error thrower to show that errors come from @clerk/clerk-expo | ||
import { setErrorThrowerOptions } from '@clerk/clerk-react/internal'; | ||
|
||
setErrorThrowerOptions({ packageName: PACKAGE_NAME }); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { buildErrorThrower } from '@clerk/shared/error'; | ||
|
||
export const errorThrower = buildErrorThrower({ packageName: PACKAGE_NAME }); |
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,2 @@ | ||
export * from './errors'; | ||
export * from './runtime'; |
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,18 @@ | ||
import { Platform } from 'react-native'; | ||
|
||
export function isWeb(): boolean { | ||
return Platform.OS === 'web'; | ||
} | ||
|
||
export function isNative(): boolean { | ||
return Platform.OS !== 'web'; | ||
} | ||
|
||
export function isHermes() { | ||
//@ts-expect-error HermesInternal is added only added by the Hermes JS Engine | ||
return !!global.HermesInternal; | ||
} | ||
|
||
export function reactNativeVersion() { | ||
return Platform.constants.reactNativeVersion; | ||
} |
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