@dubsdotapp/expo 0.2.0 → 0.2.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 +22 -4
- package/dist/index.d.ts +22 -4
- package/dist/index.js +71 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +86 -35
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +9 -0
- package/src/index.ts +2 -1
- package/src/managed-wallet.tsx +10 -0
- package/src/provider.tsx +22 -5
- package/src/types.ts +9 -0
- package/src/ui/AuthGate.tsx +16 -10
- package/src/ui/ConnectWalletScreen.tsx +31 -5
- package/src/ui/index.ts +1 -1
- package/src/ui/theme.ts +5 -0
package/dist/index.d.mts
CHANGED
|
@@ -286,6 +286,12 @@ interface LiveScore {
|
|
|
286
286
|
statusDetail: string;
|
|
287
287
|
};
|
|
288
288
|
}
|
|
289
|
+
interface UiConfig {
|
|
290
|
+
accentColor?: string;
|
|
291
|
+
appIcon?: string;
|
|
292
|
+
appName?: string;
|
|
293
|
+
tagline?: string;
|
|
294
|
+
}
|
|
289
295
|
|
|
290
296
|
interface DubsClientConfig {
|
|
291
297
|
apiKey: string;
|
|
@@ -347,6 +353,8 @@ declare class DubsClient {
|
|
|
347
353
|
parseErrorLocal(error: unknown): ParsedError;
|
|
348
354
|
/** Get the full local error code map */
|
|
349
355
|
getErrorCodesLocal(): Record<number, SolanaErrorCode>;
|
|
356
|
+
/** Fetch the app's UI customization config (accent color, icon, tagline) */
|
|
357
|
+
getAppConfig(): Promise<UiConfig>;
|
|
350
358
|
}
|
|
351
359
|
|
|
352
360
|
declare class DubsApiError extends Error {
|
|
@@ -430,8 +438,10 @@ interface AuthGateProps {
|
|
|
430
438
|
renderError?: (error: Error, retry: () => void) => React$1.ReactNode;
|
|
431
439
|
renderRegistration?: (props: RegistrationScreenProps) => React$1.ReactNode;
|
|
432
440
|
appName?: string;
|
|
441
|
+
/** Override accent color for registration screens (from developer UI config) */
|
|
442
|
+
accentColor?: string;
|
|
433
443
|
}
|
|
434
|
-
declare function AuthGate({ children, onSaveToken, onLoadToken, renderLoading, renderError, renderRegistration, appName, }: AuthGateProps): react_jsx_runtime.JSX.Element;
|
|
444
|
+
declare function AuthGate({ children, onSaveToken, onLoadToken, renderLoading, renderError, renderRegistration, appName, accentColor, }: AuthGateProps): react_jsx_runtime.JSX.Element;
|
|
435
445
|
|
|
436
446
|
interface ConnectWalletScreenProps {
|
|
437
447
|
/** Called when the user taps Connect Wallet */
|
|
@@ -442,8 +452,14 @@ interface ConnectWalletScreenProps {
|
|
|
442
452
|
error?: string | null;
|
|
443
453
|
/** App name shown in the header. Defaults to "Dubs" */
|
|
444
454
|
appName?: string;
|
|
445
|
-
|
|
446
|
-
|
|
455
|
+
/** Override accent color (e.g. from developer UI config) */
|
|
456
|
+
accentColor?: string;
|
|
457
|
+
/** URL to app icon — renders as Image instead of the default letter circle */
|
|
458
|
+
appIcon?: string;
|
|
459
|
+
/** Override subtitle text below app name */
|
|
460
|
+
tagline?: string;
|
|
461
|
+
}
|
|
462
|
+
declare function ConnectWalletScreen({ onConnect, connecting, error, appName, accentColor, appIcon, tagline, }: ConnectWalletScreenProps): react_jsx_runtime.JSX.Element;
|
|
447
463
|
|
|
448
464
|
interface DubsContextValue {
|
|
449
465
|
client: DubsClient;
|
|
@@ -658,6 +674,8 @@ interface DubsTheme {
|
|
|
658
674
|
errorBorder: string;
|
|
659
675
|
}
|
|
660
676
|
declare function useDubsTheme(): DubsTheme;
|
|
677
|
+
/** Merge overrides into a base theme (e.g. custom accent color from developer config) */
|
|
678
|
+
declare function mergeTheme(base: DubsTheme, overrides: Partial<DubsTheme>): DubsTheme;
|
|
661
679
|
|
|
662
680
|
interface GamePosterProps {
|
|
663
681
|
game: GameDetail;
|
|
@@ -735,4 +753,4 @@ declare function JoinGameButton({ game, walletAddress, selectedTeam, status, onJ
|
|
|
735
753
|
*/
|
|
736
754
|
declare function signAndSendBase64Transaction(base64Tx: string, wallet: WalletAdapter): Promise<string>;
|
|
737
755
|
|
|
738
|
-
export { AuthGate, type AuthGateProps, type AuthStatus, type AuthenticateParams, type AuthenticateResult, type Bettor, type BuildClaimParams, type BuildClaimResult, type CheckUsernameResult, type ClaimMutationResult, type ConfirmGameParams, type ConfirmGameResult, ConnectWalletScreen, type ConnectWalletScreenProps, type CreateGameMutationResult, type CreateGameParams, type CreateGameResult, DEFAULT_BASE_URL, DEFAULT_RPC_URL, DubsApiError, type DubsAppUser, DubsClient, type DubsClientConfig, type DubsContextValue, type DubsNetwork, DubsProvider, type DubsProviderProps, type DubsPublicUser, type DubsTheme, type DubsUser, 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, 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, PickWinnerCard, type PickWinnerCardProps, PlayersCard, type PlayersCardProps, type QueryResult, type RegisterParams, type RegisterResult, type RegistrationScreenProps, SOLANA_PROGRAM_ERRORS, STORAGE_KEYS, SettingsSheet, type SettingsSheetProps, type SolanaErrorCode, type TokenStorage, type UnifiedEvent, type UseAuthResult, UserProfileCard, type UserProfileCardProps, type ValidateEventResult, type WalletAdapter, createSecureStoreStorage, parseSolanaError, signAndSendBase64Transaction, useAuth, useClaim, useCreateGame, useDubs, useDubsTheme, useEvents, useGame, useGames, useJoinGame, useNetworkGames };
|
|
756
|
+
export { AuthGate, type AuthGateProps, type AuthStatus, type AuthenticateParams, type AuthenticateResult, type Bettor, type BuildClaimParams, type BuildClaimResult, type CheckUsernameResult, type ClaimMutationResult, type ConfirmGameParams, type ConfirmGameResult, ConnectWalletScreen, type ConnectWalletScreenProps, type CreateGameMutationResult, type CreateGameParams, type CreateGameResult, DEFAULT_BASE_URL, DEFAULT_RPC_URL, DubsApiError, type DubsAppUser, DubsClient, type DubsClientConfig, type DubsContextValue, type DubsNetwork, DubsProvider, type DubsProviderProps, type DubsPublicUser, type DubsTheme, type DubsUser, 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, 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, PickWinnerCard, type PickWinnerCardProps, PlayersCard, type PlayersCardProps, type QueryResult, type RegisterParams, type RegisterResult, type RegistrationScreenProps, SOLANA_PROGRAM_ERRORS, STORAGE_KEYS, SettingsSheet, type SettingsSheetProps, type SolanaErrorCode, type TokenStorage, type UiConfig, type UnifiedEvent, type UseAuthResult, UserProfileCard, type UserProfileCardProps, type ValidateEventResult, type WalletAdapter, createSecureStoreStorage, mergeTheme, parseSolanaError, signAndSendBase64Transaction, useAuth, useClaim, useCreateGame, useDubs, useDubsTheme, useEvents, useGame, useGames, useJoinGame, useNetworkGames };
|
package/dist/index.d.ts
CHANGED
|
@@ -286,6 +286,12 @@ interface LiveScore {
|
|
|
286
286
|
statusDetail: string;
|
|
287
287
|
};
|
|
288
288
|
}
|
|
289
|
+
interface UiConfig {
|
|
290
|
+
accentColor?: string;
|
|
291
|
+
appIcon?: string;
|
|
292
|
+
appName?: string;
|
|
293
|
+
tagline?: string;
|
|
294
|
+
}
|
|
289
295
|
|
|
290
296
|
interface DubsClientConfig {
|
|
291
297
|
apiKey: string;
|
|
@@ -347,6 +353,8 @@ declare class DubsClient {
|
|
|
347
353
|
parseErrorLocal(error: unknown): ParsedError;
|
|
348
354
|
/** Get the full local error code map */
|
|
349
355
|
getErrorCodesLocal(): Record<number, SolanaErrorCode>;
|
|
356
|
+
/** Fetch the app's UI customization config (accent color, icon, tagline) */
|
|
357
|
+
getAppConfig(): Promise<UiConfig>;
|
|
350
358
|
}
|
|
351
359
|
|
|
352
360
|
declare class DubsApiError extends Error {
|
|
@@ -430,8 +438,10 @@ interface AuthGateProps {
|
|
|
430
438
|
renderError?: (error: Error, retry: () => void) => React$1.ReactNode;
|
|
431
439
|
renderRegistration?: (props: RegistrationScreenProps) => React$1.ReactNode;
|
|
432
440
|
appName?: string;
|
|
441
|
+
/** Override accent color for registration screens (from developer UI config) */
|
|
442
|
+
accentColor?: string;
|
|
433
443
|
}
|
|
434
|
-
declare function AuthGate({ children, onSaveToken, onLoadToken, renderLoading, renderError, renderRegistration, appName, }: AuthGateProps): react_jsx_runtime.JSX.Element;
|
|
444
|
+
declare function AuthGate({ children, onSaveToken, onLoadToken, renderLoading, renderError, renderRegistration, appName, accentColor, }: AuthGateProps): react_jsx_runtime.JSX.Element;
|
|
435
445
|
|
|
436
446
|
interface ConnectWalletScreenProps {
|
|
437
447
|
/** Called when the user taps Connect Wallet */
|
|
@@ -442,8 +452,14 @@ interface ConnectWalletScreenProps {
|
|
|
442
452
|
error?: string | null;
|
|
443
453
|
/** App name shown in the header. Defaults to "Dubs" */
|
|
444
454
|
appName?: string;
|
|
445
|
-
|
|
446
|
-
|
|
455
|
+
/** Override accent color (e.g. from developer UI config) */
|
|
456
|
+
accentColor?: string;
|
|
457
|
+
/** URL to app icon — renders as Image instead of the default letter circle */
|
|
458
|
+
appIcon?: string;
|
|
459
|
+
/** Override subtitle text below app name */
|
|
460
|
+
tagline?: string;
|
|
461
|
+
}
|
|
462
|
+
declare function ConnectWalletScreen({ onConnect, connecting, error, appName, accentColor, appIcon, tagline, }: ConnectWalletScreenProps): react_jsx_runtime.JSX.Element;
|
|
447
463
|
|
|
448
464
|
interface DubsContextValue {
|
|
449
465
|
client: DubsClient;
|
|
@@ -658,6 +674,8 @@ interface DubsTheme {
|
|
|
658
674
|
errorBorder: string;
|
|
659
675
|
}
|
|
660
676
|
declare function useDubsTheme(): DubsTheme;
|
|
677
|
+
/** Merge overrides into a base theme (e.g. custom accent color from developer config) */
|
|
678
|
+
declare function mergeTheme(base: DubsTheme, overrides: Partial<DubsTheme>): DubsTheme;
|
|
661
679
|
|
|
662
680
|
interface GamePosterProps {
|
|
663
681
|
game: GameDetail;
|
|
@@ -735,4 +753,4 @@ declare function JoinGameButton({ game, walletAddress, selectedTeam, status, onJ
|
|
|
735
753
|
*/
|
|
736
754
|
declare function signAndSendBase64Transaction(base64Tx: string, wallet: WalletAdapter): Promise<string>;
|
|
737
755
|
|
|
738
|
-
export { AuthGate, type AuthGateProps, type AuthStatus, type AuthenticateParams, type AuthenticateResult, type Bettor, type BuildClaimParams, type BuildClaimResult, type CheckUsernameResult, type ClaimMutationResult, type ConfirmGameParams, type ConfirmGameResult, ConnectWalletScreen, type ConnectWalletScreenProps, type CreateGameMutationResult, type CreateGameParams, type CreateGameResult, DEFAULT_BASE_URL, DEFAULT_RPC_URL, DubsApiError, type DubsAppUser, DubsClient, type DubsClientConfig, type DubsContextValue, type DubsNetwork, DubsProvider, type DubsProviderProps, type DubsPublicUser, type DubsTheme, type DubsUser, 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, 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, PickWinnerCard, type PickWinnerCardProps, PlayersCard, type PlayersCardProps, type QueryResult, type RegisterParams, type RegisterResult, type RegistrationScreenProps, SOLANA_PROGRAM_ERRORS, STORAGE_KEYS, SettingsSheet, type SettingsSheetProps, type SolanaErrorCode, type TokenStorage, type UnifiedEvent, type UseAuthResult, UserProfileCard, type UserProfileCardProps, type ValidateEventResult, type WalletAdapter, createSecureStoreStorage, parseSolanaError, signAndSendBase64Transaction, useAuth, useClaim, useCreateGame, useDubs, useDubsTheme, useEvents, useGame, useGames, useJoinGame, useNetworkGames };
|
|
756
|
+
export { AuthGate, type AuthGateProps, type AuthStatus, type AuthenticateParams, type AuthenticateResult, type Bettor, type BuildClaimParams, type BuildClaimResult, type CheckUsernameResult, type ClaimMutationResult, type ConfirmGameParams, type ConfirmGameResult, ConnectWalletScreen, type ConnectWalletScreenProps, type CreateGameMutationResult, type CreateGameParams, type CreateGameResult, DEFAULT_BASE_URL, DEFAULT_RPC_URL, DubsApiError, type DubsAppUser, DubsClient, type DubsClientConfig, type DubsContextValue, type DubsNetwork, DubsProvider, type DubsProviderProps, type DubsPublicUser, type DubsTheme, type DubsUser, 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, 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, PickWinnerCard, type PickWinnerCardProps, PlayersCard, type PlayersCardProps, type QueryResult, type RegisterParams, type RegisterResult, type RegistrationScreenProps, SOLANA_PROGRAM_ERRORS, STORAGE_KEYS, SettingsSheet, type SettingsSheetProps, type SolanaErrorCode, type TokenStorage, type UiConfig, type UnifiedEvent, type UseAuthResult, UserProfileCard, type UserProfileCardProps, type ValidateEventResult, type WalletAdapter, createSecureStoreStorage, mergeTheme, parseSolanaError, signAndSendBase64Transaction, useAuth, useClaim, useCreateGame, useDubs, useDubsTheme, useEvents, useGame, useGames, useJoinGame, useNetworkGames };
|
package/dist/index.js
CHANGED
|
@@ -49,6 +49,7 @@ __export(index_exports, {
|
|
|
49
49
|
SettingsSheet: () => SettingsSheet,
|
|
50
50
|
UserProfileCard: () => UserProfileCard,
|
|
51
51
|
createSecureStoreStorage: () => createSecureStoreStorage,
|
|
52
|
+
mergeTheme: () => mergeTheme,
|
|
52
53
|
parseSolanaError: () => parseSolanaError,
|
|
53
54
|
signAndSendBase64Transaction: () => signAndSendBase64Transaction,
|
|
54
55
|
useAuth: () => useAuth,
|
|
@@ -476,6 +477,12 @@ var DubsClient = class {
|
|
|
476
477
|
getErrorCodesLocal() {
|
|
477
478
|
return { ...SOLANA_PROGRAM_ERRORS };
|
|
478
479
|
}
|
|
480
|
+
// ── App Config ──
|
|
481
|
+
/** Fetch the app's UI customization config (accent color, icon, tagline) */
|
|
482
|
+
async getAppConfig() {
|
|
483
|
+
const res = await this.request("GET", "/apps/config");
|
|
484
|
+
return res.uiConfig || {};
|
|
485
|
+
}
|
|
479
486
|
};
|
|
480
487
|
|
|
481
488
|
// src/storage.ts
|
|
@@ -659,6 +666,9 @@ function useDubsTheme() {
|
|
|
659
666
|
const scheme = (0, import_react_native.useColorScheme)();
|
|
660
667
|
return scheme === "light" ? light : dark;
|
|
661
668
|
}
|
|
669
|
+
function mergeTheme(base, overrides) {
|
|
670
|
+
return { ...base, ...overrides };
|
|
671
|
+
}
|
|
662
672
|
|
|
663
673
|
// src/ui/ConnectWalletScreen.tsx
|
|
664
674
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -666,14 +676,24 @@ function ConnectWalletScreen({
|
|
|
666
676
|
onConnect,
|
|
667
677
|
connecting = false,
|
|
668
678
|
error = null,
|
|
669
|
-
appName = "Dubs"
|
|
679
|
+
appName = "Dubs",
|
|
680
|
+
accentColor,
|
|
681
|
+
appIcon,
|
|
682
|
+
tagline
|
|
670
683
|
}) {
|
|
671
684
|
const t = useDubsTheme();
|
|
685
|
+
const accent = accentColor || t.accent;
|
|
672
686
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native2.View, { style: [styles.container, { backgroundColor: t.background }], children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native2.View, { style: styles.content, children: [
|
|
673
687
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native2.View, { style: styles.brandingSection, children: [
|
|
674
|
-
|
|
688
|
+
appIcon ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
689
|
+
import_react_native2.Image,
|
|
690
|
+
{
|
|
691
|
+
source: { uri: appIcon },
|
|
692
|
+
style: styles.logoImage
|
|
693
|
+
}
|
|
694
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native2.View, { style: [styles.logoCircle, { backgroundColor: accent }], children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native2.Text, { style: styles.logoText, children: appName.charAt(0).toUpperCase() }) }),
|
|
675
695
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native2.Text, { style: [styles.appName, { color: t.text }], children: appName }),
|
|
676
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native2.Text, { style: [styles.subtitle, { color: t.textMuted }], children: "Connect your Solana wallet to get started" })
|
|
696
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native2.Text, { style: [styles.subtitle, { color: t.textMuted }], children: tagline || "Connect your Solana wallet to get started" })
|
|
677
697
|
] }),
|
|
678
698
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native2.View, { style: styles.actionSection, children: [
|
|
679
699
|
error ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -689,7 +709,7 @@ function ConnectWalletScreen({
|
|
|
689
709
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
690
710
|
import_react_native2.TouchableOpacity,
|
|
691
711
|
{
|
|
692
|
-
style: [styles.connectButton, { backgroundColor:
|
|
712
|
+
style: [styles.connectButton, { backgroundColor: accent }],
|
|
693
713
|
onPress: onConnect,
|
|
694
714
|
disabled: connecting,
|
|
695
715
|
activeOpacity: 0.8,
|
|
@@ -724,6 +744,12 @@ var styles = import_react_native2.StyleSheet.create({
|
|
|
724
744
|
alignItems: "center",
|
|
725
745
|
marginBottom: 8
|
|
726
746
|
},
|
|
747
|
+
logoImage: {
|
|
748
|
+
width: 80,
|
|
749
|
+
height: 80,
|
|
750
|
+
borderRadius: 16,
|
|
751
|
+
marginBottom: 8
|
|
752
|
+
},
|
|
727
753
|
logoText: {
|
|
728
754
|
fontSize: 36,
|
|
729
755
|
fontWeight: "800",
|
|
@@ -779,6 +805,9 @@ function ManagedWalletProvider({
|
|
|
779
805
|
cluster,
|
|
780
806
|
storage,
|
|
781
807
|
renderConnectScreen,
|
|
808
|
+
accentColor,
|
|
809
|
+
appIcon,
|
|
810
|
+
tagline,
|
|
782
811
|
children
|
|
783
812
|
}) {
|
|
784
813
|
const [connected, setConnected] = (0, import_react.useState)(false);
|
|
@@ -866,7 +895,10 @@ function ManagedWalletProvider({
|
|
|
866
895
|
onConnect: handleConnect,
|
|
867
896
|
connecting,
|
|
868
897
|
error,
|
|
869
|
-
appName
|
|
898
|
+
appName,
|
|
899
|
+
accentColor,
|
|
900
|
+
appIcon,
|
|
901
|
+
tagline
|
|
870
902
|
};
|
|
871
903
|
if (renderConnectScreen) {
|
|
872
904
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children: renderConnectScreen(connectProps) });
|
|
@@ -1320,7 +1352,8 @@ function AuthGate({
|
|
|
1320
1352
|
renderLoading,
|
|
1321
1353
|
renderError,
|
|
1322
1354
|
renderRegistration,
|
|
1323
|
-
appName = "Dubs"
|
|
1355
|
+
appName = "Dubs",
|
|
1356
|
+
accentColor
|
|
1324
1357
|
}) {
|
|
1325
1358
|
const { client } = useDubs();
|
|
1326
1359
|
const auth = useAuth();
|
|
@@ -1389,7 +1422,8 @@ function AuthGate({
|
|
|
1389
1422
|
registering: isRegistering,
|
|
1390
1423
|
error: regError,
|
|
1391
1424
|
client,
|
|
1392
|
-
appName
|
|
1425
|
+
appName,
|
|
1426
|
+
accentColor
|
|
1393
1427
|
}
|
|
1394
1428
|
);
|
|
1395
1429
|
}
|
|
@@ -1458,9 +1492,11 @@ function DefaultRegistrationScreen({
|
|
|
1458
1492
|
registering,
|
|
1459
1493
|
error,
|
|
1460
1494
|
client,
|
|
1461
|
-
appName
|
|
1495
|
+
appName,
|
|
1496
|
+
accentColor
|
|
1462
1497
|
}) {
|
|
1463
1498
|
const t = useDubsTheme();
|
|
1499
|
+
const accent = accentColor || t.accent;
|
|
1464
1500
|
const [step, setStep] = (0, import_react11.useState)(0);
|
|
1465
1501
|
const [avatarSeed, setAvatarSeed] = (0, import_react11.useState)(generateSeed);
|
|
1466
1502
|
const [avatarStyle, setAvatarStyle] = (0, import_react11.useState)("adventurer");
|
|
@@ -1521,7 +1557,7 @@ function DefaultRegistrationScreen({
|
|
|
1521
1557
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.Text, { style: [s.title, { color: t.text }], children: "Choose Your Avatar" }),
|
|
1522
1558
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.Text, { style: [s.subtitle, { color: t.textMuted }], children: "Pick a look that represents you" }),
|
|
1523
1559
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(StepIndicator, { currentStep: 0 }),
|
|
1524
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.View, { style: s.avatarCenter, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_native3.View, { style: [s.avatarFrame, { borderColor:
|
|
1560
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.View, { style: s.avatarCenter, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_native3.View, { style: [s.avatarFrame, { borderColor: accent }], children: [
|
|
1525
1561
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.Image, { source: { uri: avatarUrl }, style: s.avatarLarge }),
|
|
1526
1562
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.View, { style: [s.checkBadge, { backgroundColor: t.success }], children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.Text, { style: s.checkBadgeText, children: "\u2713" }) })
|
|
1527
1563
|
] }) }),
|
|
@@ -1538,10 +1574,10 @@ function DefaultRegistrationScreen({
|
|
|
1538
1574
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1539
1575
|
import_react_native3.TouchableOpacity,
|
|
1540
1576
|
{
|
|
1541
|
-
style: [s.outlineBtn, { borderColor:
|
|
1577
|
+
style: [s.outlineBtn, { borderColor: accent, backgroundColor: accent + "15" }],
|
|
1542
1578
|
onPress: () => setShowStyles(!showStyles),
|
|
1543
1579
|
activeOpacity: 0.7,
|
|
1544
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.Text, { style: [s.outlineBtnText, { color:
|
|
1580
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.Text, { style: [s.outlineBtnText, { color: accent }], children: "\u263A Customize" })
|
|
1545
1581
|
}
|
|
1546
1582
|
)
|
|
1547
1583
|
] }),
|
|
@@ -1549,7 +1585,7 @@ function DefaultRegistrationScreen({
|
|
|
1549
1585
|
import_react_native3.TouchableOpacity,
|
|
1550
1586
|
{
|
|
1551
1587
|
onPress: () => setAvatarStyle(st),
|
|
1552
|
-
style: [s.styleThumbWrap, { borderColor: st === avatarStyle ?
|
|
1588
|
+
style: [s.styleThumbWrap, { borderColor: st === avatarStyle ? accent : t.border }],
|
|
1553
1589
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.Image, { source: { uri: getAvatarUrl(st, avatarSeed, 80) }, style: s.styleThumb })
|
|
1554
1590
|
},
|
|
1555
1591
|
st
|
|
@@ -1558,7 +1594,7 @@ function DefaultRegistrationScreen({
|
|
|
1558
1594
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.View, { style: s.bottomRow, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1559
1595
|
import_react_native3.TouchableOpacity,
|
|
1560
1596
|
{
|
|
1561
|
-
style: [s.primaryBtn, { backgroundColor:
|
|
1597
|
+
style: [s.primaryBtn, { backgroundColor: accent, flex: 1 }],
|
|
1562
1598
|
onPress: () => animateToStep(1),
|
|
1563
1599
|
activeOpacity: 0.8,
|
|
1564
1600
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.Text, { style: s.primaryBtnText, children: "Continue \u203A" })
|
|
@@ -1573,7 +1609,7 @@ function DefaultRegistrationScreen({
|
|
|
1573
1609
|
] }),
|
|
1574
1610
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.Text, { style: [s.subtitle, { color: t.textMuted }], children: "This is how others will see you" }),
|
|
1575
1611
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(StepIndicator, { currentStep: 1 }),
|
|
1576
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.View, { style: s.avatarCenter, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_native3.View, { style: [s.avatarFrameSmall, { borderColor:
|
|
1612
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.View, { style: s.avatarCenter, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_native3.View, { style: [s.avatarFrameSmall, { borderColor: accent }], children: [
|
|
1577
1613
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.Image, { source: { uri: avatarUrl }, style: s.avatarSmall }),
|
|
1578
1614
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.View, { style: [s.checkBadgeSm, { backgroundColor: t.success }], children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native3.Text, { style: s.checkBadgeTextSm, children: "\u2713" }) })
|
|
1579
1615
|
] }) }),
|
|
@@ -1585,7 +1621,7 @@ function DefaultRegistrationScreen({
|
|
|
1585
1621
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1586
1622
|
import_react_native3.TextInput,
|
|
1587
1623
|
{
|
|
1588
|
-
style: [s.input, { backgroundColor: t.surface, color: t.text, borderColor:
|
|
1624
|
+
style: [s.input, { backgroundColor: t.surface, color: t.text, borderColor: accent }],
|
|
1589
1625
|
placeholder: "Enter username",
|
|
1590
1626
|
placeholderTextColor: t.textDim,
|
|
1591
1627
|
value: username,
|
|
@@ -1611,7 +1647,7 @@ function DefaultRegistrationScreen({
|
|
|
1611
1647
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1612
1648
|
import_react_native3.TouchableOpacity,
|
|
1613
1649
|
{
|
|
1614
|
-
style: [s.primaryBtn, { backgroundColor:
|
|
1650
|
+
style: [s.primaryBtn, { backgroundColor: accent, flex: 1, opacity: canContinueUsername ? 1 : 0.4 }],
|
|
1615
1651
|
onPress: () => animateToStep(2),
|
|
1616
1652
|
disabled: !canContinueUsername,
|
|
1617
1653
|
activeOpacity: 0.8,
|
|
@@ -1683,7 +1719,7 @@ function DefaultRegistrationScreen({
|
|
|
1683
1719
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1684
1720
|
import_react_native3.TouchableOpacity,
|
|
1685
1721
|
{
|
|
1686
|
-
style: [s.primaryBtn, { backgroundColor:
|
|
1722
|
+
style: [s.primaryBtn, { backgroundColor: accent, flex: 1, opacity: registering ? 0.7 : 1 }],
|
|
1687
1723
|
onPress: handleSubmit,
|
|
1688
1724
|
disabled: registering,
|
|
1689
1725
|
activeOpacity: 0.8,
|
|
@@ -1818,6 +1854,11 @@ function DubsProvider({
|
|
|
1818
1854
|
const client = (0, import_react12.useMemo)(() => new DubsClient({ apiKey, baseUrl }), [apiKey, baseUrl]);
|
|
1819
1855
|
const connection = (0, import_react12.useMemo)(() => new import_web33.Connection(rpcUrl, { commitment: "confirmed" }), [rpcUrl]);
|
|
1820
1856
|
const storage = (0, import_react12.useMemo)(() => tokenStorage || createSecureStoreStorage(), [tokenStorage]);
|
|
1857
|
+
const [uiConfig, setUiConfig] = (0, import_react12.useState)({});
|
|
1858
|
+
(0, import_react12.useEffect)(() => {
|
|
1859
|
+
client.getAppConfig().then(setUiConfig).catch(() => {
|
|
1860
|
+
});
|
|
1861
|
+
}, [client]);
|
|
1821
1862
|
if (externalWallet) {
|
|
1822
1863
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1823
1864
|
ExternalWalletProvider,
|
|
@@ -1825,13 +1866,14 @@ function DubsProvider({
|
|
|
1825
1866
|
client,
|
|
1826
1867
|
connection,
|
|
1827
1868
|
wallet: externalWallet,
|
|
1828
|
-
appName,
|
|
1869
|
+
appName: uiConfig.appName || appName,
|
|
1829
1870
|
network,
|
|
1830
1871
|
storage,
|
|
1831
1872
|
managed,
|
|
1832
1873
|
renderLoading,
|
|
1833
1874
|
renderError,
|
|
1834
1875
|
renderRegistration,
|
|
1876
|
+
accentColor: uiConfig.accentColor,
|
|
1835
1877
|
children
|
|
1836
1878
|
}
|
|
1837
1879
|
);
|
|
@@ -1839,22 +1881,26 @@ function DubsProvider({
|
|
|
1839
1881
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1840
1882
|
ManagedWalletProvider,
|
|
1841
1883
|
{
|
|
1842
|
-
appName,
|
|
1884
|
+
appName: uiConfig.appName || appName,
|
|
1843
1885
|
cluster,
|
|
1844
1886
|
storage,
|
|
1845
1887
|
renderConnectScreen,
|
|
1888
|
+
accentColor: uiConfig.accentColor,
|
|
1889
|
+
appIcon: uiConfig.appIcon,
|
|
1890
|
+
tagline: uiConfig.tagline,
|
|
1846
1891
|
children: (adapter) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1847
1892
|
ManagedInner,
|
|
1848
1893
|
{
|
|
1849
1894
|
client,
|
|
1850
1895
|
connection,
|
|
1851
1896
|
wallet: adapter,
|
|
1852
|
-
appName,
|
|
1897
|
+
appName: uiConfig.appName || appName,
|
|
1853
1898
|
network,
|
|
1854
1899
|
storage,
|
|
1855
1900
|
renderLoading,
|
|
1856
1901
|
renderError,
|
|
1857
1902
|
renderRegistration,
|
|
1903
|
+
accentColor: uiConfig.accentColor,
|
|
1858
1904
|
children
|
|
1859
1905
|
}
|
|
1860
1906
|
)
|
|
@@ -1871,6 +1917,7 @@ function ManagedInner({
|
|
|
1871
1917
|
renderLoading,
|
|
1872
1918
|
renderError,
|
|
1873
1919
|
renderRegistration,
|
|
1920
|
+
accentColor,
|
|
1874
1921
|
children
|
|
1875
1922
|
}) {
|
|
1876
1923
|
const managedDisconnect = useDisconnect();
|
|
@@ -1894,6 +1941,7 @@ function ManagedInner({
|
|
|
1894
1941
|
renderError,
|
|
1895
1942
|
renderRegistration,
|
|
1896
1943
|
appName,
|
|
1944
|
+
accentColor,
|
|
1897
1945
|
children
|
|
1898
1946
|
}
|
|
1899
1947
|
) });
|
|
@@ -1909,6 +1957,7 @@ function ExternalWalletProvider({
|
|
|
1909
1957
|
renderLoading,
|
|
1910
1958
|
renderError,
|
|
1911
1959
|
renderRegistration,
|
|
1960
|
+
accentColor,
|
|
1912
1961
|
children
|
|
1913
1962
|
}) {
|
|
1914
1963
|
const disconnect = (0, import_react12.useCallback)(async () => {
|
|
@@ -1936,6 +1985,7 @@ function ExternalWalletProvider({
|
|
|
1936
1985
|
renderError,
|
|
1937
1986
|
renderRegistration,
|
|
1938
1987
|
appName,
|
|
1988
|
+
accentColor,
|
|
1939
1989
|
children
|
|
1940
1990
|
}
|
|
1941
1991
|
) });
|
|
@@ -2651,6 +2701,7 @@ var styles8 = import_react_native10.StyleSheet.create({
|
|
|
2651
2701
|
SettingsSheet,
|
|
2652
2702
|
UserProfileCard,
|
|
2653
2703
|
createSecureStoreStorage,
|
|
2704
|
+
mergeTheme,
|
|
2654
2705
|
parseSolanaError,
|
|
2655
2706
|
signAndSendBase64Transaction,
|
|
2656
2707
|
useAuth,
|