be-components 0.7.3 → 0.7.4
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/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 +240 -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/index.js +31 -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/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 +234 -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/index.js +22 -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/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.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 +61 -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/index.d.ts +7 -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/api/index.ts +2 -2
- package/src/Authenticator/api/types.d.ts +1 -25
- package/src/Authenticator/index.tsx +2 -1
- 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 +178 -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/index.tsx +25 -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 +483 -0
|
@@ -0,0 +1,936 @@
|
|
|
1
|
+
import { ActivityIndicator, FlatList, Image, ImageBackground, ScrollView, TouchableOpacity, View } from "react-native"
|
|
2
|
+
import type { AthleteProps, CodeRequestProps, CompanyProps, CompetitionMatchMarketProps, CompetitionMatchProps, CompetitionPayoutTypeProps, CompetitionPlayerProps, CompetitionProps, CompetitionResultTypeProps, CompetitionSeasonProps, CompetitionTypeProps, LeagueProps, MarketProps, MyPlayerProps, PlayerBalanceProps, PlayerPickProps, PlayerReferralProps, PromoProps, PublicPlayerProps, RewardOptionProps, TeamProps } from "../../types";
|
|
3
|
+
import Colors from '../../constants/colors';
|
|
4
|
+
import React, { useEffect, useState } from "react"
|
|
5
|
+
import TeamEventCard from './TeamEventCard';
|
|
6
|
+
import NavOutPrompt from './NavOutPrompt';
|
|
7
|
+
import AthleteMarketCard from './AthleteMarketCard';
|
|
8
|
+
import MatchMarketCard from './MatchMarketCard';
|
|
9
|
+
import CompetitionInfoCard from './CompetitionInfoCard';
|
|
10
|
+
import CompetitionLeaderboard from './CompetitionLeaderboard';
|
|
11
|
+
import LeaderPicks from './LeaderPicks';
|
|
12
|
+
import WagerPickForm from './WagerPickForm';
|
|
13
|
+
import EnterCompetitionPrompt from './EnterCompetitionPrompt';
|
|
14
|
+
import SeasonInfoModal from './SeasonInfoModal';
|
|
15
|
+
import CompetitionTypeCard from './CompetitionTypeCard';
|
|
16
|
+
|
|
17
|
+
import type { EventProps, MatchProps, TournamentProps } from "../../types";
|
|
18
|
+
import { CompetitionApi, CompetitionHelpers, CompetitionMatchApi, CompetitionPlayerApi, PlayerPicksApi } from "../api";
|
|
19
|
+
import { AuthenticateApi } from "../../Authenticator/api";
|
|
20
|
+
import moment from "moment-mini";
|
|
21
|
+
import { view_styles } from "../../constants/styles";
|
|
22
|
+
import LinearGradient from "react-native-linear-gradient";
|
|
23
|
+
import { Icons, Text } from "../../Components";
|
|
24
|
+
import LinearDiagnal from "../../Components/LinearDiagnal";
|
|
25
|
+
import SpringView from "../../Components/Spring";
|
|
26
|
+
import type { BEEventProps } from "../../Observer/api/types";
|
|
27
|
+
|
|
28
|
+
type CompetitionPlayProps = {
|
|
29
|
+
player_id?:string,
|
|
30
|
+
competition_id:string,
|
|
31
|
+
company?:CompanyProps,
|
|
32
|
+
onEvent?:(event:BEEventProps) => void,
|
|
33
|
+
height:number,
|
|
34
|
+
width:number,
|
|
35
|
+
source?:string,
|
|
36
|
+
onGoBack?:() => void,
|
|
37
|
+
hide_player?:boolean,
|
|
38
|
+
onRequestAuthentication: () => void,
|
|
39
|
+
back_allowed?:boolean
|
|
40
|
+
onChangeCompetition?: (competition_id:string) => void
|
|
41
|
+
}
|
|
42
|
+
const CompetitionPlay = ( { player_id, company, source, back_allowed, onGoBack, competition_id, width, height, hide_player, onChangeCompetition, onRequestAuthentication }:CompetitionPlayProps ) => {
|
|
43
|
+
|
|
44
|
+
const [ loading, setLoading ] = useState(false);
|
|
45
|
+
const [ code_details ] = useState<{
|
|
46
|
+
promo?:PromoProps,
|
|
47
|
+
code_request?: CodeRequestProps,
|
|
48
|
+
player_referral?:PlayerReferralProps,
|
|
49
|
+
referrer?:PublicPlayerProps,
|
|
50
|
+
reward_option?:RewardOptionProps
|
|
51
|
+
}>({});
|
|
52
|
+
const [ my_data, setMyData ] = useState<{
|
|
53
|
+
player?:MyPlayerProps,
|
|
54
|
+
player_balance?:PlayerBalanceProps,
|
|
55
|
+
player_picks:PlayerPickProps[]
|
|
56
|
+
}>({
|
|
57
|
+
player_picks: []
|
|
58
|
+
})
|
|
59
|
+
const [ competition_data, setCompetitionData ] = useState<{
|
|
60
|
+
loading:boolean,
|
|
61
|
+
competition?:CompetitionProps,
|
|
62
|
+
tournaments:TournamentProps[],
|
|
63
|
+
matches:MatchProps[],
|
|
64
|
+
events:EventProps[],
|
|
65
|
+
athletes:AthleteProps[],
|
|
66
|
+
teams:TeamProps[],
|
|
67
|
+
markets:MarketProps[],
|
|
68
|
+
leagues:LeagueProps[],
|
|
69
|
+
competition_payout_types:CompetitionPayoutTypeProps[],
|
|
70
|
+
competition_players:CompetitionPlayerProps[],
|
|
71
|
+
competition_matches:CompetitionMatchProps[],
|
|
72
|
+
competition_match_markets:CompetitionMatchMarketProps[],
|
|
73
|
+
competition_types:CompetitionTypeProps[],
|
|
74
|
+
competition_result_types:CompetitionResultTypeProps[],
|
|
75
|
+
competition_type?:CompetitionTypeProps,
|
|
76
|
+
competition_result_type?:CompetitionResultTypeProps,
|
|
77
|
+
competition_season?:CompetitionSeasonProps,
|
|
78
|
+
|
|
79
|
+
}>({
|
|
80
|
+
loading:false,
|
|
81
|
+
tournaments:[],
|
|
82
|
+
events:[],
|
|
83
|
+
athletes: [],
|
|
84
|
+
teams: [],
|
|
85
|
+
matches: [],
|
|
86
|
+
leagues: [],
|
|
87
|
+
markets:[],
|
|
88
|
+
competition_types:[],
|
|
89
|
+
competition_result_types:[],
|
|
90
|
+
competition_payout_types:[],
|
|
91
|
+
competition_matches:[],
|
|
92
|
+
competition_players:[],
|
|
93
|
+
competition_match_markets:[],
|
|
94
|
+
|
|
95
|
+
})
|
|
96
|
+
const [ profile_visible, setProfileVisible ] = useState(false);
|
|
97
|
+
const [ show_rules, setShowRules ] = useState(false);
|
|
98
|
+
const [ nav_out_prompt, setNavOutPrompt ] = useState<{
|
|
99
|
+
visible:boolean,
|
|
100
|
+
title?:string,
|
|
101
|
+
hide_accept?:boolean,
|
|
102
|
+
url?:string,
|
|
103
|
+
image_url?:string,
|
|
104
|
+
body?:string,
|
|
105
|
+
accept_title?: string,
|
|
106
|
+
cancel_title?:string
|
|
107
|
+
}>({
|
|
108
|
+
visible: false
|
|
109
|
+
});
|
|
110
|
+
const [ show_season, setShowSeason ] = useState(false);
|
|
111
|
+
const [ show_enter_prompt, setShowEnterPrompt ] = useState(false);
|
|
112
|
+
const [ complete_loaded, setCompleteLoaded ] = useState(false);
|
|
113
|
+
const [ show_completed, setShowCompleted ] = useState(false);
|
|
114
|
+
const [ expanded_markets, setExpandedMarkets ] = useState<string[]>([]);
|
|
115
|
+
const [ draft_player_pick, setDraftPlayerPick ] = useState<{draft_pick?:PlayerPickProps, event_title?:string, event_start?:string}>({});
|
|
116
|
+
const [ viewing_leader, setViewingLeader ] = useState<PublicPlayerProps | undefined>(undefined);
|
|
117
|
+
const [ show_full_leaderboard, setShowFullLeaderboard ] = useState(false);
|
|
118
|
+
const [ pick_loading, setPickLoading ] = useState<undefined|string>(undefined)
|
|
119
|
+
|
|
120
|
+
const {
|
|
121
|
+
competition,
|
|
122
|
+
leagues,
|
|
123
|
+
markets,
|
|
124
|
+
events,
|
|
125
|
+
athletes,
|
|
126
|
+
tournaments,
|
|
127
|
+
matches,
|
|
128
|
+
competition_players,
|
|
129
|
+
competition_result_type,
|
|
130
|
+
competition_payout_types,
|
|
131
|
+
competition_season,
|
|
132
|
+
competition_types,
|
|
133
|
+
competition_result_types,
|
|
134
|
+
competition_type,
|
|
135
|
+
competition_matches,
|
|
136
|
+
competition_match_markets
|
|
137
|
+
} = competition_data;
|
|
138
|
+
|
|
139
|
+
const {
|
|
140
|
+
player,
|
|
141
|
+
player_balance,
|
|
142
|
+
player_picks
|
|
143
|
+
} = my_data;
|
|
144
|
+
|
|
145
|
+
const events_array = Object.values(events)
|
|
146
|
+
|
|
147
|
+
const authenticated_competition_player = competition_players.find(cp => cp.player_id == player?.player_id);
|
|
148
|
+
|
|
149
|
+
const can_leave = competition?.entered && moment().isBefore(moment(competition.scheduled_datetime)) && player_picks.length == 0 && !loading
|
|
150
|
+
const ip_unique_team_events = [ ... new Set(competition_matches.filter(cm => cm.event_type == 'team' && cm.status == 'inprogress').map(cm => cm.event_id)) ]
|
|
151
|
+
const ip_team_event_ids = events_array.filter(e => ip_unique_team_events.includes(e.event_id)).sort((a,b) => moment(a.scheduled_datetime).unix() - moment(b.scheduled_datetime).unix()).map(e => e.event_id)
|
|
152
|
+
|
|
153
|
+
const closed_unique_team_events = [ ... new Set(competition_matches.filter(cm => cm.event_type == 'team' && cm.status == 'closed').map(cm => cm.event_id)) ]
|
|
154
|
+
const closed_team_event_ids = events_array.filter(e => closed_unique_team_events.includes(e.event_id)).sort((a,b) => moment(a.scheduled_datetime).unix() - moment(b.scheduled_datetime).unix()).map(e => e.event_id)
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
const unique_tournaments = [ ... new Set(Object.values(matches).map(m => m.tournament_id))]
|
|
158
|
+
|
|
159
|
+
useEffect(() => {
|
|
160
|
+
if(!competition_id){ return }
|
|
161
|
+
getCompetitionFromServer(competition_id)
|
|
162
|
+
},[ competition_id, player_id ])
|
|
163
|
+
|
|
164
|
+
useEffect(() => {
|
|
165
|
+
if(!competition_id){ return }
|
|
166
|
+
if(!player_id){ setMyData({ player_picks: [] }) }
|
|
167
|
+
else { getPlayerData(competition_id, player_id, 0) }
|
|
168
|
+
},[player_id])
|
|
169
|
+
|
|
170
|
+
const getPlayerData = async(competition_id:string, player_id:string, offset:number) => {
|
|
171
|
+
const pps = await PlayerPicksApi.getPlayerPicksByCompetition(competition_id, player_id, offset)
|
|
172
|
+
const player_balance = await CompetitionApi.getMyBalance();
|
|
173
|
+
const me = await CompetitionApi.getMyDetails();
|
|
174
|
+
setMyData({ player:me, player_balance, player_picks:pps })
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
useEffect(() => {
|
|
178
|
+
if(!player){ return }
|
|
179
|
+
if(!competition_type || !competition){ return }
|
|
180
|
+
if(competition_type.type == 'pick'){
|
|
181
|
+
//Need to determine if we need to show complete label!
|
|
182
|
+
if(player_picks.length == competition.max_pick_count){
|
|
183
|
+
handleEndCompetition()
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
},[player_picks.length])
|
|
187
|
+
|
|
188
|
+
const handleEndCompetition = async() => {
|
|
189
|
+
if(!competition){ return }
|
|
190
|
+
if(competition?.status == 'closed'){ return }
|
|
191
|
+
if(source == 'bettoredge'){
|
|
192
|
+
return setNavOutPrompt({
|
|
193
|
+
visible: true,
|
|
194
|
+
title:'Your picks are set!',
|
|
195
|
+
image_url: competition.image?.url ?? company?.company_image?.url,
|
|
196
|
+
body: 'Way to go! All your pick are locked. Feel free to edit your picks up until the start time of each contest',
|
|
197
|
+
hide_accept: true,
|
|
198
|
+
cancel_title: 'CLOSE'
|
|
199
|
+
})
|
|
200
|
+
}
|
|
201
|
+
let company_short_name = 'be'
|
|
202
|
+
if(company){ company_short_name = company.short_name }
|
|
203
|
+
let url = `https://share.mybe.app/c/${company_short_name}?type=c&id=${competition.competition_id}&utm_source=widget`
|
|
204
|
+
try {
|
|
205
|
+
const player_token = await AuthenticateApi.getShortToken()
|
|
206
|
+
url += `&token=${player_token.token}`
|
|
207
|
+
} catch (e) {
|
|
208
|
+
console.log(e)
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
setNavOutPrompt({
|
|
213
|
+
visible: true,
|
|
214
|
+
url,
|
|
215
|
+
title:'Your picks are set!',
|
|
216
|
+
image_url: competition.image?.url ?? company?.company_image?.url,
|
|
217
|
+
body: 'Want even more ways to win? Checkout BettorEdge where you can play more competitions like this, track results and even bet real money on the games!',
|
|
218
|
+
accept_title: 'Take Me There!',
|
|
219
|
+
cancel_title: 'No Thanks'
|
|
220
|
+
})
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
const handleProfile = async(status:string) => {
|
|
224
|
+
if(!player || !competition){ return }
|
|
225
|
+
if(source == 'bettoredge'){ return }
|
|
226
|
+
let company_short_name = 'be'
|
|
227
|
+
if(company){ company_short_name = company.short_name }
|
|
228
|
+
let url = `https://share.mybe.app/c/${company_short_name}?type=c&id=${competition.competition_id}&utm_source=widget`
|
|
229
|
+
try {
|
|
230
|
+
const player_token = await AuthenticateApi.getShortToken()
|
|
231
|
+
url += `&token=${player_token.token}`
|
|
232
|
+
} catch (e) {
|
|
233
|
+
console.log(e)
|
|
234
|
+
}
|
|
235
|
+
if(status != 'verified'){
|
|
236
|
+
setNavOutPrompt({
|
|
237
|
+
title: 'Verify me on BettorEdge!',
|
|
238
|
+
url,
|
|
239
|
+
image_url: player.profile_pic,
|
|
240
|
+
body: 'In order to use real-money, you must verify that you are of legal age with our partner BettorEdge',
|
|
241
|
+
accept_title: 'Verify at BettorEdge',
|
|
242
|
+
visible:true
|
|
243
|
+
})
|
|
244
|
+
} else {
|
|
245
|
+
setNavOutPrompt({
|
|
246
|
+
title: 'Manage my profile at BettorEdge',
|
|
247
|
+
url,
|
|
248
|
+
image_url: player.profile_pic,
|
|
249
|
+
body: 'See your competition performance and history at BettorEdge.',
|
|
250
|
+
accept_title: 'Manage Profile',
|
|
251
|
+
visible:true
|
|
252
|
+
})
|
|
253
|
+
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
//This will snag all the data we need to launch the competition
|
|
259
|
+
const getCompetitionFromServer = async(competition_id:string) => {
|
|
260
|
+
setCompetitionData({ ...competition_data, loading:true });
|
|
261
|
+
const { competition_types, competition_result_types, competition_payout_types } = await CompetitionApi.getCompetitionOptions();
|
|
262
|
+
const ls = await CompetitionApi.getLeagues()
|
|
263
|
+
const cms_response = await CompetitionApi.getCompetitionMatchesByCompetitionId(competition_id)
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
//Lets get the additional data needed!
|
|
268
|
+
let athletes: AthleteProps[] = []
|
|
269
|
+
let teams: TeamProps[] = []
|
|
270
|
+
let events:EventProps[] = []
|
|
271
|
+
let tournaments:TournamentProps[] = []
|
|
272
|
+
let matches: MatchProps[] = []
|
|
273
|
+
const markets = await CompetitionApi.getMarkets();
|
|
274
|
+
let athlete_ids = cms_response.competition_matches.filter(cm => cm.side_type_override == 'athlete' && cm.side_id_override).map(cm => cm.side_id_override ?? '');
|
|
275
|
+
let team_ids = cms_response.competition_matches.filter(cm => cm.side_type_override == 'team' && cm.side_id_override).map(cm => cm.side_id_override ?? '');
|
|
276
|
+
const event_ids = cms_response.competition_matches.filter(cm => cm.event_type == 'team').map(cm => cm.event_id)
|
|
277
|
+
event_ids.map(eid => {
|
|
278
|
+
let side_id_cm = cms_response.competition_matches.find(cm => cm.event_type == 'team' && cm.event_id == eid && cm.side_id_override)
|
|
279
|
+
if(side_id_cm){ expanded_markets.push(eid) }
|
|
280
|
+
})
|
|
281
|
+
setExpandedMarkets(expanded_markets)
|
|
282
|
+
const match_ids = cms_response.competition_matches.filter(cm => cm.event_type == 'match').map(cm => cm.event_id)
|
|
283
|
+
if(event_ids.length > 0){ events = await CompetitionMatchApi.getEventsByEventIds(event_ids) }
|
|
284
|
+
if(match_ids.length > 0){ matches = await CompetitionMatchApi.getMatchesByMatchIds(match_ids) }
|
|
285
|
+
if(matches.length > 0){
|
|
286
|
+
let tournament_ids = matches.map(m => m.tournament_id)
|
|
287
|
+
tournaments = await CompetitionMatchApi.getTournamentsByTournamentIds(tournament_ids)
|
|
288
|
+
let new_athlete_ids:string[] = []
|
|
289
|
+
let new_team_ids: string[] = []
|
|
290
|
+
matches.filter(m => m.participant_type == 'athlete').map(m => m.participants.map(p => new_athlete_ids.push(p)))
|
|
291
|
+
matches.filter(m => m.participant_type == 'team').map(m => m.participants.map(p => new_team_ids.push(p)))
|
|
292
|
+
athlete_ids = athlete_ids.concat(new_athlete_ids);
|
|
293
|
+
team_ids = team_ids.concat(new_team_ids)
|
|
294
|
+
}
|
|
295
|
+
if(athlete_ids.length > 0){ athletes = await CompetitionMatchApi.getAthletesByIds(athlete_ids) }
|
|
296
|
+
if(team_ids.length > 0){ teams = await CompetitionMatchApi.getTeamsByIds(team_ids) }
|
|
297
|
+
const cps = await CompetitionPlayerApi.getCompetitionPlayersByCompetition(competition_id, 0, 'active')
|
|
298
|
+
const c = await CompetitionApi.getCompetitionById(competition_id)
|
|
299
|
+
setCompetitionData({
|
|
300
|
+
loading:false,
|
|
301
|
+
competition: c,
|
|
302
|
+
competition_matches: cms_response.competition_matches,
|
|
303
|
+
competition_match_markets: cms_response.competition_match_markets,
|
|
304
|
+
events,
|
|
305
|
+
athletes,
|
|
306
|
+
teams,
|
|
307
|
+
tournaments,
|
|
308
|
+
leagues: ls,
|
|
309
|
+
competition_types:competition_types,
|
|
310
|
+
competition_result_types:competition_result_types,
|
|
311
|
+
matches,
|
|
312
|
+
competition_payout_types,
|
|
313
|
+
competition_players: cps,
|
|
314
|
+
competition_type: competition_types.find(ct => ct.competition_type_id == c.competition_type_id),
|
|
315
|
+
competition_result_type:competition_result_types.find(crt => crt.competition_result_type_id == c.competition_result_type_id),
|
|
316
|
+
markets
|
|
317
|
+
})
|
|
318
|
+
setLoading(false);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
const handleEnterPrompt = () => {
|
|
322
|
+
if(!player_id){ return onRequestAuthentication(); }
|
|
323
|
+
return setShowEnterPrompt(true);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
const handleEnterCompetition = async(promo_balance?:boolean) => {
|
|
327
|
+
if(loading){ return }
|
|
328
|
+
setShowEnterPrompt(false);
|
|
329
|
+
setLoading(true);
|
|
330
|
+
|
|
331
|
+
const response = await CompetitionPlayerApi.joinCompetition({
|
|
332
|
+
...CompetitionHelpers.getCompetitionPlayer(competition_id),
|
|
333
|
+
promo_balance
|
|
334
|
+
})
|
|
335
|
+
setCompetitionData({
|
|
336
|
+
...competition_data,
|
|
337
|
+
competition: response.competition,
|
|
338
|
+
competition_players: competition_players.filter(cp => cp.competition_player_id != response.competition_player.competition_player_id).concat(response.competition_player)
|
|
339
|
+
})
|
|
340
|
+
setLoading(false);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
const handleLeaveCompetition = async() => {
|
|
344
|
+
if(!authenticated_competition_player){ return }
|
|
345
|
+
setLoading(true);
|
|
346
|
+
const response = await CompetitionPlayerApi.leaveCompetition(authenticated_competition_player)
|
|
347
|
+
setCompetitionData({
|
|
348
|
+
...competition_data,
|
|
349
|
+
competition: response.competition,
|
|
350
|
+
competition_players: competition_players.filter(cp => cp.competition_player_id != response.competition_player.competition_player_id).concat(response.competition_player)
|
|
351
|
+
})
|
|
352
|
+
setLoading(false)
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
const handleShowComplete = async() => {
|
|
356
|
+
setShowCompleted(!show_completed)
|
|
357
|
+
if(!complete_loaded){
|
|
358
|
+
await CompetitionMatchApi.getCompetitionMatchesByCompetitionId(competition_id, 'closed')
|
|
359
|
+
setCompleteLoaded(true)
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
const handlePick = async(pp:PlayerPickProps, event_title:string, event_start:string) => {
|
|
364
|
+
if(!competition){ return }
|
|
365
|
+
if(!player_id){
|
|
366
|
+
return onRequestAuthentication()
|
|
367
|
+
}
|
|
368
|
+
if(!authenticated_competition_player){ return setShowEnterPrompt(true); }
|
|
369
|
+
if(!competition_type){ return alert('Unable to process pick') }
|
|
370
|
+
|
|
371
|
+
setPickLoading(pp.competition_match_id)
|
|
372
|
+
//If the pick needs to be removed
|
|
373
|
+
if(pp.player_pick_id && pp.player_pick_id != ''){
|
|
374
|
+
const rem_pp = await PlayerPicksApi.removePlayerPick(pp.player_pick_id)
|
|
375
|
+
setMyData({
|
|
376
|
+
...my_data,
|
|
377
|
+
player_picks: player_picks.filter(ps => ps.player_pick_id != rem_pp.player_pick.player_pick_id)
|
|
378
|
+
})
|
|
379
|
+
setPickLoading(undefined)
|
|
380
|
+
return
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
//If this is a new pick
|
|
384
|
+
//First check to see if they already have one on the market / event combo
|
|
385
|
+
let existing_pick = player_picks.find(p => p.competition_match_id == pp.competition_match_id && p.market_id == pp.market_id)
|
|
386
|
+
if(existing_pick){
|
|
387
|
+
setPickLoading(undefined)
|
|
388
|
+
return alert('Can only pick one side of each market. Remove the other side before selecting this one.')
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
if(competition_type.type == 'pick'){
|
|
392
|
+
if(player_picks.length >= competition.max_pick_count){
|
|
393
|
+
setPickLoading(undefined)
|
|
394
|
+
return alert('Already reached maximum picks')
|
|
395
|
+
|
|
396
|
+
}
|
|
397
|
+
const new_pp = await PlayerPicksApi.createPlayerPick(pp)
|
|
398
|
+
setMyData({
|
|
399
|
+
...my_data,
|
|
400
|
+
player_picks: player_picks.filter(ps => ps.player_pick_id != new_pp.player_pick.player_pick_id).concat(new_pp.player_pick)
|
|
401
|
+
})
|
|
402
|
+
setPickLoading(undefined)
|
|
403
|
+
}
|
|
404
|
+
if(competition_type.type == 'wager'){
|
|
405
|
+
setPickLoading(undefined)
|
|
406
|
+
setDraftPlayerPick({ draft_pick: pp, event_start, event_title })
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
const handleWagerSubmit = async(pp:PlayerPickProps) => {
|
|
411
|
+
setPickLoading(pp.competition_match_id)
|
|
412
|
+
const new_pp = await PlayerPicksApi.createPlayerPick(pp)
|
|
413
|
+
setMyData({
|
|
414
|
+
...my_data,
|
|
415
|
+
player_picks: player_picks.filter(ps => ps.player_pick_id != new_pp.player_pick.player_pick_id).concat(new_pp.player_pick)
|
|
416
|
+
})
|
|
417
|
+
setDraftPlayerPick({})
|
|
418
|
+
setPickLoading(undefined)
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
const renderAthleteEvents = (data: { item:CompetitionMatchProps, index:number }) => {
|
|
422
|
+
const event = events.find(e => e.event_id == data.item.event_id);
|
|
423
|
+
if(!event || !competition || !competition_type){ return <></> }
|
|
424
|
+
const athlete = athletes.find(a => a.athlete_id == data.item.side_id_override);
|
|
425
|
+
if(!athlete){ return <></> }
|
|
426
|
+
const match_markets = competition_match_markets.filter(cmm => cmm.competition_match_id == data.item.competition_match_id)
|
|
427
|
+
const event_picks = player_picks.filter(pp => pp.competition_match_id == data.item.competition_match_id)
|
|
428
|
+
const isLoading = pick_loading == data.item.competition_match_id ? true : false
|
|
429
|
+
if(match_markets.length != 2){ return <></> }
|
|
430
|
+
return (
|
|
431
|
+
<View style={{ minWidth:150, flex:1, flexGrow:1, margin:5, borderWidth:1, borderColor:Colors.shades.shade600, borderRadius:8, backgroundColor:Colors.shades.white, ...view_styles.float }}>
|
|
432
|
+
<AthleteMarketCard
|
|
433
|
+
event={event}
|
|
434
|
+
athlete={athlete}
|
|
435
|
+
competition={competition}
|
|
436
|
+
competition_type={competition_type}
|
|
437
|
+
markets={markets}
|
|
438
|
+
competition_match={data.item}
|
|
439
|
+
mode='play'
|
|
440
|
+
orientation="vertical"
|
|
441
|
+
onPick={(pp, event_title, event_start) => handlePick(pp, event_title, event_start)}
|
|
442
|
+
competition_match_markets={match_markets}
|
|
443
|
+
player_picks={event_picks}
|
|
444
|
+
loading={isLoading}
|
|
445
|
+
/>
|
|
446
|
+
</View>
|
|
447
|
+
)
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
const renderEvents = (data:{ item:CompetitionMatchProps, index:number }) => {
|
|
451
|
+
const event = events.find(e => e.event_id == data.item.event_id);
|
|
452
|
+
if(!event || !competition || !competition_type){ return <></> }
|
|
453
|
+
const match_markets = competition_match_markets.filter(cmm => cmm.competition_match_id == data.item.competition_match_id);
|
|
454
|
+
const event_picks = player_picks.filter(pp => pp.competition_match_id == data.item.competition_match_id);
|
|
455
|
+
const isLoading = pick_loading == data.item.competition_match_id ? true : false
|
|
456
|
+
return (
|
|
457
|
+
<View style={{ flex:1, flexGrow:1, margin:5 }}>
|
|
458
|
+
<TeamEventCard
|
|
459
|
+
event={event}
|
|
460
|
+
markets={markets}
|
|
461
|
+
competition={competition}
|
|
462
|
+
competition_type={competition_type}
|
|
463
|
+
player_picks={event_picks}
|
|
464
|
+
mode='play'
|
|
465
|
+
loading={isLoading}
|
|
466
|
+
onPick={(pp, event_title, event_start) => handlePick(pp, event_title, event_start)}
|
|
467
|
+
competition_match={data.item}
|
|
468
|
+
competition_match_markets={match_markets}
|
|
469
|
+
/>
|
|
470
|
+
</View>
|
|
471
|
+
)
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
const renderNonPrimaryMarkets = (data:{ item:string, index: number, event_id:string, event_type:string }) => {
|
|
475
|
+
const market = markets.find(m => m.market_id == data.item);
|
|
476
|
+
if(!market){ return <></> }
|
|
477
|
+
|
|
478
|
+
const athlete_non_primary_matches = competition_matches.filter(cm => cm.market_id_override == data.item && cm.side_type_override == 'athlete' && cm.event_id == data.event_id && cm.event_type == data.event_type);
|
|
479
|
+
|
|
480
|
+
return (
|
|
481
|
+
<View>
|
|
482
|
+
<LinearDiagnal label_size={12} label={market.description} left_color={Colors.brand.midnight} right_color={Colors.brand.midnightTopGradient}/>
|
|
483
|
+
<View style={{ flexDirection:'row', flexWrap:'wrap', justifyContent:'center', paddingTop:10, paddingBottom:10 }}>
|
|
484
|
+
{athlete_non_primary_matches.map((cm,i) => {
|
|
485
|
+
return renderAthleteEvents({ item: cm, index:i })
|
|
486
|
+
})}
|
|
487
|
+
</View>
|
|
488
|
+
</View>
|
|
489
|
+
)
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
const renderMatchEvents = (data: { item: CompetitionMatchProps, index:number }) => {
|
|
493
|
+
const match = matches.find(m => m.match_id == data.item.event_id);
|
|
494
|
+
if(!match || !competition || !competition_type){ return <></> }
|
|
495
|
+
const away_athlete = athletes.find(a => a.athlete_id == match.participants[0])
|
|
496
|
+
const home_athlete = athletes.find(a => a.athlete_id == match.participants[1])
|
|
497
|
+
const match_markets = competition_match_markets.filter(cmm => cmm.competition_match_id == data.item.competition_match_id)
|
|
498
|
+
const event_picks = player_picks.filter(pp => pp.competition_match_id == data.item.competition_match_id)
|
|
499
|
+
const isLoading = pick_loading == data.item.competition_match_id ? true : false
|
|
500
|
+
|
|
501
|
+
return (
|
|
502
|
+
<View style={{ minWidth:200, flex:1, flexGrow:1, margin:5, borderWidth:1, borderColor:Colors.shades.shade600, borderRadius:8, backgroundColor:Colors.shades.white, ...view_styles.float }}>
|
|
503
|
+
<MatchMarketCard
|
|
504
|
+
competition={competition}
|
|
505
|
+
competition_type={competition_type}
|
|
506
|
+
match={match}
|
|
507
|
+
away_athlete={away_athlete}
|
|
508
|
+
home_athlete={home_athlete}
|
|
509
|
+
markets={markets}
|
|
510
|
+
competition_match={data.item}
|
|
511
|
+
competition_match_markets={match_markets}
|
|
512
|
+
player_picks={event_picks}
|
|
513
|
+
loading={isLoading}
|
|
514
|
+
onPick={(pp, event_title, event_start) => handlePick(pp, event_title, event_start)}
|
|
515
|
+
mode='play'
|
|
516
|
+
/>
|
|
517
|
+
</View>
|
|
518
|
+
)
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
const renderTournaments = (data: {item:string, index:number}) => {
|
|
523
|
+
const tournament = tournaments.find(t => t.tournament_id == data.item)
|
|
524
|
+
if(!tournament){ return <></> }
|
|
525
|
+
const tournament_matches = Object.values(matches).filter(m => m.tournament_id == data.item).sort((a,b) => moment(a.scheduled_datetime).unix() - moment(b.scheduled_datetime).unix())
|
|
526
|
+
if(tournament_matches.length == 0){ return <></> }
|
|
527
|
+
|
|
528
|
+
//Now lets get all the competition_matches that include these match ids
|
|
529
|
+
const match_matches = competition_matches.filter(cm => cm.event_type == 'match' && tournament_matches.map(tm => tm.match_id.toString()).includes(cm.event_id).toString())
|
|
530
|
+
|
|
531
|
+
const league = leagues.find(l => l.league_id == tournament.league_id);
|
|
532
|
+
//const expanded = expanded_markets.includes(data.item) ? true : false
|
|
533
|
+
return (
|
|
534
|
+
<LinearGradient start={{x: 0, y: 0}} end={{x: 1, y: 0}} colors={[Colors.shades.white, '#F8F8F8']} style={{ minWidth:350, flex:1, flexGrow:1, margin:10, borderWidth:1, borderColor:Colors.shades.shade100, borderRadius:8, ...view_styles.float }}>
|
|
535
|
+
<View style={{ padding:10, flexDirection:'row', borderBottomWidth:1, borderColor:Colors.shades.shade600 }}>
|
|
536
|
+
{league ?
|
|
537
|
+
<Text size={14} color={Colors.brand.midnight} weight='bold'>{league.league_name}: </Text>
|
|
538
|
+
:<></>}
|
|
539
|
+
<Text style={{ flex:1 }} size={14} color={Colors.brand.midnight} weight='bold'>{tournament.tournament_name}</Text>
|
|
540
|
+
<Text size={14} color={Colors.brand.midnight} weight='regular'>{tournament.scheduled_datetime == 'scheduled' ? moment(tournament.scheduled_datetime).format('MM/DD @ hh:mm a'): tournament.time_detail}</Text>
|
|
541
|
+
</View>
|
|
542
|
+
|
|
543
|
+
<LinearDiagnal label_size={12} label="Matches" left_color={Colors.brand.midnight} right_color={Colors.brand.midnightTopGradient}/>
|
|
544
|
+
<View style={{ flexDirection:'row', flexWrap:'wrap', justifyContent:'center', paddingTop:10, paddingBottom:10 }}>
|
|
545
|
+
{match_matches.map((cm, i) => {
|
|
546
|
+
return renderMatchEvents({ item: cm, index: i })
|
|
547
|
+
})}
|
|
548
|
+
</View>
|
|
549
|
+
</LinearGradient>
|
|
550
|
+
)
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
const renderTeamEvents = (data: {item:string, index:number}) => {
|
|
554
|
+
const event = events.find(e => e.event_id == data.item)//[data.item]
|
|
555
|
+
if(!event){ return <></> }
|
|
556
|
+
const league = leagues.find(l => l.league_id == event.league_id);
|
|
557
|
+
const team_primary_matches = competition_matches.filter(cm => cm.event_type == 'team' && cm.event_id == data.item && !cm.market_id_override);
|
|
558
|
+
const non_primary_markets = [ ... new Set(competition_matches.filter(cm => cm.event_type == 'team' && cm.event_id == data.item && cm.market_id_override).map(cm => cm.market_id_override ?? ''))]
|
|
559
|
+
const expanded = expanded_markets.includes(data.item) ? true : false
|
|
560
|
+
return (
|
|
561
|
+
<LinearGradient start={{x: 0, y: 0}} end={{x: 1, y: 0}} colors={[Colors.shades.white, '#F8F8F8']} style={{ minWidth:350, flex:1, flexGrow:1, margin:10, borderWidth:1, borderColor:Colors.shades.shade100, borderRadius:8, ...view_styles.float }}>
|
|
562
|
+
<View style={{ padding:10, flexDirection:'row', borderBottomWidth:1, borderColor:Colors.shades.shade600 }}>
|
|
563
|
+
{league ?
|
|
564
|
+
<Text size={14} color={Colors.brand.midnight} weight='bold'>{league.league_name}: </Text>
|
|
565
|
+
:<></>}
|
|
566
|
+
<Text style={{ flex:1 }} size={14} color={Colors.brand.midnight} weight='bold'>{event.event_title}</Text>
|
|
567
|
+
<Text size={14} color={Colors.brand.midnight} weight='regular'>{event.time_detail == 'scheduled' ? moment(event.scheduled_datetime).format('MM/DD @ hh:mm a'): event.time_detail}</Text>
|
|
568
|
+
</View>
|
|
569
|
+
|
|
570
|
+
<LinearDiagnal label_size={12} label="Primary Markets" left_color={Colors.brand.midnight} right_color={Colors.brand.midnightTopGradient}/>
|
|
571
|
+
{team_primary_matches.map((cm, i) => {
|
|
572
|
+
return renderEvents({ item: cm, index: i })
|
|
573
|
+
})}
|
|
574
|
+
{non_primary_markets.length > 0 ?
|
|
575
|
+
<View style={{ borderBottomRightRadius:8, borderBottomLeftRadius:8 }}>
|
|
576
|
+
{expanded ?
|
|
577
|
+
<View>
|
|
578
|
+
{non_primary_markets.map((id, i) => {
|
|
579
|
+
return renderNonPrimaryMarkets({ item:id, index:i, event_id: data.item, event_type: 'team' })
|
|
580
|
+
})}
|
|
581
|
+
</View>
|
|
582
|
+
:<></>}
|
|
583
|
+
<TouchableOpacity style={{ flexDirection:'row', alignItems:'center', padding:15, borderTopWidth:1, borderColor:Colors.shades.shade600 }} onPress={() => expanded ? setExpandedMarkets(expanded_markets.filter(m => m != data.item)): setExpandedMarkets(expanded_markets.concat(data.item))}>
|
|
584
|
+
<Text style={{ flex:1 }} size={14} color={Colors.brand.midnight} weight='semibold'>{expanded?'Hide Markets':`${non_primary_markets.length} More Markets` }</Text>
|
|
585
|
+
<Icons.ChevronIcon direction={expanded?'up':'down'} color={Colors.brand.midnight} size={8}/>
|
|
586
|
+
</TouchableOpacity>
|
|
587
|
+
</View>
|
|
588
|
+
:<></>}
|
|
589
|
+
</LinearGradient>
|
|
590
|
+
)
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
if(loading || !competition || !competition_type || !competition_result_type){
|
|
595
|
+
return (
|
|
596
|
+
<View style={{ flex:1, backgroundColor:Colors.shades.white }}>
|
|
597
|
+
{company ?
|
|
598
|
+
<View style={{ flexDirection:'row', alignItems:'center', padding:15, backgroundColor:company?.brand_primary ?? Colors.shades.shade100 }}>
|
|
599
|
+
{back_allowed ?
|
|
600
|
+
<TouchableOpacity style={{ paddingRight:20 }} onPress={() => onGoBack ? onGoBack() : console.log('')}>
|
|
601
|
+
<Icons.ChevronIcon direction="left" size={14} color={company?.brand_secondary ?? Colors.brand.midnight} />
|
|
602
|
+
</TouchableOpacity>
|
|
603
|
+
:<></>}
|
|
604
|
+
<Text style={{ flex:1 }} size={14} color={company?.brand_secondary ?? Colors.brand.midnight} weight='bold' textAlign="center">Brought to you by {company?company.company_name:'BettorEdge'}</Text>
|
|
605
|
+
</View>
|
|
606
|
+
:<></>}
|
|
607
|
+
<ActivityIndicator style={{ padding:20 }} size='large' color={Colors.brand.midnight} />
|
|
608
|
+
</View>
|
|
609
|
+
)
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
return (
|
|
614
|
+
<View style={{ flex:1, backgroundColor:Colors.shades.shade100 }}>
|
|
615
|
+
<ScrollView style={{ flex:1 }}>
|
|
616
|
+
{company ?
|
|
617
|
+
<View style={{ flexDirection:'row', alignItems:'center', padding:15, backgroundColor:company?.brand_primary ?? Colors.shades.shade100 }}>
|
|
618
|
+
{back_allowed ?
|
|
619
|
+
<TouchableOpacity style={{ paddingRight:20 }} onPress={() => onGoBack ? onGoBack() : console.log('')}>
|
|
620
|
+
<Icons.ChevronIcon direction="left" size={14} color={company?.brand_secondary ?? Colors.brand.midnight} />
|
|
621
|
+
</TouchableOpacity>
|
|
622
|
+
:<></>}
|
|
623
|
+
<Text style={{ flex:1 }} size={14} color={company?.brand_secondary ?? Colors.brand.midnight} weight='bold' textAlign="center">Brought to you by {company?company.company_name:'BettorEdge'}</Text>
|
|
624
|
+
</View>
|
|
625
|
+
:<></>}
|
|
626
|
+
<View nativeID="cometition_header" style={{ minWidth:300, backgroundColor:Colors.brand.midnight }}>
|
|
627
|
+
<CompetitionInfoCard
|
|
628
|
+
player={player}
|
|
629
|
+
competition={competition}
|
|
630
|
+
competition_type={competition_type}
|
|
631
|
+
onEnter={() => handleEnterPrompt()}
|
|
632
|
+
can_leave={can_leave}
|
|
633
|
+
onViewRules={() => setShowRules(true)}
|
|
634
|
+
onViewPrize={() => {
|
|
635
|
+
setNavOutPrompt({
|
|
636
|
+
visible: true,
|
|
637
|
+
cancel_title: 'CLOSE',
|
|
638
|
+
title: 'Competition Additional Prize!',
|
|
639
|
+
body: competition.prize_override,
|
|
640
|
+
image_url: competition.prize_image?.url,
|
|
641
|
+
hide_accept: true
|
|
642
|
+
})
|
|
643
|
+
}}
|
|
644
|
+
onLeave={() => handleLeaveCompetition()}
|
|
645
|
+
onViewEvents={() => console.log('VIEW!')}
|
|
646
|
+
|
|
647
|
+
/>
|
|
648
|
+
</View>
|
|
649
|
+
{competition_season ?
|
|
650
|
+
<TouchableOpacity style={{ backgroundColor:Colors.incentive.gold, padding:10 }} onPress={() => setShowSeason(true)}>
|
|
651
|
+
<Text size={18} color={Colors.shades.white} weight='bold'>Competition Season</Text>
|
|
652
|
+
<View nativeID="competition_leaderboard" style={{ marginTop:5, flexDirection:'row', alignItems:'center'}}>
|
|
653
|
+
<View style={{ padding:5 }}>
|
|
654
|
+
<Image
|
|
655
|
+
source={{ uri: competition_season.image?.url }}
|
|
656
|
+
style={{ height:50, width:75, borderRadius:8 }}
|
|
657
|
+
resizeMode="cover"
|
|
658
|
+
/>
|
|
659
|
+
</View>
|
|
660
|
+
<View style={{ flex:1 }}>
|
|
661
|
+
<Text size={14} color={Colors.shades.white} weight='semibold'>{competition_season.season_name}</Text>
|
|
662
|
+
<Text style={{ marginTop:3 }} size={14} color={Colors.shades.white} weight='regular'>{competition_season.season_description}</Text>
|
|
663
|
+
</View>
|
|
664
|
+
<View style={{ padding:5 }}>
|
|
665
|
+
<Icons.ChevronIcon direction="right" color={Colors.shades.white} size={16}/>
|
|
666
|
+
</View>
|
|
667
|
+
</View>
|
|
668
|
+
</TouchableOpacity>
|
|
669
|
+
:<></>}
|
|
670
|
+
<View nativeID="competition_leaderboard" style={{ minWidth:300, padding:10 }}>
|
|
671
|
+
<Text size={18} color={Colors.brand.midnight} weight='bold'>Competition Leaderboard</Text>
|
|
672
|
+
<View style={{ marginTop:10 }}>
|
|
673
|
+
<CompetitionLeaderboard
|
|
674
|
+
competition={competition}
|
|
675
|
+
competition_type={competition_type}
|
|
676
|
+
height={height}
|
|
677
|
+
onLeaderSelect={(player) => setViewingLeader(player)}
|
|
678
|
+
view_mode="short"
|
|
679
|
+
onSeeFull={() => setShowFullLeaderboard(true)}
|
|
680
|
+
viewer_id={player?.player_id}
|
|
681
|
+
/>
|
|
682
|
+
</View>
|
|
683
|
+
</View>
|
|
684
|
+
<View nativeID="competition_picks" style={{ backgroundColor:Colors.shades.white, marginTop:5 }}>
|
|
685
|
+
{competition?.status != 'closed' ?
|
|
686
|
+
<View nativeID="upcoming_picks">
|
|
687
|
+
<View style={{flexDirection:'row', alignItems:'center', justifyContent:'space-between', marginBottom:15}} >
|
|
688
|
+
<ImageBackground style={{ flex:1, flexDirection:'row', alignItems:'center', width:width }} resizeMode="cover" source={{ uri: 'https://res.cloudinary.com/hoabts6mc/image/upload/v1691609143/diagnal_header_l4kw7u.png' }}>
|
|
689
|
+
<View style={{ flex:1, flexDirection:'row', alignItems:'center', padding:10 }}>
|
|
690
|
+
<Text size={18} color={Colors.shades.white} weight='bold'>Upcoming Events</Text>
|
|
691
|
+
<View style={{marginLeft:8, borderRadius:100, height:24, width:24, backgroundColor:Colors.highlights.highlight200, justifyContent:'center', alignItems:'center'}}>
|
|
692
|
+
<Text size={12} color={Colors.shades.white} weight='bold' textAlign='center'>{player_picks.filter(pp => pp.status == 'inprogress').length}</Text>
|
|
693
|
+
</View>
|
|
694
|
+
</View>
|
|
695
|
+
{authenticated_competition_player ?
|
|
696
|
+
<SpringView
|
|
697
|
+
slide="horizontal"
|
|
698
|
+
from={200}
|
|
699
|
+
to={0}
|
|
700
|
+
style={{ flex:1, flexDirection:'row', borderTopLeftRadius:22, borderBottomLeftRadius:22, padding:10, alignItems:'center', backgroundColor:Colors.utility.success, ...view_styles.float }}
|
|
701
|
+
>
|
|
702
|
+
{ competition_type?.type == 'wager' ?
|
|
703
|
+
<Text style={{ flex:1 }} size={14} color={Colors.shades.white} weight='semibold' textAlign="right">{authenticated_competition_player.wager_based_balance.toFixed(2)} Remaining</Text>
|
|
704
|
+
:
|
|
705
|
+
<Text style={{ flex:1 }} size={14} color={Colors.shades.white} weight='semibold' textAlign="right">{competition.max_pick_count - player_picks.length} Picks Remaining</Text>
|
|
706
|
+
}
|
|
707
|
+
</SpringView>
|
|
708
|
+
:<></>}
|
|
709
|
+
</ImageBackground>
|
|
710
|
+
</View>
|
|
711
|
+
<FlatList
|
|
712
|
+
data={ip_team_event_ids}
|
|
713
|
+
renderItem={renderTeamEvents}
|
|
714
|
+
keyExtractor={(item) => item}
|
|
715
|
+
/>
|
|
716
|
+
<FlatList
|
|
717
|
+
data={unique_tournaments}
|
|
718
|
+
renderItem={renderTournaments}
|
|
719
|
+
keyExtractor={(item) => item}
|
|
720
|
+
/>
|
|
721
|
+
</View>
|
|
722
|
+
:<></>}
|
|
723
|
+
<View nativeID="closed_picks">
|
|
724
|
+
<TouchableOpacity style={{ padding:10, marginBottom:15, flexDirection:'row', alignItems:'center', justifyContent:'space-between', backgroundColor:Colors.brand.midnight, marginTop:15 }} onPress={() => handleShowComplete()}>
|
|
725
|
+
<View style={{flexDirection:'row', alignItems:'center'}}>
|
|
726
|
+
<Text size={18} color={Colors.shades.white} weight='bold'>Completed</Text>
|
|
727
|
+
<View style={{marginLeft:8, borderRadius:100, height:24, width:24, backgroundColor:Colors.highlights.highlight200, justifyContent:'center', alignItems:'center'}}>
|
|
728
|
+
<Text size={12} color={Colors.shades.white} weight='bold' textAlign='center'>{player_picks.filter(p => p.status === 'closed').length}</Text>
|
|
729
|
+
</View>
|
|
730
|
+
</View>
|
|
731
|
+
<Icons.ChevronIcon color={Colors.shades.white} direction={show_completed?'up':'down'} size={14} />
|
|
732
|
+
</TouchableOpacity>
|
|
733
|
+
{show_completed ?
|
|
734
|
+
<View>
|
|
735
|
+
<FlatList
|
|
736
|
+
data={closed_team_event_ids}
|
|
737
|
+
renderItem={renderTeamEvents}
|
|
738
|
+
keyExtractor={(item) => item}
|
|
739
|
+
/>
|
|
740
|
+
</View>
|
|
741
|
+
:<></>}
|
|
742
|
+
</View>
|
|
743
|
+
</View>
|
|
744
|
+
</ScrollView>
|
|
745
|
+
{player && !hide_player ?
|
|
746
|
+
<View style={{ flexDirection:'row', padding:10, backgroundColor:Colors.shades.shade100, borderBottomLeftRadius:22, borderBottomRightRadius:22 }}>
|
|
747
|
+
<TouchableOpacity style={{ flex:1, flexDirection:'row', alignItems:'center' }} onPress={() => setProfileVisible(!profile_visible)}>
|
|
748
|
+
<View>
|
|
749
|
+
<Image
|
|
750
|
+
source={{ uri: player.profile_pic && player.profile_pic != '' ? player.profile_pic : 'https://res.cloudinary.com/hoabts6mc/image/upload/v1689262384/default-avatar_bbkn2t.png' }}
|
|
751
|
+
style={{ height:40, width:40, borderRadius:100 }}
|
|
752
|
+
resizeMode='cover'
|
|
753
|
+
/>
|
|
754
|
+
</View>
|
|
755
|
+
<View style={{ flex:1, flexDirection:'row', marginLeft:10 }}>
|
|
756
|
+
<View>
|
|
757
|
+
<Text size={12} color={Colors.brand.midnight} weight='regular'>Playing as</Text>
|
|
758
|
+
<Text style={{ marginTop:3 }} size={12} color={Colors.brand.midnight} weight='bold'>{player.username}</Text>
|
|
759
|
+
</View>
|
|
760
|
+
</View>
|
|
761
|
+
</TouchableOpacity>
|
|
762
|
+
{player_balance ?
|
|
763
|
+
<View>
|
|
764
|
+
<Text size={12} color={Colors.brand.midnight} textAlign="right">{competition.market_type == 'FOR_MONEY' ? 'USD' : 'Edge Coins'}</Text>
|
|
765
|
+
<Text style={{ marginTop:3 }} size={14} color={Colors.brand.midnight} weight='bold' textAlign="right">{competition.market_type == 'FOR_MONEY' ? `$${player_balance.balance.toFixed(2)}`:`E${player_balance.free_market_balance.toFixed(2)}`}</Text>
|
|
766
|
+
</View>
|
|
767
|
+
:<></>}
|
|
768
|
+
</View>
|
|
769
|
+
:<></>}
|
|
770
|
+
{show_full_leaderboard ?
|
|
771
|
+
<View
|
|
772
|
+
style={{ flex:1, position:'absolute', top:0, right:0, left:0, bottom:0, backgroundColor:Colors.shades.black_faded }}>
|
|
773
|
+
<SpringView
|
|
774
|
+
slide='vertical'
|
|
775
|
+
to={0}
|
|
776
|
+
from={1000}
|
|
777
|
+
>
|
|
778
|
+
<CompetitionLeaderboard
|
|
779
|
+
competition={competition}
|
|
780
|
+
competition_type={competition_type}
|
|
781
|
+
height={height}
|
|
782
|
+
onSeeFull={() => setShowFullLeaderboard(false)}
|
|
783
|
+
view_mode="full"
|
|
784
|
+
onLeaderSelect={(player) => setViewingLeader(player)}
|
|
785
|
+
viewer_id={player?.player_id}
|
|
786
|
+
/>
|
|
787
|
+
</SpringView>
|
|
788
|
+
</View>
|
|
789
|
+
:<></>}
|
|
790
|
+
{viewing_leader ?
|
|
791
|
+
<View
|
|
792
|
+
style={{ flex:1, position:'absolute', top:0, right:0, left:0, bottom:0, backgroundColor:Colors.shades.black_faded }}>
|
|
793
|
+
<SpringView
|
|
794
|
+
slide='vertical'
|
|
795
|
+
to={0}
|
|
796
|
+
style={{ flex:1 }}
|
|
797
|
+
from={1000}
|
|
798
|
+
>
|
|
799
|
+
<LeaderPicks
|
|
800
|
+
height={height}
|
|
801
|
+
markets={markets}
|
|
802
|
+
competition_type={competition_type}
|
|
803
|
+
competition_matches={competition_matches}
|
|
804
|
+
competition_match_markets={competition_match_markets}
|
|
805
|
+
events={events}
|
|
806
|
+
matches={matches}
|
|
807
|
+
tournaments={tournaments}
|
|
808
|
+
athletes={athletes}
|
|
809
|
+
teams={[]}
|
|
810
|
+
competition={competition}
|
|
811
|
+
leader={viewing_leader}
|
|
812
|
+
onClose={() => setViewingLeader(undefined)}
|
|
813
|
+
/>
|
|
814
|
+
</SpringView>
|
|
815
|
+
</View>
|
|
816
|
+
:<></>}
|
|
817
|
+
{draft_player_pick?.draft_pick ?
|
|
818
|
+
<View
|
|
819
|
+
style={{ position:'absolute', top:0, right:0, left:0, bottom:0, backgroundColor:Colors.shades.black_faded, justifyContent:'flex-end', alignItems:'center' }}>
|
|
820
|
+
<SpringView
|
|
821
|
+
slide='vertical'
|
|
822
|
+
to={0}
|
|
823
|
+
from={200}
|
|
824
|
+
>
|
|
825
|
+
<WagerPickForm
|
|
826
|
+
event_start={draft_player_pick.event_start ?? ''}
|
|
827
|
+
event_title={draft_player_pick.event_title ?? ''}
|
|
828
|
+
width={width}
|
|
829
|
+
balance={authenticated_competition_player?.wager_based_balance ?? 0}
|
|
830
|
+
loading={pick_loading}
|
|
831
|
+
player_pick={draft_player_pick.draft_pick}
|
|
832
|
+
onCancel={() => setDraftPlayerPick({})}
|
|
833
|
+
onSubmit={(pp) => handleWagerSubmit(pp)}
|
|
834
|
+
/>
|
|
835
|
+
</SpringView>
|
|
836
|
+
</View>
|
|
837
|
+
:<></>}
|
|
838
|
+
{show_season && competition_season && competition.competition_season_id ?
|
|
839
|
+
<View
|
|
840
|
+
style={{ position:'absolute', top:0, right:0, left:0, bottom:0, backgroundColor:Colors.shades.black_faded, justifyContent:'flex-end', alignItems:'center' }}>
|
|
841
|
+
<SpringView
|
|
842
|
+
slide='vertical'
|
|
843
|
+
to={0}
|
|
844
|
+
from={1000}
|
|
845
|
+
>
|
|
846
|
+
<SeasonInfoModal
|
|
847
|
+
competition_season={competition_season}
|
|
848
|
+
competition_types={competition_types}
|
|
849
|
+
competition_result_types={competition_result_types}
|
|
850
|
+
width={width}
|
|
851
|
+
height={height}
|
|
852
|
+
onSelectCompetition={(competition) => {
|
|
853
|
+
setShowSeason(false);
|
|
854
|
+
if(onChangeCompetition){ return onChangeCompetition(competition.competition_id) }
|
|
855
|
+
}}
|
|
856
|
+
onClose={() => setShowSeason(false)}
|
|
857
|
+
/>
|
|
858
|
+
</SpringView>
|
|
859
|
+
</View>
|
|
860
|
+
:<></>}
|
|
861
|
+
{show_enter_prompt ?
|
|
862
|
+
<View
|
|
863
|
+
style={{ position:'absolute', top:0, right:0, left:0, bottom:0, backgroundColor:Colors.shades.black_faded, justifyContent:'flex-end', alignItems:'center' }}>
|
|
864
|
+
<SpringView
|
|
865
|
+
slide='vertical'
|
|
866
|
+
to={0}
|
|
867
|
+
from={200}
|
|
868
|
+
>
|
|
869
|
+
<EnterCompetitionPrompt
|
|
870
|
+
player={player}
|
|
871
|
+
width={width}
|
|
872
|
+
competition={competition}
|
|
873
|
+
competition_type={competition_type}
|
|
874
|
+
competition_result_type={competition_result_type}
|
|
875
|
+
onVerify={() => handleProfile('unverified')}
|
|
876
|
+
onCancel={() => setShowEnterPrompt(false)}
|
|
877
|
+
onEnter={(promo_balance) => handleEnterCompetition(promo_balance)}
|
|
878
|
+
/>
|
|
879
|
+
</SpringView>
|
|
880
|
+
</View>
|
|
881
|
+
:<></>}
|
|
882
|
+
{show_rules ?
|
|
883
|
+
<View
|
|
884
|
+
style={{ position:'absolute', top:0, right:0, left:0, bottom:0, padding:10, backgroundColor:Colors.shades.black_faded, justifyContent:'center', alignItems:'center' }}>
|
|
885
|
+
<SpringView
|
|
886
|
+
slide='vertical'
|
|
887
|
+
to={0}
|
|
888
|
+
from={1000}
|
|
889
|
+
>
|
|
890
|
+
<CompetitionTypeCard
|
|
891
|
+
visible={show_rules ? true : false}
|
|
892
|
+
init_view="type"
|
|
893
|
+
onClose={() => setShowRules(false)}
|
|
894
|
+
competition={competition}
|
|
895
|
+
competition_type={competition_type}
|
|
896
|
+
competition_result_type={competition_result_type}
|
|
897
|
+
competition_payout_types={competition_payout_types}
|
|
898
|
+
|
|
899
|
+
|
|
900
|
+
/>
|
|
901
|
+
</SpringView>
|
|
902
|
+
</View>
|
|
903
|
+
:<></>}
|
|
904
|
+
{nav_out_prompt.visible ?
|
|
905
|
+
<View
|
|
906
|
+
style={{ flex:1, position:'absolute', top:0, right:0, left:0, bottom:0, backgroundColor:Colors.shades.black_faded, justifyContent:'center', alignItems:'center' }}>
|
|
907
|
+
<SpringView
|
|
908
|
+
slide='vertical'
|
|
909
|
+
to={0}
|
|
910
|
+
from={1000}
|
|
911
|
+
>
|
|
912
|
+
<NavOutPrompt
|
|
913
|
+
accept_title={nav_out_prompt.accept_title}
|
|
914
|
+
body={nav_out_prompt.body ?? ''}
|
|
915
|
+
cancel_title={nav_out_prompt.cancel_title}
|
|
916
|
+
code_details={code_details}
|
|
917
|
+
title={nav_out_prompt.title ?? ''}
|
|
918
|
+
max_width={width* 0.8}
|
|
919
|
+
hide_accept={nav_out_prompt.hide_accept}
|
|
920
|
+
image_url={nav_out_prompt.image_url}
|
|
921
|
+
onCancel={() => setNavOutPrompt({ visible: false })}
|
|
922
|
+
onAccept={() => {
|
|
923
|
+
if(nav_out_prompt.url){
|
|
924
|
+
window.open(nav_out_prompt.url, '_blank')
|
|
925
|
+
}
|
|
926
|
+
setNavOutPrompt({ visible: false })
|
|
927
|
+
}}
|
|
928
|
+
/>
|
|
929
|
+
</SpringView>
|
|
930
|
+
</View>
|
|
931
|
+
:<></>}
|
|
932
|
+
</View>
|
|
933
|
+
)
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
export default CompetitionPlay
|