@dubsdotapp/expo 0.2.29 → 0.2.31

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
@@ -902,6 +902,23 @@ interface CreateCustomGameSheetProps {
902
902
  }
903
903
  declare function CreateCustomGameSheet({ visible, onDismiss, title, maxPlayers, fee, presetAmounts, defaultAmount, metadata, onAmountChange, onSuccess, onError, }: CreateCustomGameSheetProps): react_jsx_runtime.JSX.Element;
904
904
 
905
+ interface JoinGameSheetProps {
906
+ visible: boolean;
907
+ onDismiss: () => void;
908
+ game: GameDetail;
909
+ /** Optional Image component (expo-image, etc.) for team logos */
910
+ ImageComponent?: React$1.ComponentType<any>;
911
+ /** Custom short-name function for team labels */
912
+ shortName?: (name: string | null) => string;
913
+ /** Override team colors (default blue/red) */
914
+ homeColor?: string;
915
+ awayColor?: string;
916
+ /** Callbacks */
917
+ onSuccess?: (result: JoinGameMutationResult) => void;
918
+ onError?: (error: Error) => void;
919
+ }
920
+ declare function JoinGameSheet({ visible, onDismiss, game, ImageComponent, shortName, homeColor, awayColor, onSuccess, onError, }: JoinGameSheetProps): react_jsx_runtime.JSX.Element;
921
+
905
922
  /**
906
923
  * Deserialize a base64-encoded transaction, sign via wallet adapter, send to Solana.
907
924
  * Prefers signAndSendTransaction if available (MWA), otherwise falls back to
@@ -910,4 +927,4 @@ declare function CreateCustomGameSheet({ visible, onDismiss, title, maxPlayers,
910
927
  */
911
928
  declare function signAndSendBase64Transaction(base64Tx: string, wallet: WalletAdapter, connection: Connection): Promise<string>;
912
929
 
913
- 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 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, 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 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, getDeviceInfo, isSolanaSeeker, mergeTheme, parseSolanaError, signAndSendBase64Transaction, useAppConfig, useAuth, useClaim, useCreateCustomGame, useCreateGame, useDubs, useDubsTheme, useEvents, useGame, useGames, useJoinGame, useNetworkGames };
930
+ 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 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 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, getDeviceInfo, isSolanaSeeker, mergeTheme, parseSolanaError, signAndSendBase64Transaction, useAppConfig, useAuth, useClaim, useCreateCustomGame, useCreateGame, useDubs, useDubsTheme, useEvents, useGame, useGames, useJoinGame, useNetworkGames };
package/dist/index.d.ts CHANGED
@@ -902,6 +902,23 @@ interface CreateCustomGameSheetProps {
902
902
  }
903
903
  declare function CreateCustomGameSheet({ visible, onDismiss, title, maxPlayers, fee, presetAmounts, defaultAmount, metadata, onAmountChange, onSuccess, onError, }: CreateCustomGameSheetProps): react_jsx_runtime.JSX.Element;
904
904
 
905
+ interface JoinGameSheetProps {
906
+ visible: boolean;
907
+ onDismiss: () => void;
908
+ game: GameDetail;
909
+ /** Optional Image component (expo-image, etc.) for team logos */
910
+ ImageComponent?: React$1.ComponentType<any>;
911
+ /** Custom short-name function for team labels */
912
+ shortName?: (name: string | null) => string;
913
+ /** Override team colors (default blue/red) */
914
+ homeColor?: string;
915
+ awayColor?: string;
916
+ /** Callbacks */
917
+ onSuccess?: (result: JoinGameMutationResult) => void;
918
+ onError?: (error: Error) => void;
919
+ }
920
+ declare function JoinGameSheet({ visible, onDismiss, game, ImageComponent, shortName, homeColor, awayColor, onSuccess, onError, }: JoinGameSheetProps): react_jsx_runtime.JSX.Element;
921
+
905
922
  /**
906
923
  * Deserialize a base64-encoded transaction, sign via wallet adapter, send to Solana.
907
924
  * Prefers signAndSendTransaction if available (MWA), otherwise falls back to
@@ -910,4 +927,4 @@ declare function CreateCustomGameSheet({ visible, onDismiss, title, maxPlayers,
910
927
  */
911
928
  declare function signAndSendBase64Transaction(base64Tx: string, wallet: WalletAdapter, connection: Connection): Promise<string>;
912
929
 
913
- 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 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, 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 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, getDeviceInfo, isSolanaSeeker, mergeTheme, parseSolanaError, signAndSendBase64Transaction, useAppConfig, useAuth, useClaim, useCreateCustomGame, useCreateGame, useDubs, useDubsTheme, useEvents, useGame, useGames, useJoinGame, useNetworkGames };
930
+ 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 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 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, getDeviceInfo, isSolanaSeeker, mergeTheme, parseSolanaError, signAndSendBase64Transaction, useAppConfig, useAuth, useClaim, useCreateCustomGame, useCreateGame, useDubs, useDubsTheme, useEvents, useGame, useGames, useJoinGame, useNetworkGames };
package/dist/index.js CHANGED
@@ -40,6 +40,7 @@ __export(index_exports, {
40
40
  DubsProvider: () => DubsProvider,
41
41
  GamePoster: () => GamePoster,
42
42
  JoinGameButton: () => JoinGameButton,
43
+ JoinGameSheet: () => JoinGameSheet,
43
44
  LivePoolsCard: () => LivePoolsCard,
44
45
  MwaWalletAdapter: () => MwaWalletAdapter,
45
46
  NETWORK_CONFIG: () => NETWORK_CONFIG,
@@ -3825,6 +3826,391 @@ var styles9 = import_react_native14.StyleSheet.create({
3825
3826
  gap: 10
3826
3827
  }
3827
3828
  });
3829
+
3830
+ // src/ui/game/JoinGameSheet.tsx
3831
+ var import_react21 = require("react");
3832
+ var import_react_native15 = require("react-native");
3833
+ var import_jsx_runtime13 = require("react/jsx-runtime");
3834
+ var STATUS_LABELS3 = {
3835
+ building: "Building transaction...",
3836
+ signing: "Approve in wallet...",
3837
+ confirming: "Confirming...",
3838
+ success: "Joined!"
3839
+ };
3840
+ var CUSTOM_GAME_MODE = 6;
3841
+ function JoinGameSheet({
3842
+ visible,
3843
+ onDismiss,
3844
+ game,
3845
+ ImageComponent,
3846
+ shortName,
3847
+ homeColor = "#3B82F6",
3848
+ awayColor = "#EF4444",
3849
+ onSuccess,
3850
+ onError
3851
+ }) {
3852
+ const t = useDubsTheme();
3853
+ const { wallet } = useDubs();
3854
+ const mutation = useJoinGame();
3855
+ const isCustomGame = game.gameMode === CUSTOM_GAME_MODE;
3856
+ const [selectedTeam, setSelectedTeam] = (0, import_react21.useState)(null);
3857
+ const overlayOpacity = (0, import_react21.useRef)(new import_react_native15.Animated.Value(0)).current;
3858
+ (0, import_react21.useEffect)(() => {
3859
+ import_react_native15.Animated.timing(overlayOpacity, {
3860
+ toValue: visible ? 1 : 0,
3861
+ duration: 250,
3862
+ useNativeDriver: true
3863
+ }).start();
3864
+ }, [visible, overlayOpacity]);
3865
+ (0, import_react21.useEffect)(() => {
3866
+ if (visible) {
3867
+ setSelectedTeam(isCustomGame ? "away" : null);
3868
+ mutation.reset();
3869
+ }
3870
+ }, [visible]);
3871
+ (0, import_react21.useEffect)(() => {
3872
+ if (mutation.status === "success" && mutation.data) {
3873
+ onSuccess?.(mutation.data);
3874
+ const timer = setTimeout(() => {
3875
+ onDismiss();
3876
+ }, 1500);
3877
+ return () => clearTimeout(timer);
3878
+ }
3879
+ }, [mutation.status, mutation.data]);
3880
+ (0, import_react21.useEffect)(() => {
3881
+ if (mutation.status === "error" && mutation.error) {
3882
+ onError?.(mutation.error);
3883
+ }
3884
+ }, [mutation.status, mutation.error]);
3885
+ const opponents = game.opponents || [];
3886
+ const bettors = game.bettors || [];
3887
+ const totalPool = game.totalPool || 0;
3888
+ const homePool = game.homePool || 0;
3889
+ const awayPool = game.awayPool || 0;
3890
+ const buyIn = game.buyIn;
3891
+ const { homeOdds, awayOdds, homeBets, awayBets } = (0, import_react21.useMemo)(() => ({
3892
+ homeOdds: homePool > 0 ? (totalPool / homePool).toFixed(2) : "\u2014",
3893
+ awayOdds: awayPool > 0 ? (totalPool / awayPool).toFixed(2) : "\u2014",
3894
+ homeBets: bettors.filter((b) => b.team === "home").length,
3895
+ awayBets: bettors.filter((b) => b.team === "away").length
3896
+ }), [totalPool, homePool, awayPool, bettors]);
3897
+ const poolAfterJoin = totalPool + buyIn;
3898
+ const selectedOdds = selectedTeam === "home" ? homeOdds : selectedTeam === "away" ? awayOdds : "\u2014";
3899
+ const potentialWinnings = selectedOdds !== "\u2014" ? (parseFloat(selectedOdds) * buyIn).toFixed(4) : "\u2014";
3900
+ const homeName = shortName ? shortName(opponents[0]?.name) : opponents[0]?.name || "Home";
3901
+ const awayName = shortName ? shortName(opponents[1]?.name) : opponents[1]?.name || "Away";
3902
+ const selectedName = selectedTeam === "home" ? homeName : selectedTeam === "away" ? awayName : "\u2014";
3903
+ const alreadyJoined = (0, import_react21.useMemo)(() => {
3904
+ if (!wallet.publicKey) return false;
3905
+ const addr = wallet.publicKey.toBase58();
3906
+ return bettors.some((b) => b.wallet === addr);
3907
+ }, [bettors, wallet.publicKey]);
3908
+ const isMutating = mutation.status !== "idle" && mutation.status !== "success" && mutation.status !== "error";
3909
+ const canJoin = selectedTeam !== null && !isMutating && mutation.status !== "success" && !alreadyJoined;
3910
+ const handleJoin = (0, import_react21.useCallback)(async () => {
3911
+ if (!selectedTeam || !wallet.publicKey) return;
3912
+ try {
3913
+ await mutation.execute({
3914
+ playerWallet: wallet.publicKey.toBase58(),
3915
+ gameId: game.gameId,
3916
+ teamChoice: selectedTeam,
3917
+ amount: buyIn
3918
+ });
3919
+ } catch {
3920
+ }
3921
+ }, [selectedTeam, wallet.publicKey, mutation.execute, game.gameId, buyIn]);
3922
+ const statusLabel = STATUS_LABELS3[mutation.status] || "";
3923
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
3924
+ import_react_native15.Modal,
3925
+ {
3926
+ visible,
3927
+ animationType: "slide",
3928
+ transparent: true,
3929
+ onRequestClose: onDismiss,
3930
+ children: [
3931
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native15.Animated.View, { style: [styles10.overlay, { opacity: overlayOpacity }], children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native15.TouchableOpacity, { style: styles10.overlayTap, activeOpacity: 1, onPress: onDismiss }) }),
3932
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3933
+ import_react_native15.KeyboardAvoidingView,
3934
+ {
3935
+ style: styles10.keyboardView,
3936
+ behavior: import_react_native15.Platform.OS === "ios" ? "padding" : void 0,
3937
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native15.View, { style: styles10.sheetPositioner, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native15.View, { style: [styles10.sheet, { backgroundColor: t.background }], children: [
3938
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native15.View, { style: styles10.handleRow, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native15.View, { style: [styles10.handle, { backgroundColor: t.textMuted }] }) }),
3939
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native15.View, { style: styles10.header, children: [
3940
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native15.Text, { style: [styles10.headerTitle, { color: t.text }], children: "Join Game" }),
3941
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native15.TouchableOpacity, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native15.Text, { style: [styles10.closeButton, { color: t.textMuted }], children: "\u2715" }) })
3942
+ ] }),
3943
+ !isCustomGame && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native15.View, { style: styles10.section, children: [
3944
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native15.Text, { style: [styles10.sectionLabel, { color: t.textSecondary }], children: "Pick Your Side" }),
3945
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native15.View, { style: styles10.teamsRow, children: [
3946
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3947
+ TeamButton,
3948
+ {
3949
+ name: homeName,
3950
+ imageUrl: opponents[0]?.imageUrl,
3951
+ odds: homeOdds,
3952
+ bets: homeBets,
3953
+ color: homeColor,
3954
+ selected: selectedTeam === "home",
3955
+ onPress: () => setSelectedTeam("home"),
3956
+ ImageComponent,
3957
+ t
3958
+ }
3959
+ ),
3960
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3961
+ TeamButton,
3962
+ {
3963
+ name: awayName,
3964
+ imageUrl: opponents[1]?.imageUrl,
3965
+ odds: awayOdds,
3966
+ bets: awayBets,
3967
+ color: awayColor,
3968
+ selected: selectedTeam === "away",
3969
+ onPress: () => setSelectedTeam("away"),
3970
+ ImageComponent,
3971
+ t
3972
+ }
3973
+ )
3974
+ ] })
3975
+ ] }),
3976
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native15.View, { style: [styles10.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
3977
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native15.View, { style: styles10.summaryRow, children: [
3978
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native15.Text, { style: [styles10.summaryLabel, { color: t.textMuted }], children: "Buy-in" }),
3979
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native15.Text, { style: [styles10.summaryValue, { color: t.text }], children: [
3980
+ buyIn,
3981
+ " SOL"
3982
+ ] })
3983
+ ] }),
3984
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native15.View, { style: [styles10.summarySep, { backgroundColor: t.border }] }),
3985
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native15.View, { style: styles10.summaryRow, children: [
3986
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native15.Text, { style: [styles10.summaryLabel, { color: t.textMuted }], children: "Your side" }),
3987
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native15.Text, { style: [styles10.summaryValue, { color: t.text }], children: selectedName })
3988
+ ] }),
3989
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native15.View, { style: [styles10.summarySep, { backgroundColor: t.border }] }),
3990
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native15.View, { style: styles10.summaryRow, children: [
3991
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native15.Text, { style: [styles10.summaryLabel, { color: t.textMuted }], children: "Total pool" }),
3992
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native15.Text, { style: [styles10.summaryValue, { color: t.text }], children: [
3993
+ poolAfterJoin,
3994
+ " SOL"
3995
+ ] })
3996
+ ] }),
3997
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native15.View, { style: [styles10.summarySep, { backgroundColor: t.border }] }),
3998
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native15.View, { style: styles10.summaryRow, children: [
3999
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native15.Text, { style: [styles10.summaryLabel, { color: t.textMuted }], children: "Potential winnings" }),
4000
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native15.Text, { style: [styles10.summaryValue, { color: t.success }], children: potentialWinnings !== "\u2014" ? `${potentialWinnings} SOL` : "\u2014" })
4001
+ ] })
4002
+ ] }),
4003
+ alreadyJoined && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native15.View, { style: [styles10.errorBox, { backgroundColor: t.surface, borderColor: t.border }], children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native15.Text, { style: [styles10.errorText, { color: t.textMuted }], children: "You've already joined this game." }) }),
4004
+ mutation.error && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native15.View, { style: [styles10.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native15.Text, { style: [styles10.errorText, { color: t.errorText }], children: mutation.error.message }) }),
4005
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
4006
+ import_react_native15.TouchableOpacity,
4007
+ {
4008
+ style: [
4009
+ styles10.ctaButton,
4010
+ { backgroundColor: canJoin ? t.accent : t.border }
4011
+ ],
4012
+ disabled: !canJoin,
4013
+ onPress: handleJoin,
4014
+ activeOpacity: 0.8,
4015
+ children: isMutating ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native15.View, { style: styles10.ctaLoading, children: [
4016
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native15.ActivityIndicator, { size: "small", color: "#FFFFFF" }),
4017
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native15.Text, { style: styles10.ctaText, children: statusLabel })
4018
+ ] }) : mutation.status === "success" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native15.Text, { style: styles10.ctaText, children: STATUS_LABELS3.success }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native15.Text, { style: [styles10.ctaText, !canJoin && { opacity: 0.5 }], children: alreadyJoined ? "Already Joined" : selectedTeam ? `Join Game \u2014 ${buyIn} SOL` : "Pick a side to join" })
4019
+ }
4020
+ )
4021
+ ] }) })
4022
+ }
4023
+ )
4024
+ ]
4025
+ }
4026
+ );
4027
+ }
4028
+ function TeamButton({
4029
+ name,
4030
+ imageUrl,
4031
+ odds,
4032
+ bets,
4033
+ color,
4034
+ selected,
4035
+ onPress,
4036
+ ImageComponent,
4037
+ t
4038
+ }) {
4039
+ const [imgFailed, setImgFailed] = (0, import_react21.useState)(false);
4040
+ const Img = ImageComponent || require("react-native").Image;
4041
+ const showImage = imageUrl && !imgFailed;
4042
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
4043
+ import_react_native15.TouchableOpacity,
4044
+ {
4045
+ style: [styles10.teamOption, { borderColor: selected ? color : t.border, backgroundColor: selected ? color + "15" : t.background }],
4046
+ onPress,
4047
+ activeOpacity: 0.7,
4048
+ children: [
4049
+ showImage ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Img, { source: { uri: imageUrl }, style: styles10.teamLogo, resizeMode: "contain", onError: () => setImgFailed(true) }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native15.View, { style: [styles10.teamLogo, styles10.teamLogoPlaceholder] }),
4050
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native15.Text, { style: [styles10.teamName, { color: t.text }], numberOfLines: 1, children: name }),
4051
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native15.Text, { style: [styles10.teamOdds, { color }], children: [
4052
+ odds,
4053
+ "x"
4054
+ ] }),
4055
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native15.Text, { style: [styles10.teamBets, { color: t.textMuted }], children: [
4056
+ bets,
4057
+ " ",
4058
+ bets === 1 ? "bet" : "bets"
4059
+ ] }),
4060
+ selected && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native15.View, { style: [styles10.teamBadge, { backgroundColor: color }], children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native15.Text, { style: styles10.teamBadgeText, children: "Selected" }) })
4061
+ ]
4062
+ }
4063
+ );
4064
+ }
4065
+ var styles10 = import_react_native15.StyleSheet.create({
4066
+ overlay: {
4067
+ ...import_react_native15.StyleSheet.absoluteFillObject,
4068
+ backgroundColor: "rgba(0,0,0,0.5)"
4069
+ },
4070
+ overlayTap: {
4071
+ flex: 1
4072
+ },
4073
+ keyboardView: {
4074
+ flex: 1,
4075
+ justifyContent: "flex-end"
4076
+ },
4077
+ sheetPositioner: {
4078
+ justifyContent: "flex-end"
4079
+ },
4080
+ sheet: {
4081
+ borderTopLeftRadius: 24,
4082
+ borderTopRightRadius: 24,
4083
+ paddingHorizontal: 20,
4084
+ paddingBottom: 40
4085
+ },
4086
+ handleRow: {
4087
+ alignItems: "center",
4088
+ paddingTop: 10,
4089
+ paddingBottom: 8
4090
+ },
4091
+ handle: {
4092
+ width: 36,
4093
+ height: 4,
4094
+ borderRadius: 2,
4095
+ opacity: 0.4
4096
+ },
4097
+ header: {
4098
+ flexDirection: "row",
4099
+ alignItems: "center",
4100
+ justifyContent: "space-between",
4101
+ paddingVertical: 12
4102
+ },
4103
+ headerTitle: {
4104
+ fontSize: 20,
4105
+ fontWeight: "700"
4106
+ },
4107
+ closeButton: {
4108
+ fontSize: 20,
4109
+ padding: 4
4110
+ },
4111
+ section: {
4112
+ gap: 12,
4113
+ paddingTop: 8
4114
+ },
4115
+ sectionLabel: {
4116
+ fontSize: 15,
4117
+ fontWeight: "600"
4118
+ },
4119
+ teamsRow: {
4120
+ flexDirection: "row",
4121
+ gap: 12
4122
+ },
4123
+ summaryCard: {
4124
+ marginTop: 20,
4125
+ borderRadius: 16,
4126
+ borderWidth: 1,
4127
+ overflow: "hidden"
4128
+ },
4129
+ summaryRow: {
4130
+ flexDirection: "row",
4131
+ alignItems: "center",
4132
+ justifyContent: "space-between",
4133
+ paddingHorizontal: 16,
4134
+ paddingVertical: 14
4135
+ },
4136
+ summaryLabel: {
4137
+ fontSize: 14
4138
+ },
4139
+ summaryValue: {
4140
+ fontSize: 15,
4141
+ fontWeight: "700"
4142
+ },
4143
+ summarySep: {
4144
+ height: 1,
4145
+ marginHorizontal: 16
4146
+ },
4147
+ errorBox: {
4148
+ marginTop: 16,
4149
+ borderRadius: 12,
4150
+ borderWidth: 1,
4151
+ padding: 12
4152
+ },
4153
+ errorText: {
4154
+ fontSize: 13,
4155
+ fontWeight: "500"
4156
+ },
4157
+ ctaButton: {
4158
+ marginTop: 20,
4159
+ height: 56,
4160
+ borderRadius: 14,
4161
+ justifyContent: "center",
4162
+ alignItems: "center"
4163
+ },
4164
+ ctaText: {
4165
+ color: "#FFFFFF",
4166
+ fontSize: 16,
4167
+ fontWeight: "700"
4168
+ },
4169
+ ctaLoading: {
4170
+ flexDirection: "row",
4171
+ alignItems: "center",
4172
+ gap: 10
4173
+ },
4174
+ // Team button styles
4175
+ teamOption: {
4176
+ flex: 1,
4177
+ borderWidth: 2,
4178
+ borderRadius: 16,
4179
+ padding: 16,
4180
+ alignItems: "center",
4181
+ gap: 8
4182
+ },
4183
+ teamLogo: {
4184
+ width: 48,
4185
+ height: 48,
4186
+ borderRadius: 24
4187
+ },
4188
+ teamLogoPlaceholder: {
4189
+ backgroundColor: "rgba(128,128,128,0.2)"
4190
+ },
4191
+ teamName: {
4192
+ fontSize: 15,
4193
+ fontWeight: "700"
4194
+ },
4195
+ teamOdds: {
4196
+ fontSize: 20,
4197
+ fontWeight: "800"
4198
+ },
4199
+ teamBets: {
4200
+ fontSize: 12
4201
+ },
4202
+ teamBadge: {
4203
+ borderRadius: 8,
4204
+ paddingHorizontal: 12,
4205
+ paddingVertical: 4,
4206
+ marginTop: 4
4207
+ },
4208
+ teamBadgeText: {
4209
+ color: "#FFF",
4210
+ fontSize: 12,
4211
+ fontWeight: "700"
4212
+ }
4213
+ });
3828
4214
  // Annotate the CommonJS export names for ESM import in node:
3829
4215
  0 && (module.exports = {
3830
4216
  AuthGate,
@@ -3837,6 +4223,7 @@ var styles9 = import_react_native14.StyleSheet.create({
3837
4223
  DubsProvider,
3838
4224
  GamePoster,
3839
4225
  JoinGameButton,
4226
+ JoinGameSheet,
3840
4227
  LivePoolsCard,
3841
4228
  MwaWalletAdapter,
3842
4229
  NETWORK_CONFIG,