@dubsdotapp/expo 0.3.4 → 0.3.6

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 CHANGED
@@ -1266,10 +1266,20 @@ interface EnterArcadePoolSheetProps {
1266
1266
  onDismiss: () => void;
1267
1267
  pool: ArcadePool;
1268
1268
  stats?: ArcadePoolStats | null;
1269
+ mode?: 'join' | 'rejoin';
1269
1270
  onSuccess?: (result: EnterArcadePoolMutationResult) => void;
1270
1271
  onError?: (error: Error) => void;
1271
1272
  }
1272
- declare function EnterArcadePoolSheet({ visible, onDismiss, pool, stats, onSuccess, onError, }: EnterArcadePoolSheetProps): react_jsx_runtime.JSX.Element;
1273
+ declare function EnterArcadePoolSheet({ visible, onDismiss, pool, stats, mode, onSuccess, onError, }: EnterArcadePoolSheetProps): react_jsx_runtime.JSX.Element;
1274
+
1275
+ interface ArcadeLeaderboardSheetProps {
1276
+ visible: boolean;
1277
+ onDismiss: () => void;
1278
+ poolId: number;
1279
+ /** Highlighted wallet address (e.g. current user) */
1280
+ highlightWallet?: string;
1281
+ }
1282
+ declare function ArcadeLeaderboardSheet({ visible, onDismiss, poolId, highlightWallet, }: ArcadeLeaderboardSheetProps): react_jsx_runtime.JSX.Element;
1273
1283
 
1274
1284
  /**
1275
1285
  * Deserialize a base64-encoded transaction, sign via wallet adapter, send to Solana.
@@ -1286,4 +1296,4 @@ declare function signAndSendBase64Transaction(base64Tx: string, wallet: WalletAd
1286
1296
  */
1287
1297
  declare function ensurePngAvatar(url: string | null | undefined): string | undefined;
1288
1298
 
1289
- export { type ArcadeAttempt, type ArcadeEntry, type ArcadeLeaderboardEntry, 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, 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 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, useArcadeGame, useArcadePool, useArcadePools, useAuth, useClaim, useCreateCustomGame, useCreateGame, useDubs, useDubsTheme, useEnterArcadePool, useEvents, useGame, useGames, useHasClaimed, useJoinGame, useNetworkGames, usePushNotifications, useUFCFightCard, useUFCFighterDetail };
1299
+ export { type ArcadeAttempt, 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, 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 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, 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
@@ -1266,10 +1266,20 @@ interface EnterArcadePoolSheetProps {
1266
1266
  onDismiss: () => void;
1267
1267
  pool: ArcadePool;
1268
1268
  stats?: ArcadePoolStats | null;
1269
+ mode?: 'join' | 'rejoin';
1269
1270
  onSuccess?: (result: EnterArcadePoolMutationResult) => void;
1270
1271
  onError?: (error: Error) => void;
1271
1272
  }
1272
- declare function EnterArcadePoolSheet({ visible, onDismiss, pool, stats, onSuccess, onError, }: EnterArcadePoolSheetProps): react_jsx_runtime.JSX.Element;
1273
+ declare function EnterArcadePoolSheet({ visible, onDismiss, pool, stats, mode, onSuccess, onError, }: EnterArcadePoolSheetProps): react_jsx_runtime.JSX.Element;
1274
+
1275
+ interface ArcadeLeaderboardSheetProps {
1276
+ visible: boolean;
1277
+ onDismiss: () => void;
1278
+ poolId: number;
1279
+ /** Highlighted wallet address (e.g. current user) */
1280
+ highlightWallet?: string;
1281
+ }
1282
+ declare function ArcadeLeaderboardSheet({ visible, onDismiss, poolId, highlightWallet, }: ArcadeLeaderboardSheetProps): react_jsx_runtime.JSX.Element;
1273
1283
 
1274
1284
  /**
1275
1285
  * Deserialize a base64-encoded transaction, sign via wallet adapter, send to Solana.
@@ -1286,4 +1296,4 @@ declare function signAndSendBase64Transaction(base64Tx: string, wallet: WalletAd
1286
1296
  */
1287
1297
  declare function ensurePngAvatar(url: string | null | undefined): string | undefined;
1288
1298
 
1289
- export { type ArcadeAttempt, type ArcadeEntry, type ArcadeLeaderboardEntry, 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, 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 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, useArcadeGame, useArcadePool, useArcadePools, useAuth, useClaim, useCreateCustomGame, useCreateGame, useDubs, useDubsTheme, useEnterArcadePool, useEvents, useGame, useGames, useHasClaimed, useJoinGame, useNetworkGames, usePushNotifications, useUFCFightCard, useUFCFighterDetail };
1299
+ export { type ArcadeAttempt, 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, 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 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, useArcadeGame, useArcadePool, useArcadePools, useAuth, useClaim, useCreateCustomGame, useCreateGame, useDubs, useDubsTheme, useEnterArcadePool, useEvents, useGame, useGames, useHasClaimed, useJoinGame, useNetworkGames, usePushNotifications, useUFCFightCard, useUFCFighterDetail };
package/dist/index.js CHANGED
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/index.ts
31
31
  var index_exports = {};
32
32
  __export(index_exports, {
33
+ ArcadeLeaderboardSheet: () => ArcadeLeaderboardSheet,
33
34
  AuthGate: () => AuthGate,
34
35
  ClaimButton: () => ClaimButton,
35
36
  ClaimPrizeSheet: () => ClaimPrizeSheet,
@@ -5955,6 +5956,7 @@ function EnterArcadePoolSheet({
5955
5956
  onDismiss,
5956
5957
  pool,
5957
5958
  stats,
5959
+ mode = "join",
5958
5960
  onSuccess,
5959
5961
  onError
5960
5962
  }) {
@@ -6002,6 +6004,10 @@ function EnterArcadePoolSheet({
6002
6004
  }
6003
6005
  }, [wallet.publicKey, mutation.execute, pool.id]);
6004
6006
  const statusLabel = STATUS_LABELS5[mutation.status] || "";
6007
+ const isRejoin = mode === "rejoin";
6008
+ const headerTitle = isRejoin ? "Play Again" : "Join Pool";
6009
+ const ctaLabel = isRejoin ? `Play Again \u2014 ${buyInSol} SOL` : `Join Pool \u2014 ${buyInSol} SOL`;
6010
+ const successLabel = isRejoin ? "Lives refilled!" : "Joined!";
6005
6011
  return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
6006
6012
  import_react_native21.Modal,
6007
6013
  {
@@ -6019,7 +6025,7 @@ function EnterArcadePoolSheet({
6019
6025
  children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.View, { style: styles15.sheetPositioner, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.View, { style: [styles15.sheet, { backgroundColor: t.background }], children: [
6020
6026
  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.View, { style: styles15.handleRow, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.View, { style: [styles15.handle, { backgroundColor: t.textMuted }] }) }),
6021
6027
  /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.View, { style: styles15.header, children: [
6022
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.headerTitle, { color: t.text }], children: "Join Pool" }),
6028
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.headerTitle, { color: t.text }], children: headerTitle }),
6023
6029
  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.TouchableOpacity, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.closeButton, { color: t.textMuted }], children: "\u2715" }) })
6024
6030
  ] }),
6025
6031
  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.poolName, { color: t.textSecondary }], children: pool.name }),
@@ -6071,7 +6077,7 @@ function EnterArcadePoolSheet({
6071
6077
  children: isMutating ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.View, { style: styles15.ctaLoading, children: [
6072
6078
  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.ActivityIndicator, { size: "small", color: "#FFFFFF" }),
6073
6079
  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: styles15.ctaText, children: statusLabel })
6074
- ] }) : mutation.status === "success" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: styles15.ctaText, children: "Joined!" }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.ctaText, !canJoin && { opacity: 0.5 }], children: `Join Pool \u2014 ${buyInSol} SOL` })
6080
+ ] }) : mutation.status === "success" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: styles15.ctaText, children: successLabel }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.ctaText, !canJoin && { opacity: 0.5 }], children: ctaLabel })
6075
6081
  }
6076
6082
  )
6077
6083
  ] }) })
@@ -6139,8 +6145,181 @@ var styles15 = import_react_native21.StyleSheet.create({
6139
6145
  ctaText: { color: "#FFFFFF", fontSize: 16, fontWeight: "700" },
6140
6146
  ctaLoading: { flexDirection: "row", alignItems: "center", gap: 10 }
6141
6147
  });
6148
+
6149
+ // src/ui/game/ArcadeLeaderboardSheet.tsx
6150
+ var import_react35 = require("react");
6151
+ var import_react_native22 = require("react-native");
6152
+ var import_jsx_runtime19 = require("react/jsx-runtime");
6153
+ function RankLabel({ index }) {
6154
+ if (index === 0) return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native22.Text, { style: styles16.rankEmoji, children: "\u{1F947}" });
6155
+ if (index === 1) return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native22.Text, { style: styles16.rankEmoji, children: "\u{1F948}" });
6156
+ if (index === 2) return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native22.Text, { style: styles16.rankEmoji, children: "\u{1F949}" });
6157
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native22.Text, { style: styles16.rankNum, children: index + 1 });
6158
+ }
6159
+ function ArcadeLeaderboardSheet({
6160
+ visible,
6161
+ onDismiss,
6162
+ poolId,
6163
+ highlightWallet
6164
+ }) {
6165
+ const t = useDubsTheme();
6166
+ const { pool, leaderboard, stats, loading, refetch } = useArcadePool(poolId);
6167
+ const overlayOpacity = (0, import_react35.useRef)(new import_react_native22.Animated.Value(0)).current;
6168
+ (0, import_react35.useEffect)(() => {
6169
+ import_react_native22.Animated.timing(overlayOpacity, {
6170
+ toValue: visible ? 1 : 0,
6171
+ duration: 250,
6172
+ useNativeDriver: true
6173
+ }).start();
6174
+ }, [visible, overlayOpacity]);
6175
+ (0, import_react35.useEffect)(() => {
6176
+ if (visible) refetch();
6177
+ }, [visible]);
6178
+ const renderItem = ({ item, index }) => {
6179
+ const isMe = highlightWallet && item.wallet_address === highlightWallet;
6180
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
6181
+ import_react_native22.View,
6182
+ {
6183
+ style: [
6184
+ styles16.row,
6185
+ { backgroundColor: isMe ? `${t.accent}18` : index % 2 === 0 ? t.surface : "transparent" },
6186
+ isMe ? { borderWidth: 1, borderColor: t.accent } : void 0
6187
+ ],
6188
+ children: [
6189
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native22.View, { style: styles16.rankCol, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(RankLabel, { index }) }),
6190
+ item.avatar ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native22.Image, { source: { uri: item.avatar }, style: styles16.avatar }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native22.View, { style: [styles16.avatar, { backgroundColor: t.border }] }),
6191
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native22.View, { style: styles16.nameCol, children: [
6192
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native22.Text, { style: [styles16.name, { color: t.text }], numberOfLines: 1, children: item.username || `${item.wallet_address.slice(0, 4)}...${item.wallet_address.slice(-4)}` }),
6193
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native22.Text, { style: [styles16.lives, { color: t.textMuted }], children: [
6194
+ item.lives_used,
6195
+ " ",
6196
+ item.lives_used === 1 ? "life" : "lives",
6197
+ " used"
6198
+ ] })
6199
+ ] }),
6200
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native22.Text, { style: [styles16.score, { color: t.accent }], children: item.best_score })
6201
+ ]
6202
+ }
6203
+ );
6204
+ };
6205
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
6206
+ import_react_native22.Modal,
6207
+ {
6208
+ visible,
6209
+ animationType: "slide",
6210
+ transparent: true,
6211
+ onRequestClose: onDismiss,
6212
+ children: [
6213
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native22.Animated.View, { style: [styles16.overlay, { opacity: overlayOpacity }], children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native22.TouchableOpacity, { style: styles16.overlayTap, activeOpacity: 1, onPress: onDismiss }) }),
6214
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6215
+ import_react_native22.KeyboardAvoidingView,
6216
+ {
6217
+ style: styles16.keyboardView,
6218
+ behavior: import_react_native22.Platform.OS === "ios" ? "padding" : void 0,
6219
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native22.View, { style: styles16.sheetPositioner, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native22.View, { style: [styles16.sheet, { backgroundColor: t.background }], children: [
6220
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native22.View, { style: styles16.handleRow, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native22.View, { style: [styles16.handle, { backgroundColor: t.textMuted }] }) }),
6221
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native22.View, { style: styles16.header, children: [
6222
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native22.View, { children: [
6223
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native22.Text, { style: [styles16.headerTitle, { color: t.text }], children: "Leaderboard" }),
6224
+ pool && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native22.Text, { style: [styles16.poolName, { color: t.textMuted }], children: pool.name })
6225
+ ] }),
6226
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native22.TouchableOpacity, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native22.Text, { style: [styles16.closeButton, { color: t.textMuted }], children: "\u2715" }) })
6227
+ ] }),
6228
+ stats && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native22.View, { style: [styles16.statsBar, { backgroundColor: t.surface, borderColor: t.border }], children: [
6229
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native22.View, { style: styles16.statItem, children: [
6230
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native22.Text, { style: [styles16.statValue, { color: t.text }], children: stats.total_entries }),
6231
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native22.Text, { style: [styles16.statLabel, { color: t.textMuted }], children: "Players" })
6232
+ ] }),
6233
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native22.View, { style: [styles16.statDivider, { backgroundColor: t.border }] }),
6234
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native22.View, { style: styles16.statItem, children: [
6235
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native22.Text, { style: [styles16.statValue, { color: t.accent }], children: stats.top_score }),
6236
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native22.Text, { style: [styles16.statLabel, { color: t.textMuted }], children: "Top Score" })
6237
+ ] }),
6238
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native22.View, { style: [styles16.statDivider, { backgroundColor: t.border }] }),
6239
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native22.View, { style: styles16.statItem, children: [
6240
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native22.Text, { style: [styles16.statValue, { color: t.text }], children: Math.round(stats.avg_score) }),
6241
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native22.Text, { style: [styles16.statLabel, { color: t.textMuted }], children: "Avg Score" })
6242
+ ] })
6243
+ ] }),
6244
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6245
+ import_react_native22.FlatList,
6246
+ {
6247
+ data: leaderboard,
6248
+ renderItem,
6249
+ keyExtractor: (item) => String(item.id),
6250
+ style: styles16.list,
6251
+ contentContainerStyle: styles16.listContent,
6252
+ ListEmptyComponent: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native22.View, { style: styles16.emptyState, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native22.Text, { style: [styles16.emptyText, { color: t.textMuted }], children: loading ? "Loading..." : "No scores yet" }) })
6253
+ }
6254
+ )
6255
+ ] }) })
6256
+ }
6257
+ )
6258
+ ]
6259
+ }
6260
+ );
6261
+ }
6262
+ var styles16 = import_react_native22.StyleSheet.create({
6263
+ overlay: {
6264
+ ...import_react_native22.StyleSheet.absoluteFillObject,
6265
+ backgroundColor: "rgba(0,0,0,0.5)"
6266
+ },
6267
+ overlayTap: { flex: 1 },
6268
+ keyboardView: { flex: 1, justifyContent: "flex-end" },
6269
+ sheetPositioner: { flex: 1, justifyContent: "flex-end" },
6270
+ sheet: {
6271
+ borderTopLeftRadius: 24,
6272
+ borderTopRightRadius: 24,
6273
+ paddingHorizontal: 20,
6274
+ paddingBottom: 40,
6275
+ maxHeight: "80%"
6276
+ },
6277
+ handleRow: { alignItems: "center", paddingTop: 10, paddingBottom: 8 },
6278
+ handle: { width: 36, height: 4, borderRadius: 2, opacity: 0.4 },
6279
+ header: {
6280
+ flexDirection: "row",
6281
+ alignItems: "flex-start",
6282
+ justifyContent: "space-between",
6283
+ paddingVertical: 12
6284
+ },
6285
+ headerTitle: { fontSize: 20, fontWeight: "700" },
6286
+ poolName: { fontSize: 13, fontWeight: "600", marginTop: 2 },
6287
+ closeButton: { fontSize: 20, padding: 4 },
6288
+ statsBar: {
6289
+ flexDirection: "row",
6290
+ borderRadius: 12,
6291
+ borderWidth: 1,
6292
+ marginBottom: 12,
6293
+ overflow: "hidden"
6294
+ },
6295
+ statItem: { flex: 1, alignItems: "center", paddingVertical: 10 },
6296
+ statValue: { fontSize: 18, fontWeight: "800" },
6297
+ statLabel: { fontSize: 11, fontWeight: "600", marginTop: 2 },
6298
+ statDivider: { width: 1, marginVertical: 8 },
6299
+ list: { flexGrow: 0 },
6300
+ listContent: { paddingBottom: 8 },
6301
+ row: {
6302
+ flexDirection: "row",
6303
+ alignItems: "center",
6304
+ paddingVertical: 10,
6305
+ paddingHorizontal: 12,
6306
+ borderRadius: 10,
6307
+ marginBottom: 2
6308
+ },
6309
+ rankCol: { width: 32, alignItems: "center" },
6310
+ rankEmoji: { fontSize: 18 },
6311
+ rankNum: { fontSize: 14, fontWeight: "700", color: "#888" },
6312
+ avatar: { width: 32, height: 32, borderRadius: 16, marginRight: 10 },
6313
+ nameCol: { flex: 1 },
6314
+ name: { fontSize: 14, fontWeight: "600" },
6315
+ lives: { fontSize: 11, marginTop: 1 },
6316
+ score: { fontSize: 18, fontWeight: "800" },
6317
+ emptyState: { paddingVertical: 40, alignItems: "center" },
6318
+ emptyText: { fontSize: 14, fontWeight: "600" }
6319
+ });
6142
6320
  // Annotate the CommonJS export names for ESM import in node:
6143
6321
  0 && (module.exports = {
6322
+ ArcadeLeaderboardSheet,
6144
6323
  AuthGate,
6145
6324
  ClaimButton,
6146
6325
  ClaimPrizeSheet,