@dubsdotapp/expo 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +30 -46
- package/dist/index.d.ts +30 -46
- package/dist/index.js +50 -51
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +187 -187
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/hooks/useArcadeBridge.ts +4 -9
- package/src/index.ts +1 -1
- package/src/ui/AuthGate.tsx +0 -27
- package/src/ui/ConnectWalletButton.tsx +79 -74
- package/src/ui/index.ts +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -662,14 +662,6 @@ interface RegistrationScreenProps {
|
|
|
662
662
|
error: Error | null;
|
|
663
663
|
client: DubsClient;
|
|
664
664
|
}
|
|
665
|
-
interface ConnectWalletScreenProps$1 {
|
|
666
|
-
/** Call this to trigger the wallet connection flow */
|
|
667
|
-
onConnect: () => void;
|
|
668
|
-
/** True while the wallet is connecting/signing */
|
|
669
|
-
connecting: boolean;
|
|
670
|
-
/** Error from a failed connection attempt */
|
|
671
|
-
error: Error | null;
|
|
672
|
-
}
|
|
673
665
|
interface AuthGateProps {
|
|
674
666
|
children: React$1.ReactNode;
|
|
675
667
|
onSaveToken: (token: string | null) => void | Promise<void>;
|
|
@@ -677,17 +669,11 @@ interface AuthGateProps {
|
|
|
677
669
|
renderLoading?: (status: AuthStatus) => React$1.ReactNode;
|
|
678
670
|
renderError?: (error: Error, retry: () => void) => React$1.ReactNode;
|
|
679
671
|
renderRegistration?: (props: RegistrationScreenProps) => React$1.ReactNode;
|
|
680
|
-
/**
|
|
681
|
-
* Render your own connect-wallet screen.
|
|
682
|
-
* Receives { onConnect, connecting, error }.
|
|
683
|
-
* If omitted, the default ConnectWalletScreen is shown.
|
|
684
|
-
*/
|
|
685
|
-
renderConnectWallet?: (props: ConnectWalletScreenProps$1) => React$1.ReactNode;
|
|
686
672
|
appName?: string;
|
|
687
673
|
/** Override accent color for registration screens (from developer UI config) */
|
|
688
674
|
accentColor?: string;
|
|
689
675
|
}
|
|
690
|
-
declare function AuthGate({ children, onSaveToken, onLoadToken, renderLoading, renderError, renderRegistration,
|
|
676
|
+
declare function AuthGate({ children, onSaveToken, onLoadToken, renderLoading, renderError, renderRegistration, appName, accentColor, }: AuthGateProps): react_jsx_runtime.JSX.Element;
|
|
691
677
|
|
|
692
678
|
interface ConnectWalletScreenProps {
|
|
693
679
|
/** Called when the user taps Connect Wallet */
|
|
@@ -1165,42 +1151,40 @@ interface UseArcadeBridgeResult {
|
|
|
1165
1151
|
declare function useArcadeBridge({ canPlay, startAttempt, submitScore, onScoreSubmitted, onError, }: UseArcadeBridgeOptions): UseArcadeBridgeResult;
|
|
1166
1152
|
|
|
1167
1153
|
interface ConnectWalletButtonProps {
|
|
1168
|
-
/**
|
|
1169
|
-
|
|
1170
|
-
/**
|
|
1154
|
+
/** Called when the user taps the button */
|
|
1155
|
+
onConnect: () => void | Promise<void>;
|
|
1156
|
+
/** Show a loading spinner while connecting */
|
|
1157
|
+
connecting?: boolean;
|
|
1158
|
+
/** Error message to display below the button */
|
|
1159
|
+
error?: string | null;
|
|
1160
|
+
/** Override accent color (e.g. from developer UI config) */
|
|
1171
1161
|
accentColor?: string;
|
|
1172
|
-
/** Override
|
|
1173
|
-
|
|
1174
|
-
/**
|
|
1175
|
-
|
|
1176
|
-
/**
|
|
1177
|
-
|
|
1178
|
-
/** Override font size */
|
|
1179
|
-
fontSize?: number;
|
|
1180
|
-
/** Full width. Defaults to true */
|
|
1181
|
-
fullWidth?: boolean;
|
|
1182
|
-
/** Called after authenticate() is triggered (not after it completes) */
|
|
1183
|
-
onPress?: () => void;
|
|
1162
|
+
/** Override button label. Defaults to "Connect Wallet" */
|
|
1163
|
+
label?: string;
|
|
1164
|
+
/** Additional style applied to the outer container */
|
|
1165
|
+
style?: ViewStyle;
|
|
1166
|
+
/** Additional style applied to the button itself */
|
|
1167
|
+
buttonStyle?: ViewStyle;
|
|
1184
1168
|
}
|
|
1185
1169
|
/**
|
|
1186
|
-
*
|
|
1187
|
-
*
|
|
1188
|
-
*
|
|
1189
|
-
* Use this when you want to own the connect-wallet screen UI (e.g. inside
|
|
1190
|
-
* your own onboarding) but still hand off the wallet picker, signing, and
|
|
1191
|
-
* registration flow to the SDK.
|
|
1170
|
+
* Drop-in wallet connect button that triggers the same MWA / Phantom
|
|
1171
|
+
* connection flow as ConnectWalletScreen, but renders as a single button
|
|
1172
|
+
* instead of a full-screen layout.
|
|
1192
1173
|
*
|
|
1193
|
-
*
|
|
1194
|
-
*
|
|
1174
|
+
* Use with `renderConnectScreen` on DubsProvider to embed the button
|
|
1175
|
+
* inside your own custom onboarding or home screen:
|
|
1195
1176
|
*
|
|
1196
|
-
*
|
|
1197
|
-
*
|
|
1198
|
-
*
|
|
1199
|
-
*
|
|
1200
|
-
*
|
|
1201
|
-
*
|
|
1177
|
+
* ```tsx
|
|
1178
|
+
* <DubsProvider
|
|
1179
|
+
* renderConnectScreen={({ onConnect, connecting, error }) => (
|
|
1180
|
+
* <MyScreen>
|
|
1181
|
+
* <ConnectWalletButton onConnect={onConnect} connecting={connecting} error={error} />
|
|
1182
|
+
* </MyScreen>
|
|
1183
|
+
* )}
|
|
1184
|
+
* >
|
|
1185
|
+
* ```
|
|
1202
1186
|
*/
|
|
1203
|
-
declare function ConnectWalletButton({
|
|
1187
|
+
declare function ConnectWalletButton({ onConnect, connecting, error, accentColor, label, style, buttonStyle, }: ConnectWalletButtonProps): react_jsx_runtime.JSX.Element;
|
|
1204
1188
|
|
|
1205
1189
|
interface UserProfileCardProps {
|
|
1206
1190
|
walletAddress: string;
|
|
@@ -1426,4 +1410,4 @@ declare function signAndSendBase64Transaction(base64Tx: string, wallet: WalletAd
|
|
|
1426
1410
|
*/
|
|
1427
1411
|
declare function ensurePngAvatar(url: string | null | undefined): string | undefined;
|
|
1428
1412
|
|
|
1429
|
-
export { type ArcadeAttempt, type ArcadeCountdown, type ArcadeEntry, type ArcadeLeaderboardEntry, ArcadeLeaderboardSheet, type ArcadeLeaderboardSheetProps, type ArcadePool, type ArcadePoolStats, AuthGate, type
|
|
1413
|
+
export { type ArcadeAttempt, type ArcadeCountdown, type ArcadeEntry, type ArcadeLeaderboardEntry, ArcadeLeaderboardSheet, type ArcadeLeaderboardSheetProps, type ArcadePool, type ArcadePoolStats, AuthGate, type AuthGateProps, type AuthStatus, type AuthenticateParams, type AuthenticateResult, type Bettor, type BuildArcadeEntryResult, type BuildClaimParams, type BuildClaimResult, type CheckUsernameResult, ClaimButton, type ClaimButtonProps, type ClaimMutationResult, ClaimPrizeSheet, type ClaimPrizeSheetProps, type ClaimStatus, type ConfirmClaimParams, type ConfirmClaimResult, type ConfirmGameParams, type ConfirmGameResult, ConnectWalletButton, type ConnectWalletButtonProps, ConnectWalletScreen, type ConnectWalletScreenProps, type CreateCustomGameMutationResult, type CreateCustomGameParams, type CreateCustomGameResult, CreateCustomGameSheet, type CreateCustomGameSheetProps, type CreateGameMutationResult, type CreateGameParams, type CreateGameResult, DEFAULT_BASE_URL, DEFAULT_RPC_URL, type DeviceInfo, DubsApiError, type DubsAppUser, DubsClient, type DubsClientConfig, type DubsContextValue, type DubsNetwork, DubsProvider, type DubsProviderProps, type DubsPublicUser, type DubsTheme, type DubsUser, type EnterArcadePoolMutationResult, type EnterArcadePoolResult, EnterArcadePoolSheet, type EnterArcadePoolSheetProps, type EsportsMatchDetail, type EsportsMatchOpponent, type EsportsMatchResult, type EventMedia, type EventMeta, type EventStream, type GameDetail, type GameListItem, type GameListOpponent, type GameMedia, GamePoster, type GamePosterProps, type GetGamesParams, type GetNetworkGamesParams, type GetUpcomingEventsParams, JoinGameButton, type JoinGameButtonProps, type JoinGameMutationResult, type JoinGameParams, type JoinGameResult, JoinGameSheet, type JoinGameSheetProps, LivePoolsCard, type LivePoolsCardProps, type LiveScore, type LiveScoreCompetitor, type MutationResult, type MutationStatus, type MwaAdapterConfig, type MwaTransactFn, MwaWalletAdapter, NETWORK_CONFIG, type NonceResult, type Opponent, type Pagination, type ParsedError, PhantomDeeplinkAdapter, type PhantomDeeplinkAdapterConfig, type PhantomSession, PickWinnerCard, type PickWinnerCardProps, PlayersCard, type PlayersCardProps, type PushNotificationStatus, type QueryResult, type RegisterParams, type RegisterResult, type RegistrationScreenProps, SOLANA_PROGRAM_ERRORS, STORAGE_KEYS, SettingsSheet, type SettingsSheetProps, type SolanaErrorCode, type StartAttemptResult, type SubmitScoreResult, type TokenStorage, type UFCData, type UFCEvent, type UFCFight, type UFCFighter, type UFCFighterDetail, type UiConfig, type UnifiedEvent, type UseArcadeBridgeOptions, type UseArcadeBridgeResult, type UseArcadeGameResult, type UseArcadePoolResult, type UseArcadePoolsResult, type UseAuthResult, UserProfileCard, type UserProfileCardProps, UserProfileSheet, type UserProfileSheetProps, type ValidateEventResult, type WalletAdapter, createSecureStoreStorage, ensurePngAvatar, getDeviceInfo, isSolanaSeeker, mergeTheme, parseSolanaError, signAndSendBase64Transaction, useAppConfig, useArcadeBridge, useArcadeCountdown, useArcadeGame, useArcadePool, useArcadePools, useAuth, useClaim, useCreateCustomGame, useCreateGame, useDubs, useDubsTheme, useEnterArcadePool, useEvents, useGame, useGames, useHasClaimed, useJoinGame, useNetworkGames, usePushNotifications, useUFCFightCard, useUFCFighterDetail };
|
package/dist/index.d.ts
CHANGED
|
@@ -662,14 +662,6 @@ interface RegistrationScreenProps {
|
|
|
662
662
|
error: Error | null;
|
|
663
663
|
client: DubsClient;
|
|
664
664
|
}
|
|
665
|
-
interface ConnectWalletScreenProps$1 {
|
|
666
|
-
/** Call this to trigger the wallet connection flow */
|
|
667
|
-
onConnect: () => void;
|
|
668
|
-
/** True while the wallet is connecting/signing */
|
|
669
|
-
connecting: boolean;
|
|
670
|
-
/** Error from a failed connection attempt */
|
|
671
|
-
error: Error | null;
|
|
672
|
-
}
|
|
673
665
|
interface AuthGateProps {
|
|
674
666
|
children: React$1.ReactNode;
|
|
675
667
|
onSaveToken: (token: string | null) => void | Promise<void>;
|
|
@@ -677,17 +669,11 @@ interface AuthGateProps {
|
|
|
677
669
|
renderLoading?: (status: AuthStatus) => React$1.ReactNode;
|
|
678
670
|
renderError?: (error: Error, retry: () => void) => React$1.ReactNode;
|
|
679
671
|
renderRegistration?: (props: RegistrationScreenProps) => React$1.ReactNode;
|
|
680
|
-
/**
|
|
681
|
-
* Render your own connect-wallet screen.
|
|
682
|
-
* Receives { onConnect, connecting, error }.
|
|
683
|
-
* If omitted, the default ConnectWalletScreen is shown.
|
|
684
|
-
*/
|
|
685
|
-
renderConnectWallet?: (props: ConnectWalletScreenProps$1) => React$1.ReactNode;
|
|
686
672
|
appName?: string;
|
|
687
673
|
/** Override accent color for registration screens (from developer UI config) */
|
|
688
674
|
accentColor?: string;
|
|
689
675
|
}
|
|
690
|
-
declare function AuthGate({ children, onSaveToken, onLoadToken, renderLoading, renderError, renderRegistration,
|
|
676
|
+
declare function AuthGate({ children, onSaveToken, onLoadToken, renderLoading, renderError, renderRegistration, appName, accentColor, }: AuthGateProps): react_jsx_runtime.JSX.Element;
|
|
691
677
|
|
|
692
678
|
interface ConnectWalletScreenProps {
|
|
693
679
|
/** Called when the user taps Connect Wallet */
|
|
@@ -1165,42 +1151,40 @@ interface UseArcadeBridgeResult {
|
|
|
1165
1151
|
declare function useArcadeBridge({ canPlay, startAttempt, submitScore, onScoreSubmitted, onError, }: UseArcadeBridgeOptions): UseArcadeBridgeResult;
|
|
1166
1152
|
|
|
1167
1153
|
interface ConnectWalletButtonProps {
|
|
1168
|
-
/**
|
|
1169
|
-
|
|
1170
|
-
/**
|
|
1154
|
+
/** Called when the user taps the button */
|
|
1155
|
+
onConnect: () => void | Promise<void>;
|
|
1156
|
+
/** Show a loading spinner while connecting */
|
|
1157
|
+
connecting?: boolean;
|
|
1158
|
+
/** Error message to display below the button */
|
|
1159
|
+
error?: string | null;
|
|
1160
|
+
/** Override accent color (e.g. from developer UI config) */
|
|
1171
1161
|
accentColor?: string;
|
|
1172
|
-
/** Override
|
|
1173
|
-
|
|
1174
|
-
/**
|
|
1175
|
-
|
|
1176
|
-
/**
|
|
1177
|
-
|
|
1178
|
-
/** Override font size */
|
|
1179
|
-
fontSize?: number;
|
|
1180
|
-
/** Full width. Defaults to true */
|
|
1181
|
-
fullWidth?: boolean;
|
|
1182
|
-
/** Called after authenticate() is triggered (not after it completes) */
|
|
1183
|
-
onPress?: () => void;
|
|
1162
|
+
/** Override button label. Defaults to "Connect Wallet" */
|
|
1163
|
+
label?: string;
|
|
1164
|
+
/** Additional style applied to the outer container */
|
|
1165
|
+
style?: ViewStyle;
|
|
1166
|
+
/** Additional style applied to the button itself */
|
|
1167
|
+
buttonStyle?: ViewStyle;
|
|
1184
1168
|
}
|
|
1185
1169
|
/**
|
|
1186
|
-
*
|
|
1187
|
-
*
|
|
1188
|
-
*
|
|
1189
|
-
* Use this when you want to own the connect-wallet screen UI (e.g. inside
|
|
1190
|
-
* your own onboarding) but still hand off the wallet picker, signing, and
|
|
1191
|
-
* registration flow to the SDK.
|
|
1170
|
+
* Drop-in wallet connect button that triggers the same MWA / Phantom
|
|
1171
|
+
* connection flow as ConnectWalletScreen, but renders as a single button
|
|
1172
|
+
* instead of a full-screen layout.
|
|
1192
1173
|
*
|
|
1193
|
-
*
|
|
1194
|
-
*
|
|
1174
|
+
* Use with `renderConnectScreen` on DubsProvider to embed the button
|
|
1175
|
+
* inside your own custom onboarding or home screen:
|
|
1195
1176
|
*
|
|
1196
|
-
*
|
|
1197
|
-
*
|
|
1198
|
-
*
|
|
1199
|
-
*
|
|
1200
|
-
*
|
|
1201
|
-
*
|
|
1177
|
+
* ```tsx
|
|
1178
|
+
* <DubsProvider
|
|
1179
|
+
* renderConnectScreen={({ onConnect, connecting, error }) => (
|
|
1180
|
+
* <MyScreen>
|
|
1181
|
+
* <ConnectWalletButton onConnect={onConnect} connecting={connecting} error={error} />
|
|
1182
|
+
* </MyScreen>
|
|
1183
|
+
* )}
|
|
1184
|
+
* >
|
|
1185
|
+
* ```
|
|
1202
1186
|
*/
|
|
1203
|
-
declare function ConnectWalletButton({
|
|
1187
|
+
declare function ConnectWalletButton({ onConnect, connecting, error, accentColor, label, style, buttonStyle, }: ConnectWalletButtonProps): react_jsx_runtime.JSX.Element;
|
|
1204
1188
|
|
|
1205
1189
|
interface UserProfileCardProps {
|
|
1206
1190
|
walletAddress: string;
|
|
@@ -1426,4 +1410,4 @@ declare function signAndSendBase64Transaction(base64Tx: string, wallet: WalletAd
|
|
|
1426
1410
|
*/
|
|
1427
1411
|
declare function ensurePngAvatar(url: string | null | undefined): string | undefined;
|
|
1428
1412
|
|
|
1429
|
-
export { type ArcadeAttempt, type ArcadeCountdown, type ArcadeEntry, type ArcadeLeaderboardEntry, ArcadeLeaderboardSheet, type ArcadeLeaderboardSheetProps, type ArcadePool, type ArcadePoolStats, AuthGate, type
|
|
1413
|
+
export { type ArcadeAttempt, type ArcadeCountdown, type ArcadeEntry, type ArcadeLeaderboardEntry, ArcadeLeaderboardSheet, type ArcadeLeaderboardSheetProps, type ArcadePool, type ArcadePoolStats, AuthGate, type AuthGateProps, type AuthStatus, type AuthenticateParams, type AuthenticateResult, type Bettor, type BuildArcadeEntryResult, type BuildClaimParams, type BuildClaimResult, type CheckUsernameResult, ClaimButton, type ClaimButtonProps, type ClaimMutationResult, ClaimPrizeSheet, type ClaimPrizeSheetProps, type ClaimStatus, type ConfirmClaimParams, type ConfirmClaimResult, type ConfirmGameParams, type ConfirmGameResult, ConnectWalletButton, type ConnectWalletButtonProps, ConnectWalletScreen, type ConnectWalletScreenProps, type CreateCustomGameMutationResult, type CreateCustomGameParams, type CreateCustomGameResult, CreateCustomGameSheet, type CreateCustomGameSheetProps, type CreateGameMutationResult, type CreateGameParams, type CreateGameResult, DEFAULT_BASE_URL, DEFAULT_RPC_URL, type DeviceInfo, DubsApiError, type DubsAppUser, DubsClient, type DubsClientConfig, type DubsContextValue, type DubsNetwork, DubsProvider, type DubsProviderProps, type DubsPublicUser, type DubsTheme, type DubsUser, type EnterArcadePoolMutationResult, type EnterArcadePoolResult, EnterArcadePoolSheet, type EnterArcadePoolSheetProps, type EsportsMatchDetail, type EsportsMatchOpponent, type EsportsMatchResult, type EventMedia, type EventMeta, type EventStream, type GameDetail, type GameListItem, type GameListOpponent, type GameMedia, GamePoster, type GamePosterProps, type GetGamesParams, type GetNetworkGamesParams, type GetUpcomingEventsParams, JoinGameButton, type JoinGameButtonProps, type JoinGameMutationResult, type JoinGameParams, type JoinGameResult, JoinGameSheet, type JoinGameSheetProps, LivePoolsCard, type LivePoolsCardProps, type LiveScore, type LiveScoreCompetitor, type MutationResult, type MutationStatus, type MwaAdapterConfig, type MwaTransactFn, MwaWalletAdapter, NETWORK_CONFIG, type NonceResult, type Opponent, type Pagination, type ParsedError, PhantomDeeplinkAdapter, type PhantomDeeplinkAdapterConfig, type PhantomSession, PickWinnerCard, type PickWinnerCardProps, PlayersCard, type PlayersCardProps, type PushNotificationStatus, type QueryResult, type RegisterParams, type RegisterResult, type RegistrationScreenProps, SOLANA_PROGRAM_ERRORS, STORAGE_KEYS, SettingsSheet, type SettingsSheetProps, type SolanaErrorCode, type StartAttemptResult, type SubmitScoreResult, type TokenStorage, type UFCData, type UFCEvent, type UFCFight, type UFCFighter, type UFCFighterDetail, type UiConfig, type UnifiedEvent, type UseArcadeBridgeOptions, type UseArcadeBridgeResult, type UseArcadeGameResult, type UseArcadePoolResult, type UseArcadePoolsResult, type UseAuthResult, UserProfileCard, type UserProfileCardProps, UserProfileSheet, type UserProfileSheetProps, type ValidateEventResult, type WalletAdapter, createSecureStoreStorage, ensurePngAvatar, getDeviceInfo, isSolanaSeeker, mergeTheme, parseSolanaError, signAndSendBase64Transaction, useAppConfig, useArcadeBridge, useArcadeCountdown, useArcadeGame, useArcadePool, useArcadePools, useAuth, useClaim, useCreateCustomGame, useCreateGame, useDubs, useDubsTheme, useEnterArcadePool, useEvents, useGame, useGames, useHasClaimed, useJoinGame, useNetworkGames, usePushNotifications, useUFCFightCard, useUFCFighterDetail };
|
package/dist/index.js
CHANGED
|
@@ -2857,8 +2857,6 @@ function useArcadeBridge({
|
|
|
2857
2857
|
const webviewRef = (0, import_react22.useRef)(null);
|
|
2858
2858
|
const sessionTokenRef = (0, import_react22.useRef)(null);
|
|
2859
2859
|
const gameStartTimeRef = (0, import_react22.useRef)(0);
|
|
2860
|
-
const canPlayRef = (0, import_react22.useRef)(canPlay);
|
|
2861
|
-
canPlayRef.current = canPlay;
|
|
2862
2860
|
const [lastResult, setLastResult] = (0, import_react22.useState)(null);
|
|
2863
2861
|
const [bridgeLoading, setBridgeLoading] = (0, import_react22.useState)(false);
|
|
2864
2862
|
const injectSession = (0, import_react22.useCallback)((token, attemptNumber) => {
|
|
@@ -2894,10 +2892,10 @@ function useArcadeBridge({
|
|
|
2894
2892
|
} catch {
|
|
2895
2893
|
return;
|
|
2896
2894
|
}
|
|
2897
|
-
if (data.dubsArcade !==
|
|
2895
|
+
if (data.dubsArcade !== PROTOCOL_VERSION) return;
|
|
2898
2896
|
switch (data.type) {
|
|
2899
2897
|
case "TAP_PLAY": {
|
|
2900
|
-
if (
|
|
2898
|
+
if (canPlay) {
|
|
2901
2899
|
triggerPlay();
|
|
2902
2900
|
}
|
|
2903
2901
|
return;
|
|
@@ -2926,7 +2924,7 @@ function useArcadeBridge({
|
|
|
2926
2924
|
return;
|
|
2927
2925
|
}
|
|
2928
2926
|
},
|
|
2929
|
-
[triggerPlay, submitScore, onScoreSubmitted, onError]
|
|
2927
|
+
[canPlay, triggerPlay, submitScore, onScoreSubmitted, onError]
|
|
2930
2928
|
);
|
|
2931
2929
|
return { webviewRef, handleMessage, triggerPlay, lastResult, bridgeLoading };
|
|
2932
2930
|
}
|
|
@@ -3086,7 +3084,6 @@ function AuthGate({
|
|
|
3086
3084
|
renderLoading,
|
|
3087
3085
|
renderError,
|
|
3088
3086
|
renderRegistration,
|
|
3089
|
-
renderConnectWallet,
|
|
3090
3087
|
appName = "Dubs",
|
|
3091
3088
|
accentColor
|
|
3092
3089
|
}) {
|
|
@@ -3187,14 +3184,6 @@ function AuthGate({
|
|
|
3187
3184
|
if (renderError) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: renderError(auth.error, retry) });
|
|
3188
3185
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DefaultErrorScreen, { error: auth.error, onRetry: retry, appName, accentColor });
|
|
3189
3186
|
}
|
|
3190
|
-
if (auth.status === "idle") {
|
|
3191
|
-
const connectProps = {
|
|
3192
|
-
onConnect: auth.authenticate,
|
|
3193
|
-
connecting: false,
|
|
3194
|
-
error: null
|
|
3195
|
-
};
|
|
3196
|
-
if (renderConnectWallet) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: renderConnectWallet(connectProps) });
|
|
3197
|
-
}
|
|
3198
3187
|
if (renderLoading) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: renderLoading(auth.status) });
|
|
3199
3188
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DefaultLoadingScreen, { status: auth.status, appName, accentColor });
|
|
3200
3189
|
}
|
|
@@ -3897,52 +3886,62 @@ function useAppConfig() {
|
|
|
3897
3886
|
var import_react_native9 = require("react-native");
|
|
3898
3887
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
3899
3888
|
function ConnectWalletButton({
|
|
3900
|
-
|
|
3889
|
+
onConnect,
|
|
3890
|
+
connecting = false,
|
|
3891
|
+
error = null,
|
|
3901
3892
|
accentColor,
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
fontSize = 17,
|
|
3906
|
-
fullWidth = true,
|
|
3907
|
-
onPress
|
|
3893
|
+
label = "Connect Wallet",
|
|
3894
|
+
style,
|
|
3895
|
+
buttonStyle
|
|
3908
3896
|
}) {
|
|
3909
3897
|
const t = useDubsTheme();
|
|
3910
|
-
const { authenticate, status } = useAuth();
|
|
3911
|
-
const connecting = status === "authenticating" || status === "signing" || status === "verifying";
|
|
3912
3898
|
const accent = accentColor || t.accent;
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
}
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
);
|
|
3899
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react_native9.View, { style, children: [
|
|
3900
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3901
|
+
import_react_native9.View,
|
|
3902
|
+
{
|
|
3903
|
+
style: [
|
|
3904
|
+
styles3.errorBox,
|
|
3905
|
+
{ backgroundColor: t.errorBg, borderColor: t.errorBorder }
|
|
3906
|
+
],
|
|
3907
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native9.Text, { style: [styles3.errorText, { color: t.errorText }], children: error })
|
|
3908
|
+
}
|
|
3909
|
+
) : null,
|
|
3910
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3911
|
+
import_react_native9.TouchableOpacity,
|
|
3912
|
+
{
|
|
3913
|
+
style: [styles3.button, { backgroundColor: accent }, buttonStyle],
|
|
3914
|
+
onPress: onConnect,
|
|
3915
|
+
disabled: connecting,
|
|
3916
|
+
activeOpacity: 0.8,
|
|
3917
|
+
children: connecting ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native9.ActivityIndicator, { color: "#FFFFFF", size: "small" }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native9.Text, { style: styles3.buttonText, children: label })
|
|
3918
|
+
}
|
|
3919
|
+
)
|
|
3920
|
+
] });
|
|
3936
3921
|
}
|
|
3937
3922
|
var styles3 = import_react_native9.StyleSheet.create({
|
|
3938
|
-
|
|
3939
|
-
|
|
3923
|
+
button: {
|
|
3924
|
+
height: 56,
|
|
3925
|
+
borderRadius: 16,
|
|
3940
3926
|
justifyContent: "center",
|
|
3927
|
+
alignItems: "center",
|
|
3941
3928
|
paddingHorizontal: 24
|
|
3942
3929
|
},
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3930
|
+
buttonText: {
|
|
3931
|
+
color: "#FFFFFF",
|
|
3932
|
+
fontSize: 18,
|
|
3933
|
+
fontWeight: "700"
|
|
3934
|
+
},
|
|
3935
|
+
errorBox: {
|
|
3936
|
+
borderWidth: 1,
|
|
3937
|
+
borderRadius: 12,
|
|
3938
|
+
paddingHorizontal: 16,
|
|
3939
|
+
paddingVertical: 12,
|
|
3940
|
+
marginBottom: 12
|
|
3941
|
+
},
|
|
3942
|
+
errorText: {
|
|
3943
|
+
fontSize: 14,
|
|
3944
|
+
textAlign: "center"
|
|
3946
3945
|
}
|
|
3947
3946
|
});
|
|
3948
3947
|
|