@dubsdotapp/expo 0.2.74 → 0.2.75
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 +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +17 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/ui/UserProfileCard.tsx +2 -1
- package/src/ui/UserProfileSheet.tsx +5 -2
- package/src/ui/game/PlayersCard.tsx +2 -1
- package/src/utils/avatarUrl.ts +9 -0
package/dist/index.d.mts
CHANGED
|
@@ -1125,4 +1125,11 @@ declare function ClaimButton({ gameId, style, onSuccess, onError }: ClaimButtonP
|
|
|
1125
1125
|
*/
|
|
1126
1126
|
declare function signAndSendBase64Transaction(base64Tx: string, wallet: WalletAdapter, connection: Connection): Promise<string>;
|
|
1127
1127
|
|
|
1128
|
-
|
|
1128
|
+
/**
|
|
1129
|
+
* Ensure a DiceBear avatar URL uses PNG format for React Native compatibility.
|
|
1130
|
+
* React Native's Image component cannot render SVGs.
|
|
1131
|
+
* This converts at render time only — the stored URL in the DB is never modified.
|
|
1132
|
+
*/
|
|
1133
|
+
declare function ensurePngAvatar(url: string | null | undefined): string | undefined;
|
|
1134
|
+
|
|
1135
|
+
export { AuthGate, type AuthGateProps, type AuthStatus, type AuthenticateParams, type AuthenticateResult, type Bettor, type BuildClaimParams, type BuildClaimResult, type CheckUsernameResult, ClaimButton, type ClaimButtonProps, type ClaimMutationResult, ClaimPrizeSheet, type ClaimPrizeSheetProps, type ClaimStatus, type ConfirmClaimParams, type ConfirmClaimResult, type ConfirmGameParams, type ConfirmGameResult, 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 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 TokenStorage, type UFCData, type UFCEvent, type UFCFight, type UFCFighter, type UFCFighterDetail, type UiConfig, type UnifiedEvent, type UseAuthResult, UserProfileCard, type UserProfileCardProps, UserProfileSheet, type UserProfileSheetProps, type ValidateEventResult, type WalletAdapter, createSecureStoreStorage, ensurePngAvatar, getDeviceInfo, isSolanaSeeker, mergeTheme, parseSolanaError, signAndSendBase64Transaction, useAppConfig, useAuth, useClaim, useCreateCustomGame, useCreateGame, useDubs, useDubsTheme, useEvents, useGame, useGames, useHasClaimed, useJoinGame, useNetworkGames, usePushNotifications, useUFCFightCard, useUFCFighterDetail };
|
package/dist/index.d.ts
CHANGED
|
@@ -1125,4 +1125,11 @@ declare function ClaimButton({ gameId, style, onSuccess, onError }: ClaimButtonP
|
|
|
1125
1125
|
*/
|
|
1126
1126
|
declare function signAndSendBase64Transaction(base64Tx: string, wallet: WalletAdapter, connection: Connection): Promise<string>;
|
|
1127
1127
|
|
|
1128
|
-
|
|
1128
|
+
/**
|
|
1129
|
+
* Ensure a DiceBear avatar URL uses PNG format for React Native compatibility.
|
|
1130
|
+
* React Native's Image component cannot render SVGs.
|
|
1131
|
+
* This converts at render time only — the stored URL in the DB is never modified.
|
|
1132
|
+
*/
|
|
1133
|
+
declare function ensurePngAvatar(url: string | null | undefined): string | undefined;
|
|
1134
|
+
|
|
1135
|
+
export { AuthGate, type AuthGateProps, type AuthStatus, type AuthenticateParams, type AuthenticateResult, type Bettor, type BuildClaimParams, type BuildClaimResult, type CheckUsernameResult, ClaimButton, type ClaimButtonProps, type ClaimMutationResult, ClaimPrizeSheet, type ClaimPrizeSheetProps, type ClaimStatus, type ConfirmClaimParams, type ConfirmClaimResult, type ConfirmGameParams, type ConfirmGameResult, 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 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 TokenStorage, type UFCData, type UFCEvent, type UFCFight, type UFCFighter, type UFCFighterDetail, type UiConfig, type UnifiedEvent, type UseAuthResult, UserProfileCard, type UserProfileCardProps, UserProfileSheet, type UserProfileSheetProps, type ValidateEventResult, type WalletAdapter, createSecureStoreStorage, ensurePngAvatar, getDeviceInfo, isSolanaSeeker, mergeTheme, parseSolanaError, signAndSendBase64Transaction, useAppConfig, useAuth, useClaim, useCreateCustomGame, useCreateGame, useDubs, useDubsTheme, useEvents, useGame, useGames, useHasClaimed, useJoinGame, useNetworkGames, usePushNotifications, useUFCFightCard, useUFCFighterDetail };
|
package/dist/index.js
CHANGED
|
@@ -55,6 +55,7 @@ __export(index_exports, {
|
|
|
55
55
|
UserProfileCard: () => UserProfileCard,
|
|
56
56
|
UserProfileSheet: () => UserProfileSheet,
|
|
57
57
|
createSecureStoreStorage: () => createSecureStoreStorage,
|
|
58
|
+
ensurePngAvatar: () => ensurePngAvatar,
|
|
58
59
|
getDeviceInfo: () => getDeviceInfo,
|
|
59
60
|
isSolanaSeeker: () => isSolanaSeeker,
|
|
60
61
|
mergeTheme: () => mergeTheme,
|
|
@@ -3335,6 +3336,14 @@ function useAppConfig() {
|
|
|
3335
3336
|
// src/ui/UserProfileCard.tsx
|
|
3336
3337
|
var import_react19 = require("react");
|
|
3337
3338
|
var import_react_native8 = require("react-native");
|
|
3339
|
+
|
|
3340
|
+
// src/utils/avatarUrl.ts
|
|
3341
|
+
function ensurePngAvatar(url) {
|
|
3342
|
+
if (!url) return void 0;
|
|
3343
|
+
return url.replace("/svg?", "/png?");
|
|
3344
|
+
}
|
|
3345
|
+
|
|
3346
|
+
// src/ui/UserProfileCard.tsx
|
|
3338
3347
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
3339
3348
|
function truncateAddress(address, chars = 4) {
|
|
3340
3349
|
if (address.length <= chars * 2 + 3) return address;
|
|
@@ -3354,7 +3363,7 @@ function UserProfileCard({
|
|
|
3354
3363
|
}) {
|
|
3355
3364
|
const t = useDubsTheme();
|
|
3356
3365
|
const imageUri = (0, import_react19.useMemo)(
|
|
3357
|
-
() => avatarUrl || `https://api.dicebear.com/9.x/avataaars/png?seed=${walletAddress}&size=128`,
|
|
3366
|
+
() => ensurePngAvatar(avatarUrl) || `https://api.dicebear.com/9.x/avataaars/png?seed=${walletAddress}&size=128`,
|
|
3358
3367
|
[avatarUrl, walletAddress]
|
|
3359
3368
|
);
|
|
3360
3369
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react_native8.View, { style: [styles2.card, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
@@ -3566,7 +3575,7 @@ function getAvatarUrl2(style, seed, size = 256) {
|
|
|
3566
3575
|
function parseAvatarUrl(url) {
|
|
3567
3576
|
if (!url) return { style: "adventurer", seed: generateSeed2() };
|
|
3568
3577
|
try {
|
|
3569
|
-
const match = url.match(
|
|
3578
|
+
const match = url.match(/\/\d+\.x\/([^/]+)\/(?:png|svg)\?seed=([^&]+)/);
|
|
3570
3579
|
if (match) return { style: match[1], seed: match[2] };
|
|
3571
3580
|
} catch {
|
|
3572
3581
|
}
|
|
@@ -3846,7 +3855,8 @@ var styles4 = import_react_native10.StyleSheet.create({
|
|
|
3846
3855
|
},
|
|
3847
3856
|
avatar: {
|
|
3848
3857
|
width: "100%",
|
|
3849
|
-
height: "100%"
|
|
3858
|
+
height: "100%",
|
|
3859
|
+
backgroundColor: "#1a1a2e"
|
|
3850
3860
|
},
|
|
3851
3861
|
avatarLoading: {
|
|
3852
3862
|
...import_react_native10.StyleSheet.absoluteFillObject,
|
|
@@ -3897,7 +3907,8 @@ var styles4 = import_react_native10.StyleSheet.create({
|
|
|
3897
3907
|
},
|
|
3898
3908
|
styleTileImage: {
|
|
3899
3909
|
width: "100%",
|
|
3900
|
-
height: "100%"
|
|
3910
|
+
height: "100%",
|
|
3911
|
+
backgroundColor: "#1a1a2e"
|
|
3901
3912
|
},
|
|
3902
3913
|
// Error
|
|
3903
3914
|
errorBox: {
|
|
@@ -4352,7 +4363,7 @@ function BettorRow({
|
|
|
4352
4363
|
const showAvatar = bettor.avatar && !imgFailed;
|
|
4353
4364
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native14.View, { style: [styles8.row, !isFirst && { borderTopColor: t.border, borderTopWidth: 1 }], children: [
|
|
4354
4365
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native14.View, { style: [styles8.dot, { backgroundColor: dotColor }] }),
|
|
4355
|
-
showAvatar ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Img, { source: { uri: bettor.avatar }, style: styles8.avatar, resizeMode: "cover", onError: () => setImgFailed(true) }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native14.View, { style: [styles8.avatar, styles8.avatarPlaceholder] }),
|
|
4366
|
+
showAvatar ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Img, { source: { uri: ensurePngAvatar(bettor.avatar) }, style: styles8.avatar, resizeMode: "cover", onError: () => setImgFailed(true) }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native14.View, { style: [styles8.avatar, styles8.avatarPlaceholder] }),
|
|
4356
4367
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native14.View, { style: styles8.nameCol, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native14.Text, { style: [styles8.username, { color: t.text }], numberOfLines: 1, children: bettor.username || truncateWallet(bettor.wallet, truncateChars) }) }),
|
|
4357
4368
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native14.Text, { style: [styles8.amount, { color: t.textSecondary }], children: [
|
|
4358
4369
|
bettor.amount,
|
|
@@ -5615,6 +5626,7 @@ var styles13 = import_react_native19.StyleSheet.create({
|
|
|
5615
5626
|
UserProfileCard,
|
|
5616
5627
|
UserProfileSheet,
|
|
5617
5628
|
createSecureStoreStorage,
|
|
5629
|
+
ensurePngAvatar,
|
|
5618
5630
|
getDeviceInfo,
|
|
5619
5631
|
isSolanaSeeker,
|
|
5620
5632
|
mergeTheme,
|