be-components 0.7.3 → 0.7.5
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/lib/commonjs/ApiOverrides/index.js +18 -0
- package/lib/commonjs/ApiOverrides/index.js.map +1 -1
- package/lib/commonjs/Authenticator/Components/AuthStrategyIdentifier.js +113 -0
- package/lib/commonjs/Authenticator/Components/AuthStrategyIdentifier.js.map +1 -0
- package/lib/commonjs/Authenticator/Components/StrategyForm.js +238 -71
- package/lib/commonjs/Authenticator/Components/StrategyForm.js.map +1 -1
- package/lib/commonjs/Authenticator/index.js +7 -4
- package/lib/commonjs/Authenticator/index.js.map +1 -1
- package/lib/commonjs/Checkout/api/index.js.map +1 -1
- package/lib/commonjs/Checkout/index.js.map +1 -1
- package/lib/commonjs/Competition/api/index.js +655 -0
- package/lib/commonjs/Competition/api/index.js.map +1 -0
- package/lib/commonjs/Competition/components/AthleteMarketCard.js +168 -0
- package/lib/commonjs/Competition/components/AthleteMarketCard.js.map +1 -0
- package/lib/commonjs/Competition/components/CompetitionCard.js +180 -0
- package/lib/commonjs/Competition/components/CompetitionCard.js.map +1 -0
- package/lib/commonjs/Competition/components/CompetitionInfoCard.js +264 -0
- package/lib/commonjs/Competition/components/CompetitionInfoCard.js.map +1 -0
- package/lib/commonjs/Competition/components/CompetitionLeaderboard.js +281 -0
- package/lib/commonjs/Competition/components/CompetitionLeaderboard.js.map +1 -0
- package/lib/commonjs/Competition/components/CompetitionPlay.js +1269 -0
- package/lib/commonjs/Competition/components/CompetitionPlay.js.map +1 -0
- package/lib/commonjs/Competition/components/CompetitionSeasonCard.js +111 -0
- package/lib/commonjs/Competition/components/CompetitionSeasonCard.js.map +1 -0
- package/lib/commonjs/Competition/components/CompetitionSelector.js +122 -0
- package/lib/commonjs/Competition/components/CompetitionSelector.js.map +1 -0
- package/lib/commonjs/Competition/components/CompetitionTypeCard.js +380 -0
- package/lib/commonjs/Competition/components/CompetitionTypeCard.js.map +1 -0
- package/lib/commonjs/Competition/components/EnterCompetitionPrompt.js +237 -0
- package/lib/commonjs/Competition/components/EnterCompetitionPrompt.js.map +1 -0
- package/lib/commonjs/Competition/components/LeaderPicks.js +322 -0
- package/lib/commonjs/Competition/components/LeaderPicks.js.map +1 -0
- package/lib/commonjs/Competition/components/ManageSeasonForm.js +605 -0
- package/lib/commonjs/Competition/components/ManageSeasonForm.js.map +1 -0
- package/lib/commonjs/Competition/components/MarketsCard.js +148 -0
- package/lib/commonjs/Competition/components/MarketsCard.js.map +1 -0
- package/lib/commonjs/Competition/components/MatchMarketCard.js +199 -0
- package/lib/commonjs/Competition/components/MatchMarketCard.js.map +1 -0
- package/lib/commonjs/Competition/components/NavOutPrompt.js +159 -0
- package/lib/commonjs/Competition/components/NavOutPrompt.js.map +1 -0
- package/lib/commonjs/Competition/components/SeasonInfoModal.js +400 -0
- package/lib/commonjs/Competition/components/SeasonInfoModal.js.map +1 -0
- package/lib/commonjs/Competition/components/TeamEventCard.js +217 -0
- package/lib/commonjs/Competition/components/TeamEventCard.js.map +1 -0
- package/lib/commonjs/Competition/components/WagerPickForm.js +278 -0
- package/lib/commonjs/Competition/components/WagerPickForm.js.map +1 -0
- package/lib/commonjs/Competition/index.js +42 -0
- package/lib/commonjs/Competition/index.js.map +1 -0
- package/lib/commonjs/Components/Icons.js.map +1 -1
- package/lib/commonjs/Components/Jerseys.js +713 -0
- package/lib/commonjs/Components/Jerseys.js.map +1 -0
- package/lib/commonjs/Components/LinearDiagnal.js +1 -1
- package/lib/commonjs/Components/LinearDiagnal.js.map +1 -1
- package/lib/commonjs/Components/Switch.js +81 -0
- package/lib/commonjs/Components/Switch.js.map +1 -0
- package/lib/commonjs/Components/index.js +14 -0
- package/lib/commonjs/Components/index.js.map +1 -1
- package/lib/commonjs/Poll/api/index.js +277 -0
- package/lib/commonjs/Poll/api/index.js.map +1 -0
- package/lib/commonjs/Poll/components/CampaignPlay.js +553 -0
- package/lib/commonjs/Poll/components/CampaignPlay.js.map +1 -0
- package/lib/commonjs/Poll/components/CampaignProgressBar.js +118 -0
- package/lib/commonjs/Poll/components/CampaignProgressBar.js.map +1 -0
- package/lib/commonjs/Poll/components/CampaignResult.js +382 -0
- package/lib/commonjs/Poll/components/CampaignResult.js.map +1 -0
- package/lib/commonjs/Poll/components/CampaignSelector.js +124 -0
- package/lib/commonjs/Poll/components/CampaignSelector.js.map +1 -0
- package/lib/commonjs/Poll/components/PollCampaignCard.js +66 -0
- package/lib/commonjs/Poll/components/PollCampaignCard.js.map +1 -0
- package/lib/commonjs/Poll/components/PollCard.js +480 -0
- package/lib/commonjs/Poll/components/PollCard.js.map +1 -0
- package/lib/commonjs/Poll/components/PollOptionCard.js +158 -0
- package/lib/commonjs/Poll/components/PollOptionCard.js.map +1 -0
- package/lib/commonjs/Poll/components/PollSelectCard.js +189 -0
- package/lib/commonjs/Poll/components/PollSelectCard.js.map +1 -0
- package/lib/commonjs/Poll/components/ResponseTimer.js +48 -0
- package/lib/commonjs/Poll/components/ResponseTimer.js.map +1 -0
- package/lib/commonjs/Poll/components/WidgetHeader.js +83 -0
- package/lib/commonjs/Poll/components/WidgetHeader.js.map +1 -0
- package/lib/commonjs/Poll/flashmarket/index.js +354 -0
- package/lib/commonjs/Poll/flashmarket/index.js.map +1 -0
- package/lib/commonjs/Poll/index.js +46 -0
- package/lib/commonjs/Poll/index.js.map +1 -0
- package/lib/commonjs/ProfileManager/Components/BasicInfoManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/BasicStatus.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/CodeRedeem.js +3 -1
- package/lib/commonjs/ProfileManager/Components/CodeRedeem.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/DOBManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/EmailManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/PasswordManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/PhoneManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/ProfilePicManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/ProfileWelcome.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/ProfileWizard.js +5 -0
- package/lib/commonjs/ProfileManager/Components/ProfileWizard.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/VouchCard.js.map +1 -1
- package/lib/commonjs/ProfileManager/index.js +2 -0
- package/lib/commonjs/ProfileManager/index.js.map +1 -1
- package/lib/commonjs/Wallet/api/index.js +4 -1
- package/lib/commonjs/Wallet/api/index.js.map +1 -1
- package/lib/commonjs/Wallet/components/ACHAddCard.js.map +1 -1
- package/lib/commonjs/Wallet/components/AddressManager.js.map +1 -1
- package/lib/commonjs/Wallet/components/DepositCard.js.map +1 -1
- package/lib/commonjs/Wallet/components/FundAccountCard.js.map +1 -1
- package/lib/commonjs/Wallet/components/ManageAccountCard.js.map +1 -1
- package/lib/commonjs/Wallet/components/ManualACHAdd.js.map +1 -1
- package/lib/commonjs/Wallet/components/ManualCardAdd.js.map +1 -1
- package/lib/commonjs/Wallet/components/MyBalance.js.map +1 -1
- package/lib/commonjs/Wallet/components/WalletActionSelector.js.map +1 -1
- package/lib/commonjs/Wallet/components/WalletSettings.js.map +1 -1
- package/lib/commonjs/Wallet/components/WalletSetup.js.map +1 -1
- package/lib/commonjs/Wallet/components/WithdrawCard.js.map +1 -1
- package/lib/commonjs/Wallet/index.js.map +1 -1
- package/lib/commonjs/index.js +14 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/ApiOverrides/index.js +18 -0
- package/lib/module/ApiOverrides/index.js.map +1 -1
- package/lib/module/Authenticator/Components/AuthStrategyIdentifier.js +106 -0
- package/lib/module/Authenticator/Components/AuthStrategyIdentifier.js.map +1 -0
- package/lib/module/Authenticator/Components/StrategyForm.js +239 -72
- package/lib/module/Authenticator/Components/StrategyForm.js.map +1 -1
- package/lib/module/Authenticator/index.js +7 -4
- package/lib/module/Authenticator/index.js.map +1 -1
- package/lib/module/Checkout/api/index.js.map +1 -1
- package/lib/module/Checkout/index.js.map +1 -1
- package/lib/module/Competition/api/index.js +649 -0
- package/lib/module/Competition/api/index.js.map +1 -0
- package/lib/module/Competition/components/AthleteMarketCard.js +161 -0
- package/lib/module/Competition/components/AthleteMarketCard.js.map +1 -0
- package/lib/module/Competition/components/CompetitionCard.js +173 -0
- package/lib/module/Competition/components/CompetitionCard.js.map +1 -0
- package/lib/module/Competition/components/CompetitionInfoCard.js +257 -0
- package/lib/module/Competition/components/CompetitionInfoCard.js.map +1 -0
- package/lib/module/Competition/components/CompetitionLeaderboard.js +272 -0
- package/lib/module/Competition/components/CompetitionLeaderboard.js.map +1 -0
- package/lib/module/Competition/components/CompetitionPlay.js +1260 -0
- package/lib/module/Competition/components/CompetitionPlay.js.map +1 -0
- package/lib/module/Competition/components/CompetitionSeasonCard.js +104 -0
- package/lib/module/Competition/components/CompetitionSeasonCard.js.map +1 -0
- package/lib/module/Competition/components/CompetitionSelector.js +113 -0
- package/lib/module/Competition/components/CompetitionSelector.js.map +1 -0
- package/lib/module/Competition/components/CompetitionTypeCard.js +371 -0
- package/lib/module/Competition/components/CompetitionTypeCard.js.map +1 -0
- package/lib/module/Competition/components/EnterCompetitionPrompt.js +228 -0
- package/lib/module/Competition/components/EnterCompetitionPrompt.js.map +1 -0
- package/lib/module/Competition/components/LeaderPicks.js +313 -0
- package/lib/module/Competition/components/LeaderPicks.js.map +1 -0
- package/lib/module/Competition/components/ManageSeasonForm.js +596 -0
- package/lib/module/Competition/components/ManageSeasonForm.js.map +1 -0
- package/lib/module/Competition/components/MarketsCard.js +139 -0
- package/lib/module/Competition/components/MarketsCard.js.map +1 -0
- package/lib/module/Competition/components/MatchMarketCard.js +192 -0
- package/lib/module/Competition/components/MatchMarketCard.js.map +1 -0
- package/lib/module/Competition/components/NavOutPrompt.js +152 -0
- package/lib/module/Competition/components/NavOutPrompt.js.map +1 -0
- package/lib/module/Competition/components/SeasonInfoModal.js +391 -0
- package/lib/module/Competition/components/SeasonInfoModal.js.map +1 -0
- package/lib/module/Competition/components/TeamEventCard.js +210 -0
- package/lib/module/Competition/components/TeamEventCard.js.map +1 -0
- package/lib/module/Competition/components/WagerPickForm.js +269 -0
- package/lib/module/Competition/components/WagerPickForm.js.map +1 -0
- package/lib/module/Competition/index.js +33 -0
- package/lib/module/Competition/index.js.map +1 -0
- package/lib/module/Components/Icons.js.map +1 -1
- package/lib/module/Components/Jerseys.js +705 -0
- package/lib/module/Components/Jerseys.js.map +1 -0
- package/lib/module/Components/LinearDiagnal.js +2 -3
- package/lib/module/Components/LinearDiagnal.js.map +1 -1
- package/lib/module/Components/Switch.js +74 -0
- package/lib/module/Components/Switch.js.map +1 -0
- package/lib/module/Components/index.js +3 -1
- package/lib/module/Components/index.js.map +1 -1
- package/lib/module/Poll/api/index.js +271 -0
- package/lib/module/Poll/api/index.js.map +1 -0
- package/lib/module/Poll/components/CampaignPlay.js +545 -0
- package/lib/module/Poll/components/CampaignPlay.js.map +1 -0
- package/lib/module/Poll/components/CampaignProgressBar.js +110 -0
- package/lib/module/Poll/components/CampaignProgressBar.js.map +1 -0
- package/lib/module/Poll/components/CampaignResult.js +374 -0
- package/lib/module/Poll/components/CampaignResult.js.map +1 -0
- package/lib/module/Poll/components/CampaignSelector.js +115 -0
- package/lib/module/Poll/components/CampaignSelector.js.map +1 -0
- package/lib/module/Poll/components/PollCampaignCard.js +59 -0
- package/lib/module/Poll/components/PollCampaignCard.js.map +1 -0
- package/lib/module/Poll/components/PollCard.js +472 -0
- package/lib/module/Poll/components/PollCard.js.map +1 -0
- package/lib/module/Poll/components/PollOptionCard.js +149 -0
- package/lib/module/Poll/components/PollOptionCard.js.map +1 -0
- package/lib/module/Poll/components/PollSelectCard.js +182 -0
- package/lib/module/Poll/components/PollSelectCard.js.map +1 -0
- package/lib/module/Poll/components/ResponseTimer.js +39 -0
- package/lib/module/Poll/components/ResponseTimer.js.map +1 -0
- package/lib/module/Poll/components/WidgetHeader.js +76 -0
- package/lib/module/Poll/components/WidgetHeader.js.map +1 -0
- package/lib/module/Poll/flashmarket/index.js +345 -0
- package/lib/module/Poll/flashmarket/index.js.map +1 -0
- package/lib/module/Poll/index.js +37 -0
- package/lib/module/Poll/index.js.map +1 -0
- package/lib/module/ProfileManager/Components/BasicInfoManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/BasicStatus.js.map +1 -1
- package/lib/module/ProfileManager/Components/CodeRedeem.js +3 -1
- package/lib/module/ProfileManager/Components/CodeRedeem.js.map +1 -1
- package/lib/module/ProfileManager/Components/DOBManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/EmailManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/PasswordManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/PhoneManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/ProfilePicManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/ProfileWelcome.js.map +1 -1
- package/lib/module/ProfileManager/Components/ProfileWizard.js +5 -0
- package/lib/module/ProfileManager/Components/ProfileWizard.js.map +1 -1
- package/lib/module/ProfileManager/Components/VouchCard.js.map +1 -1
- package/lib/module/ProfileManager/index.js +2 -0
- package/lib/module/ProfileManager/index.js.map +1 -1
- package/lib/module/Wallet/api/index.js +4 -1
- package/lib/module/Wallet/api/index.js.map +1 -1
- package/lib/module/Wallet/components/ACHAddCard.js.map +1 -1
- package/lib/module/Wallet/components/AddressManager.js.map +1 -1
- package/lib/module/Wallet/components/DepositCard.js.map +1 -1
- package/lib/module/Wallet/components/FundAccountCard.js.map +1 -1
- package/lib/module/Wallet/components/ManageAccountCard.js.map +1 -1
- package/lib/module/Wallet/components/ManualACHAdd.js.map +1 -1
- package/lib/module/Wallet/components/ManualCardAdd.js.map +1 -1
- package/lib/module/Wallet/components/MyBalance.js.map +1 -1
- package/lib/module/Wallet/components/WalletActionSelector.js.map +1 -1
- package/lib/module/Wallet/components/WalletSettings.js.map +1 -1
- package/lib/module/Wallet/components/WalletSetup.js.map +1 -1
- package/lib/module/Wallet/components/WithdrawCard.js.map +1 -1
- package/lib/module/Wallet/index.js.map +1 -1
- package/lib/module/index.js +3 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/ApiOverrides/index.d.ts +1 -0
- package/lib/typescript/src/ApiOverrides/index.d.ts.map +1 -1
- package/lib/typescript/src/Authenticator/Components/AuthStrategyIdentifier.d.ts +11 -0
- package/lib/typescript/src/Authenticator/Components/AuthStrategyIdentifier.d.ts.map +1 -0
- package/lib/typescript/src/Authenticator/Components/StrategyForm.d.ts +4 -1
- package/lib/typescript/src/Authenticator/Components/StrategyForm.d.ts.map +1 -1
- package/lib/typescript/src/Authenticator/api/index.d.ts +2 -2
- package/lib/typescript/src/Authenticator/api/index.d.ts.map +1 -1
- package/lib/typescript/src/Authenticator/index.d.ts +2 -1
- package/lib/typescript/src/Authenticator/index.d.ts.map +1 -1
- package/lib/typescript/src/Checkout/api/index.d.ts +1 -2
- package/lib/typescript/src/Checkout/api/index.d.ts.map +1 -1
- package/lib/typescript/src/Checkout/index.d.ts.map +1 -1
- package/lib/typescript/src/Competition/api/index.d.ts +128 -0
- package/lib/typescript/src/Competition/api/index.d.ts.map +1 -0
- package/lib/typescript/src/Competition/components/AthleteMarketCard.d.ts +19 -0
- package/lib/typescript/src/Competition/components/AthleteMarketCard.d.ts.map +1 -0
- package/lib/typescript/src/Competition/components/CompetitionCard.d.ts +12 -0
- package/lib/typescript/src/Competition/components/CompetitionCard.d.ts.map +1 -0
- package/lib/typescript/src/Competition/components/CompetitionInfoCard.d.ts +16 -0
- package/lib/typescript/src/Competition/components/CompetitionInfoCard.d.ts.map +1 -0
- package/lib/typescript/src/Competition/components/CompetitionLeaderboard.d.ts +14 -0
- package/lib/typescript/src/Competition/components/CompetitionLeaderboard.d.ts.map +1 -0
- package/lib/typescript/src/Competition/components/CompetitionPlay.d.ts +20 -0
- package/lib/typescript/src/Competition/components/CompetitionPlay.d.ts.map +1 -0
- package/lib/typescript/src/Competition/components/CompetitionSeasonCard.d.ts +10 -0
- package/lib/typescript/src/Competition/components/CompetitionSeasonCard.d.ts.map +1 -0
- package/lib/typescript/src/Competition/components/CompetitionSelector.d.ts +11 -0
- package/lib/typescript/src/Competition/components/CompetitionSelector.d.ts.map +1 -0
- package/lib/typescript/src/Competition/components/CompetitionTypeCard.d.ts +14 -0
- package/lib/typescript/src/Competition/components/CompetitionTypeCard.d.ts.map +1 -0
- package/lib/typescript/src/Competition/components/EnterCompetitionPrompt.d.ts +16 -0
- package/lib/typescript/src/Competition/components/EnterCompetitionPrompt.d.ts.map +1 -0
- package/lib/typescript/src/Competition/components/LeaderPicks.d.ts +22 -0
- package/lib/typescript/src/Competition/components/LeaderPicks.d.ts.map +1 -0
- package/lib/typescript/src/Competition/components/ManageSeasonForm.d.ts +10 -0
- package/lib/typescript/src/Competition/components/ManageSeasonForm.d.ts.map +1 -0
- package/lib/typescript/src/Competition/components/MarketsCard.d.ts +15 -0
- package/lib/typescript/src/Competition/components/MarketsCard.d.ts.map +1 -0
- package/lib/typescript/src/Competition/components/MatchMarketCard.d.ts +21 -0
- package/lib/typescript/src/Competition/components/MatchMarketCard.d.ts.map +1 -0
- package/lib/typescript/src/Competition/components/NavOutPrompt.d.ts +23 -0
- package/lib/typescript/src/Competition/components/NavOutPrompt.d.ts.map +1 -0
- package/lib/typescript/src/Competition/components/SeasonInfoModal.d.ts +14 -0
- package/lib/typescript/src/Competition/components/SeasonInfoModal.d.ts.map +1 -0
- package/lib/typescript/src/Competition/components/TeamEventCard.d.ts +17 -0
- package/lib/typescript/src/Competition/components/TeamEventCard.d.ts.map +1 -0
- package/lib/typescript/src/Competition/components/WagerPickForm.d.ts +15 -0
- package/lib/typescript/src/Competition/components/WagerPickForm.d.ts.map +1 -0
- package/lib/typescript/src/Competition/index.d.ts +11 -0
- package/lib/typescript/src/Competition/index.d.ts.map +1 -0
- package/lib/typescript/src/Components/Icons.d.ts.map +1 -1
- package/lib/typescript/src/Components/Jerseys.d.ts +16 -0
- package/lib/typescript/src/Components/Jerseys.d.ts.map +1 -0
- package/lib/typescript/src/Components/LinearDiagnal.d.ts.map +1 -1
- package/lib/typescript/src/Components/Switch.d.ts +9 -0
- package/lib/typescript/src/Components/Switch.d.ts.map +1 -0
- package/lib/typescript/src/Components/index.d.ts +3 -1
- package/lib/typescript/src/Components/index.d.ts.map +1 -1
- package/lib/typescript/src/Poll/api/index.d.ts +65 -0
- package/lib/typescript/src/Poll/api/index.d.ts.map +1 -0
- package/lib/typescript/src/Poll/components/CampaignPlay.d.ts +14 -0
- package/lib/typescript/src/Poll/components/CampaignPlay.d.ts.map +1 -0
- package/lib/typescript/src/Poll/components/CampaignProgressBar.d.ts +12 -0
- package/lib/typescript/src/Poll/components/CampaignProgressBar.d.ts.map +1 -0
- package/lib/typescript/src/Poll/components/CampaignResult.d.ts +13 -0
- package/lib/typescript/src/Poll/components/CampaignResult.d.ts.map +1 -0
- package/lib/typescript/src/Poll/components/CampaignSelector.d.ts +9 -0
- package/lib/typescript/src/Poll/components/CampaignSelector.d.ts.map +1 -0
- package/lib/typescript/src/Poll/components/PollCampaignCard.d.ts +10 -0
- package/lib/typescript/src/Poll/components/PollCampaignCard.d.ts.map +1 -0
- package/lib/typescript/src/Poll/components/PollCard.d.ts +16 -0
- package/lib/typescript/src/Poll/components/PollCard.d.ts.map +1 -0
- package/lib/typescript/src/Poll/components/PollOptionCard.d.ts +14 -0
- package/lib/typescript/src/Poll/components/PollOptionCard.d.ts.map +1 -0
- package/lib/typescript/src/Poll/components/PollSelectCard.d.ts +16 -0
- package/lib/typescript/src/Poll/components/PollSelectCard.d.ts.map +1 -0
- package/lib/typescript/src/Poll/components/ResponseTimer.d.ts +9 -0
- package/lib/typescript/src/Poll/components/ResponseTimer.d.ts.map +1 -0
- package/lib/typescript/src/Poll/components/WidgetHeader.d.ts +13 -0
- package/lib/typescript/src/Poll/components/WidgetHeader.d.ts.map +1 -0
- package/lib/typescript/src/Poll/flashmarket/index.d.ts +10 -0
- package/lib/typescript/src/Poll/flashmarket/index.d.ts.map +1 -0
- package/lib/typescript/src/Poll/index.d.ts +13 -0
- package/lib/typescript/src/Poll/index.d.ts.map +1 -0
- package/lib/typescript/src/ProfileManager/Components/BasicInfoManager.d.ts +1 -1
- package/lib/typescript/src/ProfileManager/Components/BasicInfoManager.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/BasicStatus.d.ts +1 -2
- package/lib/typescript/src/ProfileManager/Components/BasicStatus.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/CodeRedeem.d.ts +9 -2
- package/lib/typescript/src/ProfileManager/Components/CodeRedeem.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/DOBManager.d.ts +1 -1
- package/lib/typescript/src/ProfileManager/Components/DOBManager.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/EmailManager.d.ts +1 -1
- package/lib/typescript/src/ProfileManager/Components/EmailManager.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/PasswordManager.d.ts +1 -1
- package/lib/typescript/src/ProfileManager/Components/PasswordManager.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/PhoneManager.d.ts +1 -1
- package/lib/typescript/src/ProfileManager/Components/PhoneManager.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/ProfilePicManager.d.ts +1 -1
- package/lib/typescript/src/ProfileManager/Components/ProfilePicManager.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/ProfileWelcome.d.ts +1 -2
- package/lib/typescript/src/ProfileManager/Components/ProfileWelcome.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/ProfileWizard.d.ts +10 -3
- package/lib/typescript/src/ProfileManager/Components/ProfileWizard.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/SettingsManager.d.ts +2 -2
- package/lib/typescript/src/ProfileManager/Components/SettingsManager.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/VouchCard.d.ts +1 -2
- package/lib/typescript/src/ProfileManager/Components/VouchCard.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/api/index.d.ts +2 -2
- package/lib/typescript/src/ProfileManager/api/index.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/index.d.ts +9 -2
- package/lib/typescript/src/ProfileManager/index.d.ts.map +1 -1
- package/lib/typescript/src/Wallet/api/index.d.ts +2 -3
- package/lib/typescript/src/Wallet/api/index.d.ts.map +1 -1
- package/lib/typescript/src/Wallet/components/ACHAddCard.d.ts +1 -2
- package/lib/typescript/src/Wallet/components/ACHAddCard.d.ts.map +1 -1
- package/lib/typescript/src/Wallet/components/AddressManager.d.ts +1 -2
- package/lib/typescript/src/Wallet/components/AddressManager.d.ts.map +1 -1
- package/lib/typescript/src/Wallet/components/DepositCard.d.ts +1 -2
- package/lib/typescript/src/Wallet/components/DepositCard.d.ts.map +1 -1
- package/lib/typescript/src/Wallet/components/FundAccountCard.d.ts +1 -2
- package/lib/typescript/src/Wallet/components/FundAccountCard.d.ts.map +1 -1
- package/lib/typescript/src/Wallet/components/ManageAccountCard.d.ts +1 -2
- package/lib/typescript/src/Wallet/components/ManageAccountCard.d.ts.map +1 -1
- package/lib/typescript/src/Wallet/components/ManualACHAdd.d.ts +1 -2
- package/lib/typescript/src/Wallet/components/ManualACHAdd.d.ts.map +1 -1
- package/lib/typescript/src/Wallet/components/ManualCardAdd.d.ts +1 -2
- package/lib/typescript/src/Wallet/components/ManualCardAdd.d.ts.map +1 -1
- package/lib/typescript/src/Wallet/components/MyBalance.d.ts +1 -2
- package/lib/typescript/src/Wallet/components/MyBalance.d.ts.map +1 -1
- package/lib/typescript/src/Wallet/components/WalletActionSelector.d.ts +1 -2
- package/lib/typescript/src/Wallet/components/WalletActionSelector.d.ts.map +1 -1
- package/lib/typescript/src/Wallet/components/WalletSettings.d.ts +1 -2
- package/lib/typescript/src/Wallet/components/WalletSettings.d.ts.map +1 -1
- package/lib/typescript/src/Wallet/components/WalletSetup.d.ts +1 -2
- package/lib/typescript/src/Wallet/components/WalletSetup.d.ts.map +1 -1
- package/lib/typescript/src/Wallet/components/WithdrawCard.d.ts +1 -2
- package/lib/typescript/src/Wallet/components/WithdrawCard.d.ts.map +1 -1
- package/lib/typescript/src/Wallet/index.d.ts +1 -2
- package/lib/typescript/src/Wallet/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +3 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/ApiOverrides/index.ts +19 -0
- package/src/Authenticator/Components/AuthStrategyIdentifier.tsx +72 -0
- package/src/Authenticator/Components/StrategyForm.tsx +208 -53
- package/src/Authenticator/api/index.ts +2 -2
- package/src/Authenticator/api/types.d.ts +3 -26
- package/src/Authenticator/index.tsx +10 -4
- package/src/Checkout/api/index.tsx +1 -2
- package/src/Checkout/index.tsx +1 -2
- package/src/Competition/api/index.ts +568 -0
- package/src/Competition/components/AthleteMarketCard.tsx +116 -0
- package/src/Competition/components/CompetitionCard.tsx +82 -0
- package/src/Competition/components/CompetitionInfoCard.tsx +149 -0
- package/src/Competition/components/CompetitionLeaderboard.tsx +183 -0
- package/src/Competition/components/CompetitionPlay.tsx +936 -0
- package/src/Competition/components/CompetitionSeasonCard.tsx +48 -0
- package/src/Competition/components/CompetitionSelector.tsx +91 -0
- package/src/Competition/components/CompetitionTypeCard.tsx +211 -0
- package/src/Competition/components/EnterCompetitionPrompt.tsx +127 -0
- package/src/Competition/components/LeaderPicks.tsx +214 -0
- package/src/Competition/components/ManageSeasonForm.tsx +271 -0
- package/src/Competition/components/MarketsCard.tsx +108 -0
- package/src/Competition/components/MatchMarketCard.tsx +126 -0
- package/src/Competition/components/NavOutPrompt.tsx +87 -0
- package/src/Competition/components/SeasonInfoModal.tsx +212 -0
- package/src/Competition/components/TeamEventCard.tsx +136 -0
- package/src/Competition/components/WagerPickForm.tsx +114 -0
- package/src/Competition/index.tsx +36 -0
- package/src/Components/Icons.tsx +0 -2
- package/src/Components/Jerseys.tsx +268 -0
- package/src/Components/LinearDiagnal.tsx +2 -3
- package/src/Components/Switch.tsx +55 -0
- package/src/Components/index.tsx +5 -1
- package/src/Poll/api/index.ts +212 -0
- package/src/Poll/components/CampaignPlay.tsx +407 -0
- package/src/Poll/components/CampaignProgressBar.tsx +70 -0
- package/src/Poll/components/CampaignResult.tsx +180 -0
- package/src/Poll/components/CampaignSelector.tsx +96 -0
- package/src/Poll/components/PollCampaignCard.tsx +35 -0
- package/src/Poll/components/PollCard.tsx +335 -0
- package/src/Poll/components/PollOptionCard.tsx +110 -0
- package/src/Poll/components/PollSelectCard.tsx +106 -0
- package/src/Poll/components/ResponseTimer.tsx +37 -0
- package/src/Poll/components/WidgetHeader.tsx +46 -0
- package/src/Poll/flashmarket/index.tsx +231 -0
- package/src/Poll/index.tsx +45 -0
- package/src/ProfileManager/Components/BasicInfoManager.tsx +1 -1
- package/src/ProfileManager/Components/BasicStatus.tsx +1 -2
- package/src/ProfileManager/Components/CodeRedeem.tsx +10 -3
- package/src/ProfileManager/Components/DOBManager.tsx +1 -1
- package/src/ProfileManager/Components/EmailManager.tsx +1 -1
- package/src/ProfileManager/Components/PasswordManager.tsx +2 -1
- package/src/ProfileManager/Components/PhoneManager.tsx +1 -1
- package/src/ProfileManager/Components/ProfilePicManager.tsx +1 -1
- package/src/ProfileManager/Components/ProfileWelcome.tsx +1 -2
- package/src/ProfileManager/Components/ProfileWizard.tsx +14 -3
- package/src/ProfileManager/Components/SettingsManager.tsx +2 -2
- package/src/ProfileManager/Components/VouchCard.tsx +1 -2
- package/src/ProfileManager/api/index.ts +2 -2
- package/src/ProfileManager/api/types.d.ts +0 -35
- package/src/ProfileManager/index.tsx +11 -3
- package/src/Wallet/api/index.ts +6 -4
- package/src/Wallet/components/ACHAddCard.tsx +1 -2
- package/src/Wallet/components/AddressManager.tsx +1 -2
- package/src/Wallet/components/DepositCard.tsx +1 -2
- package/src/Wallet/components/FundAccountCard.tsx +1 -2
- package/src/Wallet/components/ManageAccountCard.tsx +1 -2
- package/src/Wallet/components/ManualACHAdd.tsx +1 -2
- package/src/Wallet/components/ManualCardAdd.tsx +1 -2
- package/src/Wallet/components/MyBalance.tsx +1 -2
- package/src/Wallet/components/WalletActionSelector.tsx +1 -2
- package/src/Wallet/components/WalletSettings.tsx +1 -2
- package/src/Wallet/components/WalletSetup.tsx +1 -2
- package/src/Wallet/components/WithdrawCard.tsx +1 -2
- package/src/Wallet/index.tsx +1 -2
- package/src/index.tsx +5 -2
- package/src/types.d.ts +486 -1
|
@@ -0,0 +1,568 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
import type { AthleteProps, CompetitionMatchMarketProps, CompetitionMatchProps, CompetitionPayoutTypeProps, CompetitionPlayerProps, CompetitionProps, CompetitionRecordProps, CompetitionResultProps, CompetitionResultTypeProps, CompetitionSeasonProps, CompetitionTypeProps, CreateCompetitionProps, EventProps, LeagueProps, MarketProps, MatchProps, MyPlayerProps, PlayerBalanceProps, PlayerPickProps, PlayerReferralProps, PromoProps, PublicPlayerProps, TeamProps, TournamentProps, TradeProps } from "../../types";
|
|
3
|
+
import { APIOverrides } from "../../ApiOverrides";
|
|
4
|
+
import moment from "moment-mini";
|
|
5
|
+
import Colors from "../../constants/colors";
|
|
6
|
+
|
|
7
|
+
let AUTH_SVC_API = ''
|
|
8
|
+
let TP_SVC_API = ''
|
|
9
|
+
let EVENT_SVC_API = ''
|
|
10
|
+
let MK_SVC_API = ''
|
|
11
|
+
export { CompetitionSeasonApi, CompetitionApi, CompetitionHelpers, CompetitionPlayerApi, PlayerPicksApi, CompetitionResultApi, CompetitionMatchApi }
|
|
12
|
+
|
|
13
|
+
const CompetitionSeasonApi = {
|
|
14
|
+
createCompetitionSeason : async(competition_season:CompetitionSeasonProps):Promise<CompetitionSeasonProps> => {
|
|
15
|
+
const resp = await axios.post(`${TP_SVC_API}/v1/competitions/season/create`, { competition_season })
|
|
16
|
+
return resp.data.competition_season
|
|
17
|
+
},
|
|
18
|
+
updateCompetitionSeason : async(competition_season:CompetitionSeasonProps):Promise<CompetitionSeasonProps> => {
|
|
19
|
+
const resp = await axios.post(`${TP_SVC_API}/v1/competitions/season/update`, { competition_season })
|
|
20
|
+
return resp.data.competition_season
|
|
21
|
+
},
|
|
22
|
+
getCompetitionSeasonTemplates: async(league_id?:string):Promise<CompetitionSeasonProps[]> => {
|
|
23
|
+
const resp = await axios.get(`${TP_SVC_API}/v1/competitions/seasons/templates?league_id=${league_id}`)
|
|
24
|
+
return resp.data.competition_seasons
|
|
25
|
+
},
|
|
26
|
+
getCompetitionSeasonsByAdminId: async(status?:string):Promise<CompetitionSeasonProps[]> => {
|
|
27
|
+
const resp = await axios.get(`${TP_SVC_API}/v1/competitions/seasons/me?status=${status}`)
|
|
28
|
+
return resp.data.competition_seasons
|
|
29
|
+
},
|
|
30
|
+
getCompetitionSeasonById: async(competition_season_id:string):Promise<CompetitionSeasonProps> => {
|
|
31
|
+
const resp = await axios.get(`${TP_SVC_API}/v1/competitions/seasons/season/${competition_season_id}`)
|
|
32
|
+
return resp.data.competition_season
|
|
33
|
+
},
|
|
34
|
+
getLeaderboardBySeasonId: async(competition_season_id:string):Promise<any> => {
|
|
35
|
+
const resp = await axios.get(`${TP_SVC_API}/v1/competitions/leaderboard/season/${competition_season_id}`)
|
|
36
|
+
return resp.data.season_leaderboard
|
|
37
|
+
},
|
|
38
|
+
getSponsoredCompetitionSeasons: async(sponsor_id:string):Promise<CompetitionSeasonProps[]> => {
|
|
39
|
+
const resp = await axios.get(`${TP_SVC_API}/v1/competitions/seasons/sponsored/${sponsor_id}`)
|
|
40
|
+
return resp.data.competition_seasons
|
|
41
|
+
},
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const CompetitionApi = {
|
|
45
|
+
setEnvironment: () => {
|
|
46
|
+
const endpoints = APIOverrides.getEndpoints();
|
|
47
|
+
TP_SVC_API = endpoints['TP_SVC_API'] as string;
|
|
48
|
+
EVENT_SVC_API = endpoints['EVENT_SVC_API'] as string;
|
|
49
|
+
MK_SVC_API = endpoints['MK_SVC_API'] as string;
|
|
50
|
+
AUTH_SVC_API = endpoints['AUTH_SVC_API'] as string;
|
|
51
|
+
},
|
|
52
|
+
getPlayersByPlayerIds : async(player_ids:string[]):Promise<PublicPlayerProps[]> => {
|
|
53
|
+
const resp = await axios.post(`${AUTH_SVC_API}/v1/players/bulk/get`, { player_ids })
|
|
54
|
+
return resp.data.players
|
|
55
|
+
},
|
|
56
|
+
getLeagues: async():Promise<LeagueProps[]> => {
|
|
57
|
+
const resp = await axios.get(`${EVENT_SVC_API}/v1/leagues?status=active`)
|
|
58
|
+
return resp.data.leagues
|
|
59
|
+
},
|
|
60
|
+
getMarkets: async():Promise<MarketProps[]> => {
|
|
61
|
+
const resp = await axios.get(`${MK_SVC_API}/v1/markets/all`)
|
|
62
|
+
return resp.data.markets
|
|
63
|
+
},
|
|
64
|
+
getLeagueById: async(league_id:string):Promise<LeagueProps> => {
|
|
65
|
+
const resp = await axios.get(`${EVENT_SVC_API}/v1/leagues/league/${league_id}`)
|
|
66
|
+
return resp.data.league
|
|
67
|
+
},
|
|
68
|
+
getCompetitionsByCompanyId: async(company_id:string, offset:number, status:'active'|'closed'):Promise<CompetitionProps[]> => {
|
|
69
|
+
const resp = await axios.get(`${TP_SVC_API}/v1/competitions/company/${company_id}?offset=${offset}&status=${status}`)
|
|
70
|
+
return resp.data.competitions
|
|
71
|
+
},
|
|
72
|
+
getCompetitionById: async(competition_id:string):Promise<CompetitionProps> => {
|
|
73
|
+
const resp = await axios.get(`${TP_SVC_API}/v1/competitions/competition/${competition_id}`)
|
|
74
|
+
return resp.data.competition
|
|
75
|
+
},
|
|
76
|
+
getCompetitionMatchesByCompetitionId: async(competition_id:string):Promise<{competition_matches:CompetitionMatchProps[], competition_match_markets:CompetitionMatchMarketProps[]}> => {
|
|
77
|
+
const resp = await axios.get(`${TP_SVC_API}/v1/competitions/matches/${competition_id}`)
|
|
78
|
+
return { competition_matches: resp.data.competition_matches, competition_match_markets: resp.data.competition_match_markets }
|
|
79
|
+
},
|
|
80
|
+
getEnteredCompetitions: async():Promise<{competitions: CompetitionProps[], competition_players:CompetitionPlayerProps[]}> => {
|
|
81
|
+
const resp = await axios.get(`${TP_SVC_API}/v1/competitions/entered`)
|
|
82
|
+
return resp.data
|
|
83
|
+
},
|
|
84
|
+
getCompetitionsBySeasonId: async(competition_season_id:string):Promise<CompetitionProps[]> => {
|
|
85
|
+
const resp = await axios.get(`${TP_SVC_API}/v1/competitions/season/${competition_season_id}`)
|
|
86
|
+
return resp.data.competitions
|
|
87
|
+
},
|
|
88
|
+
createCompetition: async(draft_competition:CreateCompetitionProps):Promise<{competition:CompetitionProps, competition_matches:CompetitionMatchProps[], competition_match_markets:CompetitionMatchMarketProps[], competition_players:CompetitionPlayerProps[]}> => {
|
|
89
|
+
const resp = await axios.post(`${TP_SVC_API}/v1/competitions/competition/create`, { draft_competition })
|
|
90
|
+
return resp.data
|
|
91
|
+
},
|
|
92
|
+
editCompetition: async(draft_competition:CreateCompetitionProps):Promise<{ competition:CompetitionProps, competition_matches:CompetitionMatchProps[], competition_match_markets:CompetitionMatchMarketProps[] }> => {
|
|
93
|
+
const resp = await axios.post(`${TP_SVC_API}/v1/competitions/competition/edit`, { draft_competition })
|
|
94
|
+
return resp.data
|
|
95
|
+
},
|
|
96
|
+
getPublicCompetitions: async(offset:number):Promise<CompetitionProps[]> => {
|
|
97
|
+
const resp = await axios.get(`${TP_SVC_API}/v1/competitions/all?offset=${offset}&status=scheduled`)
|
|
98
|
+
return resp.data.competitions
|
|
99
|
+
},
|
|
100
|
+
getActiveSponsoredCompetitions: async(sponsor_id:string):Promise<CompetitionProps[]> => {
|
|
101
|
+
const resp = await axios.get(`${TP_SVC_API}/v1/competitions/sponsored/${sponsor_id}`)
|
|
102
|
+
return resp.data.competitions
|
|
103
|
+
},
|
|
104
|
+
getCompetitionOptions: async():Promise<{competition_types:CompetitionTypeProps[], competition_result_types:CompetitionResultTypeProps[], competition_payout_types:CompetitionPayoutTypeProps[]}> => {
|
|
105
|
+
const resp = await axios.get(`${TP_SVC_API}/v1/competitions/options`)
|
|
106
|
+
return resp.data
|
|
107
|
+
},
|
|
108
|
+
getMyDetails: async():Promise<MyPlayerProps> => {
|
|
109
|
+
const resp = await axios.get(`${AUTH_SVC_API}/v1/players/player/me`)
|
|
110
|
+
return resp.data.player
|
|
111
|
+
},
|
|
112
|
+
getMyReferralCode: async():Promise<{ player_referral:PlayerReferralProps, promo:PromoProps }> => {
|
|
113
|
+
const resp = await axios.get(`${AUTH_SVC_API}/v1/promos/referral/me`)
|
|
114
|
+
return resp.data
|
|
115
|
+
},
|
|
116
|
+
getMyBalance: async():Promise<PlayerBalanceProps> => {
|
|
117
|
+
const resp = await axios.get(`${AUTH_SVC_API}/v1/players/player/balance/me`)
|
|
118
|
+
return resp.data.player_balance
|
|
119
|
+
},
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const CompetitionMatchApi = {
|
|
123
|
+
getCompetitionMatchesByCompetitionId: async(competition_id:string, status:string):Promise<{competition_matches:CompetitionMatchProps[], competition_match_markets:CompetitionMatchMarketProps[]}> => {
|
|
124
|
+
const resp = await axios.get(`${TP_SVC_API}/v1/competitions/matches/${competition_id}?status=${status}`)
|
|
125
|
+
return resp.data
|
|
126
|
+
},
|
|
127
|
+
getEventsByEventIds: async(event_ids:string[]):Promise<EventProps[]> => {
|
|
128
|
+
const resp = await axios.post(`${EVENT_SVC_API}/v1/events/bulk/get`, { attribute:'event_id', values: event_ids })
|
|
129
|
+
return resp.data.events
|
|
130
|
+
},
|
|
131
|
+
getMatchesByMatchIds: async(match_ids:string[]):Promise<MatchProps[]> => {
|
|
132
|
+
const resp = await axios.post(`${EVENT_SVC_API}/v1/matches/bulk/get`, { attribute: 'match_id', values: match_ids })
|
|
133
|
+
return resp.data.matches
|
|
134
|
+
},
|
|
135
|
+
getAthletesByIds : async(athlete_ids:string[]) => {
|
|
136
|
+
const resp = await axios.post(`${EVENT_SVC_API}/v1/athletes/bulk/get`, { attribute: 'athlete_id', values: athlete_ids })
|
|
137
|
+
return resp.data.athletes
|
|
138
|
+
},
|
|
139
|
+
getTournamentsByTournamentIds: async(tournament_ids:string[]):Promise<TournamentProps[]> => {
|
|
140
|
+
const resp = await axios.post(`${EVENT_SVC_API}/v1/tournaments/bulk/get`, { attribute: 'event_id', values: tournament_ids })
|
|
141
|
+
return resp.data.tournaments
|
|
142
|
+
},
|
|
143
|
+
getTeamsByIds: async(team_ids:string[]) => {
|
|
144
|
+
const resp = await axios.post(`${EVENT_SVC_API}/v1/teams/bulk/get`, { attribute:'team_id', values: team_ids })
|
|
145
|
+
return resp.data.teams
|
|
146
|
+
},
|
|
147
|
+
getExoticsByIds : async(exotic_ids:string[]):Promise<any[]> => {
|
|
148
|
+
const resp = await axios.post(`${EVENT_SVC_API}/v1/exotics/bulk/get`, { attribute: 'exotic_id', values: exotic_ids })
|
|
149
|
+
return resp.data.athletes
|
|
150
|
+
},
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const CompetitionPlayerApi = {
|
|
154
|
+
getCompetitionPlayersByCompetition: async(competition_id:string, offset:number, status?:string):Promise<CompetitionPlayerProps[]> => {
|
|
155
|
+
const resp = await axios.get(`${TP_SVC_API}/v1/competitions/players/${competition_id}?offset=${offset}&status=${status}`)
|
|
156
|
+
return resp.data.competition_players
|
|
157
|
+
},
|
|
158
|
+
joinCompetition: async(competition_player:CompetitionPlayerProps):Promise<{ competition:CompetitionProps, competition_player:CompetitionPlayerProps, competition_result:CompetitionResultProps, competition_record:CompetitionRecordProps }> => {
|
|
159
|
+
const resp = await axios.post(`${TP_SVC_API}/v1/competitions/player/join`, { competition_player });
|
|
160
|
+
return resp.data
|
|
161
|
+
},
|
|
162
|
+
leaveCompetition: async(competition_player:CompetitionPlayerProps):Promise<{competition:CompetitionProps, competition_player:CompetitionPlayerProps}> => {
|
|
163
|
+
const resp = await axios.post(`${TP_SVC_API}/v1/competitions/player/leave`, { competition_player });
|
|
164
|
+
return resp.data
|
|
165
|
+
},
|
|
166
|
+
rejectCompetition: async(competition_player:CompetitionPlayerProps):Promise<CompetitionPlayerProps> => {
|
|
167
|
+
const resp = await axios.post(`${TP_SVC_API}/v1/competitions/player/leave`, { competition_player });
|
|
168
|
+
return resp.data.competition_player
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
const PlayerPicksApi = {
|
|
174
|
+
getPlayerPicksByCompetition: async(competition_id:string, player_id:string, offset:number):Promise<PlayerPickProps[]> => {
|
|
175
|
+
const resp = await axios.get(`${TP_SVC_API}/v1/picks/competition/${competition_id}?player_id=${player_id}&offset=${offset}`);
|
|
176
|
+
return resp.data.player_picks
|
|
177
|
+
},
|
|
178
|
+
createPlayerPick : async(player_pick:PlayerPickProps):Promise<{ player_pick: PlayerPickProps, competition_player:CompetitionPlayerProps }> => {
|
|
179
|
+
const resp = await axios.post(`${TP_SVC_API}/v1/picks/pick/create`, { player_pick });
|
|
180
|
+
return resp.data;
|
|
181
|
+
},
|
|
182
|
+
removePlayerPick: async(player_pick_id:string):Promise<{ player_pick: PlayerPickProps, competition_player:CompetitionPlayerProps }> => {
|
|
183
|
+
const resp = await axios.post(`${TP_SVC_API}/v1/picks/pick/remove`, { player_pick_id })
|
|
184
|
+
return resp.data
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
const CompetitionResultApi = {
|
|
190
|
+
getResultsByCompetition: async(competition_id:string, offset:number, player_id_override?:string):Promise<{competition_results:CompetitionResultProps[], competition_records:CompetitionRecordProps[]}> => {
|
|
191
|
+
const resp = await axios.get(`${TP_SVC_API}/v1/results/competition/${competition_id}?offset=${offset}&player_id=${player_id_override}`)
|
|
192
|
+
return resp.data
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export const FINALIZED_STATUSES = [
|
|
197
|
+
'closed',
|
|
198
|
+
'complete',
|
|
199
|
+
'cancelled',
|
|
200
|
+
'unnecessary',
|
|
201
|
+
'postponed',
|
|
202
|
+
'suspended'
|
|
203
|
+
]
|
|
204
|
+
|
|
205
|
+
export const IN_PROGRESS_STATUSES = [
|
|
206
|
+
'inprogress',
|
|
207
|
+
'halftime',
|
|
208
|
+
'intermission'
|
|
209
|
+
]
|
|
210
|
+
|
|
211
|
+
const CompetitionHelpers = {
|
|
212
|
+
|
|
213
|
+
getReferralDescription : (promo:PromoProps) => {
|
|
214
|
+
switch(promo.type){
|
|
215
|
+
case 'promo_code': return `Get ${promo.amount} promo bucks after you verify your account`
|
|
216
|
+
case 'promo_sweepstakes': return `Have a chance at UP TO 500 promo bucks after you verify your account`
|
|
217
|
+
case 'referral_code': return `Get ${promo.amount} promo bucks after you verify your account. Your referrer will get the same after you make your first deposit`
|
|
218
|
+
case 'referral_sweepstakes': return `Have a chance at UP TO 500 promo bucks after you verify your account. Your referrer will get the same after you make your first deposit`
|
|
219
|
+
default: return ''
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
getEmptyCompetitionSeason : ():CompetitionSeasonProps => {
|
|
223
|
+
return {
|
|
224
|
+
competition_season_id:'',
|
|
225
|
+
season_name:'',
|
|
226
|
+
season_description: '',
|
|
227
|
+
image: { url: 'https://res.cloudinary.com/hoabts6mc/image/upload/v1635988385/be_notify_icon_nqplfc.png' },
|
|
228
|
+
payout_allocation:0,
|
|
229
|
+
payout_amt: 0,
|
|
230
|
+
allow_late_buy_in: false,
|
|
231
|
+
single_buy_in: true,
|
|
232
|
+
competition_result_type_id: '1',
|
|
233
|
+
admin_id:'',
|
|
234
|
+
status: 'active',
|
|
235
|
+
scheduled_datetime: moment().add(10, 'days'),
|
|
236
|
+
create_datetime:'',
|
|
237
|
+
last_update_datetime:'',
|
|
238
|
+
market_type: 'FOR_MONEY'
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
|
|
242
|
+
formatPlace :(place:number) => {
|
|
243
|
+
switch(place){
|
|
244
|
+
case 1:
|
|
245
|
+
return '1st'
|
|
246
|
+
case 2:
|
|
247
|
+
return '2nd'
|
|
248
|
+
case 3:
|
|
249
|
+
return '3rd'
|
|
250
|
+
case 4:
|
|
251
|
+
return '4th'
|
|
252
|
+
case 5:
|
|
253
|
+
return '5th'
|
|
254
|
+
case 6:
|
|
255
|
+
return '6th'
|
|
256
|
+
case 7:
|
|
257
|
+
return '7th'
|
|
258
|
+
case 8:
|
|
259
|
+
return '8th'
|
|
260
|
+
case 9:
|
|
261
|
+
return '9th'
|
|
262
|
+
default:
|
|
263
|
+
return `${place}`
|
|
264
|
+
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
isSeasonValid : (s:CompetitionSeasonProps) => {
|
|
268
|
+
if(!s.season_name){ return false }
|
|
269
|
+
if(!s.season_description){ return false }
|
|
270
|
+
if(!s.competition_result_type_id){ return false }
|
|
271
|
+
return true
|
|
272
|
+
},
|
|
273
|
+
getEmptyCompetition : ():CompetitionProps => {
|
|
274
|
+
return {
|
|
275
|
+
competition_id: '',
|
|
276
|
+
auth_strategy_id:'',
|
|
277
|
+
competition_name:'',
|
|
278
|
+
competition_description:'',
|
|
279
|
+
buy_in: 0,
|
|
280
|
+
admin_id:'',
|
|
281
|
+
image: { url: 'https://res.cloudinary.com/hoabts6mc/image/upload/v1635988385/be_notify_icon_nqplfc.png' },
|
|
282
|
+
ticket_revenue:0,
|
|
283
|
+
tickets_sold:0,
|
|
284
|
+
available_tickets:10,
|
|
285
|
+
market_ids: [],
|
|
286
|
+
market_type: 'FOR_MONEY',
|
|
287
|
+
status: 'scheduled',
|
|
288
|
+
create_datetime:'',
|
|
289
|
+
last_update_datetime: '',
|
|
290
|
+
competition_type_id: '1',
|
|
291
|
+
competition_result_type_id:'1',
|
|
292
|
+
scheduled_datetime: '',
|
|
293
|
+
entered: false,
|
|
294
|
+
max_pick_count: 0,
|
|
295
|
+
leagues: [],
|
|
296
|
+
invite_only: false,
|
|
297
|
+
length_type: 'event',
|
|
298
|
+
competition_code: '',
|
|
299
|
+
initial_balance: 1000,
|
|
300
|
+
end_datetime: moment().add(1, 'week')
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
getClosestDay : (schedule_range:string[]):string => {
|
|
304
|
+
if(schedule_range.length == 0){ return moment().format('YYYY/MM/DD') }
|
|
305
|
+
let closest:any|undefined;
|
|
306
|
+
let exact_day = schedule_range.find(d => d == moment().format('YYYY/MM/DD'))
|
|
307
|
+
if(exact_day){ return exact_day }
|
|
308
|
+
schedule_range.map(d => {
|
|
309
|
+
if(!closest){
|
|
310
|
+
closest = moment(d)
|
|
311
|
+
}
|
|
312
|
+
if(moment(d).isBefore(moment())){ return } //Day is in the past
|
|
313
|
+
let new_range = moment(d).diff(moment(), 'days')
|
|
314
|
+
let closest_range = closest.diff(moment(), 'days')
|
|
315
|
+
if(Math.abs(new_range) < Math.abs(closest_range)){ closest = moment(d) }
|
|
316
|
+
})
|
|
317
|
+
return closest.format('YYYY/MM/DD')
|
|
318
|
+
},
|
|
319
|
+
getEventCompMatchFromEvent : (event_id:string, event_type:'team'|'tournament'|'match'):CompetitionMatchProps => {
|
|
320
|
+
return {
|
|
321
|
+
competition_id:'',
|
|
322
|
+
competition_match_id: '',
|
|
323
|
+
event_id,
|
|
324
|
+
event_type,
|
|
325
|
+
status: 'inprogress',
|
|
326
|
+
create_datetime:'',
|
|
327
|
+
last_update_datetime:'',
|
|
328
|
+
match_type: 'event'
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
getMatchMarketsFromEventAndTrades : (event_id:string, trades:TradeProps[], markets:MarketProps[]):CompetitionMatchMarketProps[] => {
|
|
332
|
+
let cmm:CompetitionMatchMarketProps[] = []
|
|
333
|
+
markets.map(m => {
|
|
334
|
+
let tst = trades.find(t => t.market_id == m.market_id && t.side == m.trade_side)
|
|
335
|
+
let ntst = trades.find(t => t.market_id == m.market_id && t.side != m.trade_side)
|
|
336
|
+
if(!tst || !ntst){ return }
|
|
337
|
+
let tscmm:CompetitionMatchMarketProps = {
|
|
338
|
+
competition_match_id: '',
|
|
339
|
+
competition_match_market_id: '',
|
|
340
|
+
var_1: tst.var_1,
|
|
341
|
+
odds: tst.odds,
|
|
342
|
+
event_id,
|
|
343
|
+
event_type: 'team',
|
|
344
|
+
probability: tst.probability,
|
|
345
|
+
side: tst.side,
|
|
346
|
+
side_id: tst.side_id,
|
|
347
|
+
market_id: tst.market_id,
|
|
348
|
+
status: 'active',
|
|
349
|
+
create_datetime: '',
|
|
350
|
+
last_update_datetime:''
|
|
351
|
+
}
|
|
352
|
+
cmm.push(tscmm)
|
|
353
|
+
let ntscmm:CompetitionMatchMarketProps = {
|
|
354
|
+
competition_match_id: '',
|
|
355
|
+
competition_match_market_id: '',
|
|
356
|
+
var_1: ntst.var_1,
|
|
357
|
+
odds: ntst.odds,
|
|
358
|
+
event_id,
|
|
359
|
+
event_type: 'team',
|
|
360
|
+
probability: ntst.probability,
|
|
361
|
+
side: ntst.side,
|
|
362
|
+
side_id: ntst.side_id,
|
|
363
|
+
market_id: ntst.market_id,
|
|
364
|
+
status: 'active',
|
|
365
|
+
create_datetime: '',
|
|
366
|
+
last_update_datetime:''
|
|
367
|
+
}
|
|
368
|
+
cmm.push(ntscmm)
|
|
369
|
+
})
|
|
370
|
+
return cmm
|
|
371
|
+
},
|
|
372
|
+
getStartTimeOptions : (draft_competition:CreateCompetitionProps, events:EventProps[]) => {
|
|
373
|
+
if(events.length == 0){ return [] }
|
|
374
|
+
let available_picks = (draft_competition.competition_match_markets.length / 2) + draft_competition.additional_markets.length
|
|
375
|
+
let included_events = events.filter(e => draft_competition.competition_matches.map(cm => cm.event_id.toString()).includes(e.event_id.toString()))
|
|
376
|
+
let additional_market_events = events.filter(e => draft_competition.additional_markets.map(m => m.event_id.toString()).includes(e.event_id.toString()))
|
|
377
|
+
included_events = included_events.concat(additional_market_events).sort((a,b) => moment(a.scheduled_datetime).unix() - moment(b.scheduled_datetime).unix())
|
|
378
|
+
let start_time_options:{ start_time:string, label:string }[] = []
|
|
379
|
+
let earliest_event = included_events[0]
|
|
380
|
+
if(!earliest_event){ return [] }
|
|
381
|
+
start_time_options.push({ start_time: earliest_event.scheduled_datetime, label: `Start time of the earliest game` })
|
|
382
|
+
if(available_picks === draft_competition.competition.max_pick_count){
|
|
383
|
+
return start_time_options
|
|
384
|
+
}
|
|
385
|
+
let diff = available_picks - draft_competition.competition.max_pick_count
|
|
386
|
+
let picks_per_event = available_picks / included_events.length
|
|
387
|
+
let event_to_back = diff / picks_per_event
|
|
388
|
+
earliest_event = included_events[Math.ceil(event_to_back)]
|
|
389
|
+
if(!earliest_event){ return start_time_options }
|
|
390
|
+
start_time_options.push({ label: 'Latest start time possible based on max picks', start_time: earliest_event.scheduled_datetime })
|
|
391
|
+
return start_time_options
|
|
392
|
+
},
|
|
393
|
+
getEmptyCreateCompetition : ():CreateCompetitionProps => {
|
|
394
|
+
return {
|
|
395
|
+
competition: {
|
|
396
|
+
competition_id: '',
|
|
397
|
+
auth_strategy_id: '',
|
|
398
|
+
competition_name:'',
|
|
399
|
+
competition_description:'',
|
|
400
|
+
buy_in: 0,
|
|
401
|
+
admin_id:'',
|
|
402
|
+
ticket_revenue:0,
|
|
403
|
+
tickets_sold:0,
|
|
404
|
+
available_tickets:10,
|
|
405
|
+
market_ids: [],
|
|
406
|
+
market_type: 'FOR_MONEY',
|
|
407
|
+
status: 'scheduled',
|
|
408
|
+
create_datetime:'',
|
|
409
|
+
last_update_datetime: '',
|
|
410
|
+
competition_type_id: '',
|
|
411
|
+
competition_result_type_id:'',
|
|
412
|
+
scheduled_datetime: '',
|
|
413
|
+
entered: false,
|
|
414
|
+
max_pick_count: 0,
|
|
415
|
+
leagues: [],
|
|
416
|
+
invite_only: false,
|
|
417
|
+
length_type: 'event',
|
|
418
|
+
competition_code: '',
|
|
419
|
+
initial_balance: 1000,
|
|
420
|
+
end_datetime: ''
|
|
421
|
+
},
|
|
422
|
+
competition_match_markets:[],
|
|
423
|
+
competition_matches:[],
|
|
424
|
+
competition_players:[],
|
|
425
|
+
additional_markets:[]
|
|
426
|
+
}
|
|
427
|
+
},
|
|
428
|
+
getCompColors : (competition_type?:string) => {
|
|
429
|
+
switch(competition_type){
|
|
430
|
+
case 'pick': return { backgroundColor:'rgba(26,205,106,0.1)', borderColor:Colors.highlights.highlight400 }
|
|
431
|
+
case 'wager': return { backgroundColor:'rgba(59,26,205,0.1)', borderColor:Colors.highlights.highlight100 }
|
|
432
|
+
default: return { backgroundColor:Colors.brand.slate, borderColor:Colors.shades.black }
|
|
433
|
+
}
|
|
434
|
+
},
|
|
435
|
+
getOddsLabel :(odds:number):string => {
|
|
436
|
+
if(odds > 0){ return `+${odds.toFixed()}` }
|
|
437
|
+
return odds.toFixed()
|
|
438
|
+
},
|
|
439
|
+
getVar1Label :(var_1:number, market:MarketProps):string => {
|
|
440
|
+
if(market.type == 'Spread'){
|
|
441
|
+
if(var_1 > 0){ return `+${var_1}` }
|
|
442
|
+
}
|
|
443
|
+
return var_1.toString()
|
|
444
|
+
},
|
|
445
|
+
getUniqueDivisions : (events:EventProps[]):string[] => {
|
|
446
|
+
let away_divisions = events.map(e => e.away?.division ? e.away.division: '')
|
|
447
|
+
let home_divisions = events.map(e => e.home?.division ? e.home.division : '')
|
|
448
|
+
if(!away_divisions || !home_divisions){ return [] }
|
|
449
|
+
let divisions = away_divisions.concat(home_divisions)
|
|
450
|
+
let options = [ ...new Set(divisions.map(d => d)) ].sort((a,b) => a > b ? 1 : -1)
|
|
451
|
+
let ranks = events.find(e => e.away?.rank || e.home?.rank)
|
|
452
|
+
if(ranks){ options = ['Top25'].concat(options) }
|
|
453
|
+
return options
|
|
454
|
+
},
|
|
455
|
+
getUniqueSubDivisions : (events:EventProps[]):string[] => {
|
|
456
|
+
let away_divisions = events.map(e => e.away?.sub_division ? e.away.sub_division : '')
|
|
457
|
+
let home_divisions = events.map(e => e.home?.sub_division ? e.home.sub_division : '')
|
|
458
|
+
return [ ...new Set(away_divisions.concat(home_divisions).map(d => d)) ].sort((a,b) => a > b ? 1 : -1)
|
|
459
|
+
},
|
|
460
|
+
|
|
461
|
+
createPickFromMatchMarket : (competition_id:string, mm:CompetitionMatchMarketProps):PlayerPickProps => {
|
|
462
|
+
|
|
463
|
+
return {
|
|
464
|
+
player_id:'',
|
|
465
|
+
player_pick_id:'',
|
|
466
|
+
side: mm.side,
|
|
467
|
+
side_id: mm.side_id,
|
|
468
|
+
status: 'inprogress',
|
|
469
|
+
competition_id,
|
|
470
|
+
competition_match_id: mm.competition_match_id,
|
|
471
|
+
market_id: mm.market_id,
|
|
472
|
+
odds: mm.odds,
|
|
473
|
+
var_1: mm.var_1,
|
|
474
|
+
probability: mm.probability,
|
|
475
|
+
create_datetime:'',
|
|
476
|
+
last_update_datetime:'',
|
|
477
|
+
stake:0,
|
|
478
|
+
potential_winnings:0,
|
|
479
|
+
winnings: 0,
|
|
480
|
+
pick_title: ''
|
|
481
|
+
}
|
|
482
|
+
},
|
|
483
|
+
|
|
484
|
+
getCompetitionPlayer : (competition_id:string):CompetitionPlayerProps => {
|
|
485
|
+
return {
|
|
486
|
+
competition_id,
|
|
487
|
+
competition_player_id: '',
|
|
488
|
+
status: 'active',
|
|
489
|
+
create_datetime: '',
|
|
490
|
+
last_update_datetime: '',
|
|
491
|
+
player_id: '',
|
|
492
|
+
wager_based_balance: 1000,
|
|
493
|
+
accepted_ind: false
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
getCompTypeColor :(competition_type?:CompetitionTypeProps) => {
|
|
499
|
+
switch(competition_type?.type){
|
|
500
|
+
case 'pick':
|
|
501
|
+
return Colors.highlights.highlight400
|
|
502
|
+
case 'wager':
|
|
503
|
+
return Colors.highlights.highlight100
|
|
504
|
+
default:
|
|
505
|
+
return Colors.brand.midnight
|
|
506
|
+
}
|
|
507
|
+
},
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
calcPotentialWinnings : (amt:number, odds:number):number => {
|
|
511
|
+
if (odds > 0) {
|
|
512
|
+
var earningsMultiplyer = ((odds/100) + 1);
|
|
513
|
+
return earningsMultiplyer * amt;
|
|
514
|
+
} else {
|
|
515
|
+
var earningsMultiplyer = ((100/(Math.abs(odds))) + 1);
|
|
516
|
+
return earningsMultiplyer * amt
|
|
517
|
+
}
|
|
518
|
+
},
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
getPickTitleForTeamEvent : (pick:PlayerPickProps, market:MarketProps, event:EventProps, athlete?:AthleteProps):string => {
|
|
522
|
+
let market_side = market.side_options.find(o => o.side == pick.side)
|
|
523
|
+
if(!market_side){ return pick.side }
|
|
524
|
+
var re = /({.*?})/;
|
|
525
|
+
let parsed_text = market_side.parseable_title.split(re)
|
|
526
|
+
let new_title = '';
|
|
527
|
+
parsed_text.map((t:any) => {
|
|
528
|
+
if(t === ''){ return }
|
|
529
|
+
if(t[0] !== '{'){ return new_title += t }
|
|
530
|
+
let variable = t.slice(1)
|
|
531
|
+
variable = variable.slice(0, variable.length -1)
|
|
532
|
+
switch(variable){
|
|
533
|
+
case 'team':
|
|
534
|
+
let team = event[pick.side as keyof EventProps]
|
|
535
|
+
return new_title += team.market_name
|
|
536
|
+
case 'var_1': return new_title += CompetitionHelpers.getVar1Label(pick.var_1, market)
|
|
537
|
+
case 'athlete': return new_title += `${athlete?.first_name} ${athlete?.last_name}`
|
|
538
|
+
case 'stat': return new_title += market.stat_label ?? market.stat
|
|
539
|
+
default: return
|
|
540
|
+
}
|
|
541
|
+
})
|
|
542
|
+
return new_title
|
|
543
|
+
},
|
|
544
|
+
|
|
545
|
+
getPickTitleForMatch : (pick:PlayerPickProps, market:MarketProps, athlete?:AthleteProps, team?:TeamProps):string => {
|
|
546
|
+
let market_side = market.side_options.find(o => o.side == pick.side)
|
|
547
|
+
if(!market_side){ return pick.side }
|
|
548
|
+
var re = /({.*?})/;
|
|
549
|
+
let parsed_text = market_side.parseable_title.split(re)
|
|
550
|
+
let new_title = '';
|
|
551
|
+
parsed_text.map((t:any) => {
|
|
552
|
+
if(t === ''){ return }
|
|
553
|
+
if(t[0] !== '{'){ return new_title += t }
|
|
554
|
+
let variable = t.slice(1)
|
|
555
|
+
variable = variable.slice(0, variable.length -1)
|
|
556
|
+
switch(variable){
|
|
557
|
+
case 'team': return new_title += `${team?.market_name} ${team?.name}`
|
|
558
|
+
case 'var_1': return new_title += CompetitionHelpers.getVar1Label(pick.var_1, market)
|
|
559
|
+
case 'athlete': return new_title += athlete?.abbr_name
|
|
560
|
+
case 'stat': return new_title += market.stat
|
|
561
|
+
default: return
|
|
562
|
+
|
|
563
|
+
}
|
|
564
|
+
})
|
|
565
|
+
return new_title
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ActivityIndicator, FlatList, View } from "react-native"
|
|
3
|
+
import MarketsCard from "./MarketsCard"
|
|
4
|
+
import type { AthleteProps, CompetitionMatchMarketProps, CompetitionMatchProps, CompetitionProps, CompetitionTypeProps, EventProps, MarketProps, PlayerPickProps } from '../../types';
|
|
5
|
+
import moment from 'moment-mini';
|
|
6
|
+
import { CompetitionHelpers, FINALIZED_STATUSES } from '../api';
|
|
7
|
+
import { Text } from '../../Components';
|
|
8
|
+
import Colors from '../../constants/colors';
|
|
9
|
+
import LinearDiagnal from '../../Components/LinearDiagnal';
|
|
10
|
+
import { AthleteImage } from '../../Components/Jerseys';
|
|
11
|
+
|
|
12
|
+
type AthleteMarketCardProps = {
|
|
13
|
+
competition:CompetitionProps,
|
|
14
|
+
competition_type:CompetitionTypeProps,
|
|
15
|
+
event:EventProps,
|
|
16
|
+
markets:MarketProps[],
|
|
17
|
+
athlete:AthleteProps,
|
|
18
|
+
onPick:(pp:PlayerPickProps, event_title:string, event_start:string) => void
|
|
19
|
+
mode: 'view'|'play'
|
|
20
|
+
loading?:boolean,
|
|
21
|
+
orientation:'horizontal'|'vertical',
|
|
22
|
+
player_picks:PlayerPickProps[],
|
|
23
|
+
competition_match:CompetitionMatchProps,
|
|
24
|
+
competition_match_markets:CompetitionMatchMarketProps[]
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const AthleteMarketCard = ({ markets, competition_type, event, athlete, mode, loading, player_picks, orientation, competition_match, competition_match_markets, onPick }:AthleteMarketCardProps) => {
|
|
28
|
+
|
|
29
|
+
const market = markets.find(m => m.market_id == competition_match.market_id_override)
|
|
30
|
+
const wager_picks = player_picks.filter(pp => pp.stake > 0)
|
|
31
|
+
|
|
32
|
+
const handleMarketSelect = async(mm:CompetitionMatchMarketProps, player_pick?:PlayerPickProps) => {
|
|
33
|
+
let market = markets.find(m => m.market_id == mm.market_id)
|
|
34
|
+
if(!event || !competition_type || !market){ return alert('Unable to process') }
|
|
35
|
+
if(moment(event.scheduled_datetime).isBefore(moment())){ return alert('This event has already started') }
|
|
36
|
+
if(player_pick){
|
|
37
|
+
return onPick(player_pick, event.event_title, event.scheduled_datetime)
|
|
38
|
+
//await CompetitionStoreActions.removePlayerPick(player_pick.player_pick_id)
|
|
39
|
+
} else {
|
|
40
|
+
let pp = CompetitionHelpers.createPickFromMatchMarket(competition_match.competition_id, mm)
|
|
41
|
+
let pick_title = CompetitionHelpers.getPickTitleForTeamEvent(pp, market, event, athlete)
|
|
42
|
+
return onPick({ ...pp, pick_title }, event.event_title, event.scheduled_datetime)
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const renderWagerPicks = (data: { item:PlayerPickProps, index:number }) => {
|
|
47
|
+
const locked = mode == 'view' && moment().isBefore(moment(event.scheduled_datetime)) ? true : false
|
|
48
|
+
return (
|
|
49
|
+
<View style={{ flexDirection:'row', marginTop:5 }}>
|
|
50
|
+
<Text style={{ flex:1 }} size={12} color={Colors.highlights.highlight200}>{locked?'WAGER LOCKED':data.item.pick_title}</Text>
|
|
51
|
+
<Text style={{ flex:1 }} size={12} color={Colors.highlights.highlight200} textAlign="right">{locked?'':`${data.item.stake.toFixed(2)} to win ${data.item.potential_winnings.toFixed(2)}`}</Text>
|
|
52
|
+
</View>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if(!athlete){ return <></> }
|
|
57
|
+
return (
|
|
58
|
+
<View style={{ flex:1 }}>
|
|
59
|
+
{market ?
|
|
60
|
+
<LinearDiagnal
|
|
61
|
+
label={market.stat_label ?? market.type}
|
|
62
|
+
label_size={10}
|
|
63
|
+
style={{ borderTopLeftRadius:8, padding:5 }}
|
|
64
|
+
left_color={Colors.incentive.gold}
|
|
65
|
+
right_color={'#ebd197'}
|
|
66
|
+
/>
|
|
67
|
+
:<></>}
|
|
68
|
+
<View style={{ padding:10, flex:1, flexDirection:orientation=='horizontal'?'row':'column', alignItems:orientation=='horizontal'?'center':undefined }}>
|
|
69
|
+
|
|
70
|
+
<View nativeID="event_details" style={{ flex:1, flexGrow:1, flexDirection:orientation=='horizontal'?'row':'column', alignItems:'center' }}>
|
|
71
|
+
<View nativeID="athlete_image">
|
|
72
|
+
<AthleteImage athlete={athlete} size={38} number_size={10}/>
|
|
73
|
+
</View>
|
|
74
|
+
<View>
|
|
75
|
+
<Text size={16} color={Colors.brand.midnight} weight='bold' textAlign="center">{athlete.first_name} {athlete.last_name}</Text>
|
|
76
|
+
<Text style={{ marginTop:3 }} size={12} color={Colors.brand.midnight} weight='regular' textAlign="center">{athlete.team ? `${athlete.team.abbr} (${athlete.position})`:`${athlete.position}`}</Text>
|
|
77
|
+
</View>
|
|
78
|
+
</View>
|
|
79
|
+
<View nativeID="market_details" style={{flex:orientation=='horizontal'?1:undefined, margin:5 }}>
|
|
80
|
+
{orientation == 'horizontal' && market ?
|
|
81
|
+
<Text style={{ margin:2 }} size={14} color={Colors.shades.black} textAlign="center">{market.description}</Text>
|
|
82
|
+
:<></>}
|
|
83
|
+
<MarketsCard
|
|
84
|
+
player_picks={player_picks}
|
|
85
|
+
mode={mode}
|
|
86
|
+
markets={markets}
|
|
87
|
+
orientation="horizontal"
|
|
88
|
+
disabled={moment().isAfter(moment(event.scheduled_datetime)) || FINALIZED_STATUSES.includes(event.status) ? true : false}
|
|
89
|
+
locked={mode == 'view' && moment().isBefore(moment(event.scheduled_datetime)) ? true : false}
|
|
90
|
+
competition_match_markets={competition_match_markets}
|
|
91
|
+
onMarketSelect={(mm, player_pick) => handleMarketSelect(mm, player_pick)}
|
|
92
|
+
/>
|
|
93
|
+
{loading ?
|
|
94
|
+
<View style={{ position:'absolute', top:0, right:0, left:0, bottom:0, justifyContent:'center', alignItems:'center' }}>
|
|
95
|
+
<ActivityIndicator
|
|
96
|
+
size='large'
|
|
97
|
+
color={Colors.brand.midnight}
|
|
98
|
+
/>
|
|
99
|
+
</View>
|
|
100
|
+
:<></>}
|
|
101
|
+
</View>
|
|
102
|
+
</View>
|
|
103
|
+
{wager_picks.length > 0 ?
|
|
104
|
+
<View nativeID="wager_picks">
|
|
105
|
+
<FlatList
|
|
106
|
+
data={wager_picks}
|
|
107
|
+
renderItem={renderWagerPicks}
|
|
108
|
+
keyExtractor={(item) => item.player_pick_id.toString()}
|
|
109
|
+
/>
|
|
110
|
+
</View>
|
|
111
|
+
:<></>}
|
|
112
|
+
</View>
|
|
113
|
+
)
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export default AthleteMarketCard
|