be-components 4.2.0 → 4.2.2
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/Competition/components/CompetitionLeaderboard.js +12 -23
- package/lib/commonjs/Competition/components/CompetitionLeaderboard.js.map +1 -1
- package/lib/commonjs/Competition/components/EnterCompetitionPrompt.js +191 -100
- package/lib/commonjs/Competition/components/EnterCompetitionPrompt.js.map +1 -1
- package/lib/commonjs/Competition/components/WagerPickForm.js +8 -2
- package/lib/commonjs/Competition/components/WagerPickForm.js.map +1 -1
- package/lib/commonjs/Competition/index.js +49 -9
- package/lib/commonjs/Competition/index.js.map +1 -1
- package/lib/commonjs/Components/ConfirmationModal.js +11 -3
- package/lib/commonjs/Components/ConfirmationModal.js.map +1 -1
- package/lib/commonjs/Components/SearchBox.js +3 -1
- package/lib/commonjs/Components/SearchBox.js.map +1 -1
- package/lib/commonjs/MarketComponents/components/ContestOrderStatsCard.js +2 -0
- package/lib/commonjs/MarketComponents/components/ContestOrderStatsCard.js.map +1 -1
- package/lib/commonjs/MarketMaker/components/Contest.js +39 -41
- package/lib/commonjs/MarketMaker/components/Contest.js.map +1 -1
- package/lib/commonjs/MarketMaker/components/ContestSelector.js +48 -30
- package/lib/commonjs/MarketMaker/components/ContestSelector.js.map +1 -1
- package/lib/commonjs/MarketMaker/components/Dashboard.js +14 -73
- package/lib/commonjs/MarketMaker/components/Dashboard.js.map +1 -1
- package/lib/commonjs/MarketMaker/components/FundOwnershipList.js +27 -30
- package/lib/commonjs/MarketMaker/components/FundOwnershipList.js.map +1 -1
- package/lib/commonjs/MarketMaker/components/FundSelector.js +30 -33
- package/lib/commonjs/MarketMaker/components/FundSelector.js.map +1 -1
- package/lib/commonjs/MarketMaker/components/FundingRequestList.js +28 -41
- package/lib/commonjs/MarketMaker/components/FundingRequestList.js.map +1 -1
- package/lib/commonjs/MarketMaker/components/ManageFundForm.js +1 -1
- package/lib/commonjs/MarketMaker/components/ManageFundForm.js.map +1 -1
- package/lib/commonjs/MarketMaker/components/MarketSelector.js +26 -24
- package/lib/commonjs/MarketMaker/components/MarketSelector.js.map +1 -1
- package/lib/commonjs/MarketMaker/components/OrderForm.js +7 -4
- package/lib/commonjs/MarketMaker/components/OrderForm.js.map +1 -1
- package/lib/commonjs/MarketMaker/index.js +301 -227
- package/lib/commonjs/MarketMaker/index.js.map +1 -1
- package/lib/commonjs/Poll/components/CampaignHeader.js +20 -15
- package/lib/commonjs/Poll/components/CampaignHeader.js.map +1 -1
- package/lib/commonjs/Poll/components/CampaignLeaderboard.js +77 -75
- package/lib/commonjs/Poll/components/CampaignLeaderboard.js.map +1 -1
- package/lib/commonjs/Poll/components/CampaignProgressBar.js +21 -20
- package/lib/commonjs/Poll/components/CampaignProgressBar.js.map +1 -1
- package/lib/commonjs/Poll/components/CampaignResult.js +21 -19
- package/lib/commonjs/Poll/components/CampaignResult.js.map +1 -1
- package/lib/commonjs/Poll/components/PollCard.js +240 -218
- package/lib/commonjs/Poll/components/PollCard.js.map +1 -1
- package/lib/commonjs/Poll/components/PollOptionCard.js +28 -25
- package/lib/commonjs/Poll/components/PollOptionCard.js.map +1 -1
- package/lib/commonjs/Poll/components/PollQuestionsSection.js +25 -19
- package/lib/commonjs/Poll/components/PollQuestionsSection.js.map +1 -1
- package/lib/commonjs/Poll/components/PollSelectCard.js +48 -45
- package/lib/commonjs/Poll/components/PollSelectCard.js.map +1 -1
- package/lib/commonjs/Poll/index.js +97 -93
- package/lib/commonjs/Poll/index.js.map +1 -1
- package/lib/commonjs/Squares/index.js +28 -9
- package/lib/commonjs/Squares/index.js.map +1 -1
- package/lib/module/Competition/components/CompetitionLeaderboard.js +12 -23
- package/lib/module/Competition/components/CompetitionLeaderboard.js.map +1 -1
- package/lib/module/Competition/components/EnterCompetitionPrompt.js +191 -100
- package/lib/module/Competition/components/EnterCompetitionPrompt.js.map +1 -1
- package/lib/module/Competition/components/WagerPickForm.js +8 -2
- package/lib/module/Competition/components/WagerPickForm.js.map +1 -1
- package/lib/module/Competition/index.js +49 -9
- package/lib/module/Competition/index.js.map +1 -1
- package/lib/module/Components/ConfirmationModal.js +11 -3
- package/lib/module/Components/ConfirmationModal.js.map +1 -1
- package/lib/module/Components/SearchBox.js +3 -1
- package/lib/module/Components/SearchBox.js.map +1 -1
- package/lib/module/MarketComponents/components/ContestOrderStatsCard.js +2 -0
- package/lib/module/MarketComponents/components/ContestOrderStatsCard.js.map +1 -1
- package/lib/module/MarketMaker/components/Contest.js +21 -24
- package/lib/module/MarketMaker/components/Contest.js.map +1 -1
- package/lib/module/MarketMaker/components/ContestSelector.js +43 -25
- package/lib/module/MarketMaker/components/ContestSelector.js.map +1 -1
- package/lib/module/MarketMaker/components/Dashboard.js +9 -66
- package/lib/module/MarketMaker/components/Dashboard.js.map +1 -1
- package/lib/module/MarketMaker/components/FundOwnershipList.js +19 -22
- package/lib/module/MarketMaker/components/FundOwnershipList.js.map +1 -1
- package/lib/module/MarketMaker/components/FundSelector.js +24 -27
- package/lib/module/MarketMaker/components/FundSelector.js.map +1 -1
- package/lib/module/MarketMaker/components/FundingRequestList.js +18 -31
- package/lib/module/MarketMaker/components/FundingRequestList.js.map +1 -1
- package/lib/module/MarketMaker/components/ManageFundForm.js +1 -1
- package/lib/module/MarketMaker/components/ManageFundForm.js.map +1 -1
- package/lib/module/MarketMaker/components/MarketSelector.js +19 -17
- package/lib/module/MarketMaker/components/MarketSelector.js.map +1 -1
- package/lib/module/MarketMaker/components/OrderForm.js +7 -4
- package/lib/module/MarketMaker/components/OrderForm.js.map +1 -1
- package/lib/module/MarketMaker/index.js +298 -223
- package/lib/module/MarketMaker/index.js.map +1 -1
- package/lib/module/Poll/components/CampaignHeader.js +19 -14
- package/lib/module/Poll/components/CampaignHeader.js.map +1 -1
- package/lib/module/Poll/components/CampaignLeaderboard.js +59 -57
- package/lib/module/Poll/components/CampaignLeaderboard.js.map +1 -1
- package/lib/module/Poll/components/CampaignProgressBar.js +17 -15
- package/lib/module/Poll/components/CampaignProgressBar.js.map +1 -1
- package/lib/module/Poll/components/CampaignResult.js +17 -15
- package/lib/module/Poll/components/CampaignResult.js.map +1 -1
- package/lib/module/Poll/components/PollCard.js +238 -216
- package/lib/module/Poll/components/PollCard.js.map +1 -1
- package/lib/module/Poll/components/PollOptionCard.js +24 -20
- package/lib/module/Poll/components/PollOptionCard.js.map +1 -1
- package/lib/module/Poll/components/PollQuestionsSection.js +21 -15
- package/lib/module/Poll/components/PollQuestionsSection.js.map +1 -1
- package/lib/module/Poll/components/PollSelectCard.js +33 -30
- package/lib/module/Poll/components/PollSelectCard.js.map +1 -1
- package/lib/module/Poll/index.js +97 -92
- package/lib/module/Poll/index.js.map +1 -1
- package/lib/module/Squares/index.js +28 -9
- package/lib/module/Squares/index.js.map +1 -1
- package/lib/typescript/lib/commonjs/Competition/components/CompetitionLeaderboard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Competition/components/EnterCompetitionPrompt.d.ts +2 -1
- package/lib/typescript/lib/commonjs/Competition/components/EnterCompetitionPrompt.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Competition/components/WagerPickForm.d.ts +3 -1
- package/lib/typescript/lib/commonjs/Competition/components/WagerPickForm.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Competition/index.d.ts +2 -1
- package/lib/typescript/lib/commonjs/Competition/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Components/ConfirmationModal.d.ts +2 -1
- package/lib/typescript/lib/commonjs/Components/ConfirmationModal.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Components/SearchBox.d.ts +2 -1
- package/lib/typescript/lib/commonjs/Components/SearchBox.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketComponents/components/ContestOrderStatsCard.d.ts +2 -1
- package/lib/typescript/lib/commonjs/MarketComponents/components/ContestOrderStatsCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketMaker/components/Contest.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketMaker/components/ContestSelector.d.ts +1 -2
- package/lib/typescript/lib/commonjs/MarketMaker/components/ContestSelector.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketMaker/components/Dashboard.d.ts +1 -2
- package/lib/typescript/lib/commonjs/MarketMaker/components/Dashboard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketMaker/components/FundOwnershipList.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketMaker/components/FundSelector.d.ts +1 -2
- package/lib/typescript/lib/commonjs/MarketMaker/components/FundSelector.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketMaker/components/FundingRequestList.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketMaker/components/MarketSelector.d.ts +1 -2
- package/lib/typescript/lib/commonjs/MarketMaker/components/MarketSelector.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketMaker/components/OrderForm.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketMaker/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Poll/components/CampaignHeader.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Poll/components/CampaignLeaderboard.d.ts +1 -2
- package/lib/typescript/lib/commonjs/Poll/components/CampaignLeaderboard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Poll/components/CampaignProgressBar.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Poll/components/CampaignResult.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Poll/components/PollCard.d.ts +2 -1
- package/lib/typescript/lib/commonjs/Poll/components/PollCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Poll/components/PollOptionCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Poll/components/PollQuestionsSection.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Poll/components/PollSelectCard.d.ts +1 -2
- package/lib/typescript/lib/commonjs/Poll/components/PollSelectCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Poll/index.d.ts +1 -2
- package/lib/typescript/lib/commonjs/Poll/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Squares/index.d.ts +2 -1
- package/lib/typescript/lib/commonjs/Squares/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/Competition/components/CompetitionLeaderboard.d.ts.map +1 -1
- package/lib/typescript/lib/module/Competition/components/EnterCompetitionPrompt.d.ts +2 -1
- package/lib/typescript/lib/module/Competition/components/EnterCompetitionPrompt.d.ts.map +1 -1
- package/lib/typescript/lib/module/Competition/components/WagerPickForm.d.ts +3 -1
- package/lib/typescript/lib/module/Competition/components/WagerPickForm.d.ts.map +1 -1
- package/lib/typescript/lib/module/Competition/index.d.ts +2 -1
- package/lib/typescript/lib/module/Competition/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/Components/ConfirmationModal.d.ts +2 -1
- package/lib/typescript/lib/module/Components/ConfirmationModal.d.ts.map +1 -1
- package/lib/typescript/lib/module/Components/SearchBox.d.ts +2 -1
- package/lib/typescript/lib/module/Components/SearchBox.d.ts.map +1 -1
- package/lib/typescript/lib/module/Components/Spring.d.ts +1 -1
- package/lib/typescript/lib/module/MarketComponents/components/ContestOrderStatsCard.d.ts +2 -1
- package/lib/typescript/lib/module/MarketComponents/components/ContestOrderStatsCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketMaker/components/Contest.d.ts +1 -2
- package/lib/typescript/lib/module/MarketMaker/components/Contest.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketMaker/components/ContestSelector.d.ts +2 -4
- package/lib/typescript/lib/module/MarketMaker/components/ContestSelector.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketMaker/components/Dashboard.d.ts +2 -4
- package/lib/typescript/lib/module/MarketMaker/components/Dashboard.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketMaker/components/FundOwnershipList.d.ts +1 -2
- package/lib/typescript/lib/module/MarketMaker/components/FundOwnershipList.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketMaker/components/FundSelector.d.ts +2 -4
- package/lib/typescript/lib/module/MarketMaker/components/FundSelector.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketMaker/components/FundingRequestList.d.ts +1 -2
- package/lib/typescript/lib/module/MarketMaker/components/FundingRequestList.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketMaker/components/MarketSelector.d.ts +2 -4
- package/lib/typescript/lib/module/MarketMaker/components/MarketSelector.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketMaker/components/OrderForm.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketMaker/index.d.ts +1 -2
- package/lib/typescript/lib/module/MarketMaker/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/Poll/components/CampaignHeader.d.ts +1 -2
- package/lib/typescript/lib/module/Poll/components/CampaignHeader.d.ts.map +1 -1
- package/lib/typescript/lib/module/Poll/components/CampaignLeaderboard.d.ts +2 -4
- package/lib/typescript/lib/module/Poll/components/CampaignLeaderboard.d.ts.map +1 -1
- package/lib/typescript/lib/module/Poll/components/CampaignProgressBar.d.ts +1 -2
- package/lib/typescript/lib/module/Poll/components/CampaignProgressBar.d.ts.map +1 -1
- package/lib/typescript/lib/module/Poll/components/CampaignResult.d.ts +1 -2
- package/lib/typescript/lib/module/Poll/components/CampaignResult.d.ts.map +1 -1
- package/lib/typescript/lib/module/Poll/components/PollCard.d.ts +3 -5
- package/lib/typescript/lib/module/Poll/components/PollCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/Poll/components/PollOptionCard.d.ts +1 -2
- package/lib/typescript/lib/module/Poll/components/PollOptionCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/Poll/components/PollQuestionsSection.d.ts +1 -2
- package/lib/typescript/lib/module/Poll/components/PollQuestionsSection.d.ts.map +1 -1
- package/lib/typescript/lib/module/Poll/components/PollSelectCard.d.ts +2 -4
- package/lib/typescript/lib/module/Poll/components/PollSelectCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/Poll/index.d.ts +2 -4
- package/lib/typescript/lib/module/Poll/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/Squares/index.d.ts +2 -1
- package/lib/typescript/lib/module/Squares/index.d.ts.map +1 -1
- package/lib/typescript/src/Competition/components/CompetitionLeaderboard.d.ts.map +1 -1
- package/lib/typescript/src/Competition/components/EnterCompetitionPrompt.d.ts +2 -1
- package/lib/typescript/src/Competition/components/EnterCompetitionPrompt.d.ts.map +1 -1
- package/lib/typescript/src/Competition/components/WagerPickForm.d.ts +3 -1
- package/lib/typescript/src/Competition/components/WagerPickForm.d.ts.map +1 -1
- package/lib/typescript/src/Competition/index.d.ts +2 -1
- package/lib/typescript/src/Competition/index.d.ts.map +1 -1
- package/lib/typescript/src/Components/ConfirmationModal.d.ts +2 -1
- package/lib/typescript/src/Components/ConfirmationModal.d.ts.map +1 -1
- package/lib/typescript/src/Components/SearchBox.d.ts +2 -1
- package/lib/typescript/src/Components/SearchBox.d.ts.map +1 -1
- package/lib/typescript/src/MarketComponents/components/ContestOrderStatsCard.d.ts +2 -1
- package/lib/typescript/src/MarketComponents/components/ContestOrderStatsCard.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/components/Contest.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/components/ContestSelector.d.ts +1 -1
- package/lib/typescript/src/MarketMaker/components/ContestSelector.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/components/Dashboard.d.ts +1 -1
- package/lib/typescript/src/MarketMaker/components/Dashboard.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/components/FundOwnershipList.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/components/FundSelector.d.ts +1 -2
- package/lib/typescript/src/MarketMaker/components/FundSelector.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/components/FundingRequestList.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/components/ManageFundForm.d.ts +1 -1
- package/lib/typescript/src/MarketMaker/components/ManageFundForm.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/components/MarketSelector.d.ts +1 -2
- package/lib/typescript/src/MarketMaker/components/MarketSelector.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/components/OrderForm.d.ts +1 -1
- package/lib/typescript/src/MarketMaker/components/OrderForm.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/index.d.ts.map +1 -1
- package/lib/typescript/src/Poll/components/CampaignHeader.d.ts.map +1 -1
- package/lib/typescript/src/Poll/components/CampaignLeaderboard.d.ts +1 -2
- package/lib/typescript/src/Poll/components/CampaignLeaderboard.d.ts.map +1 -1
- package/lib/typescript/src/Poll/components/CampaignProgressBar.d.ts.map +1 -1
- package/lib/typescript/src/Poll/components/CampaignResult.d.ts.map +1 -1
- package/lib/typescript/src/Poll/components/PollCard.d.ts +3 -2
- package/lib/typescript/src/Poll/components/PollCard.d.ts.map +1 -1
- package/lib/typescript/src/Poll/components/PollOptionCard.d.ts.map +1 -1
- package/lib/typescript/src/Poll/components/PollQuestionsSection.d.ts.map +1 -1
- package/lib/typescript/src/Poll/components/PollSelectCard.d.ts +1 -1
- package/lib/typescript/src/Poll/components/PollSelectCard.d.ts.map +1 -1
- package/lib/typescript/src/Poll/index.d.ts +1 -2
- package/lib/typescript/src/Poll/index.d.ts.map +1 -1
- package/lib/typescript/src/Squares/index.d.ts +2 -1
- package/lib/typescript/src/Squares/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Competition/components/CompetitionLeaderboard.tsx +10 -21
- package/src/Competition/components/EnterCompetitionPrompt.tsx +98 -59
- package/src/Competition/components/WagerPickForm.tsx +4 -2
- package/src/Competition/index.tsx +33 -25
- package/src/Components/ConfirmationModal.tsx +5 -4
- package/src/Components/SearchBox.tsx +4 -2
- package/src/MarketComponents/components/ContestOrderStatsCard.tsx +3 -1
- package/src/MarketMaker/components/Contest.tsx +21 -21
- package/src/MarketMaker/components/ContestSelector.tsx +31 -22
- package/src/MarketMaker/components/Dashboard.tsx +9 -24
- package/src/MarketMaker/components/FundOwnershipList.tsx +13 -15
- package/src/MarketMaker/components/FundSelector.tsx +21 -23
- package/src/MarketMaker/components/FundingRequestList.tsx +14 -20
- package/src/MarketMaker/components/ManageFundForm.tsx +2 -2
- package/src/MarketMaker/components/MarketSelector.tsx +14 -16
- package/src/MarketMaker/components/OrderForm.tsx +6 -5
- package/src/MarketMaker/index.tsx +166 -94
- package/src/Poll/components/CampaignHeader.tsx +13 -12
- package/src/Poll/components/CampaignLeaderboard.tsx +41 -52
- package/src/Poll/components/CampaignProgressBar.tsx +17 -15
- package/src/Poll/components/CampaignResult.tsx +13 -13
- package/src/Poll/components/PollCard.tsx +129 -118
- package/src/Poll/components/PollOptionCard.tsx +20 -21
- package/src/Poll/components/PollQuestionsSection.tsx +15 -14
- package/src/Poll/components/PollSelectCard.tsx +47 -48
- package/src/Poll/index.tsx +83 -73
- package/src/Squares/index.tsx +29 -19
- package/lib/commonjs/Poll/components/CampaignPlay.js +0 -472
- package/lib/commonjs/Poll/components/CampaignPlay.js.map +0 -1
- package/lib/module/Poll/components/CampaignPlay.js +0 -463
- package/lib/module/Poll/components/CampaignPlay.js.map +0 -1
- package/lib/typescript/lib/commonjs/Poll/components/CampaignPlay.d.ts +0 -12
- package/lib/typescript/lib/commonjs/Poll/components/CampaignPlay.d.ts.map +0 -1
- package/lib/typescript/lib/module/Poll/components/CampaignPlay.d.ts +0 -13
- package/lib/typescript/lib/module/Poll/components/CampaignPlay.d.ts.map +0 -1
- package/lib/typescript/src/Poll/components/CampaignPlay.d.ts +0 -14
- package/lib/typescript/src/Poll/components/CampaignPlay.d.ts.map +0 -1
- package/src/Poll/components/CampaignPlay.tsx +0 -335
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { View } from 'react-native';
|
|
3
2
|
import { MarketMakerApi, MarketMaketHelpers } from './api';
|
|
4
3
|
import type { AthleteProps, BestAvailableResponseProps, EventProps, ExternalPriceProps, FundingRequestProps, FundOrderProps, FundOwnershipProps, FundProps, LeagueProps, MarketProps, MatchProps, OrderProps, PublicPlayerProps, TournamentProps, TradeProps } from '../types';
|
|
5
|
-
//import { view_styles } from '../constants/styles';
|
|
6
|
-
import Colors from '../constants/colors';
|
|
7
4
|
import ContestSelector from './components/ContestSelector';
|
|
8
5
|
import Dashboard from './components/Dashboard';
|
|
9
6
|
import MarketSelector from './components/MarketSelector';
|
|
@@ -15,6 +12,8 @@ import FundingRequestList from './components/FundingRequestList';
|
|
|
15
12
|
import FundOwnershipList from './components/FundOwnershipList';
|
|
16
13
|
import SocketManager from '../Socket';
|
|
17
14
|
import OrderForm from './components/OrderForm';
|
|
15
|
+
import { Text, View } from '../Components/Themed';
|
|
16
|
+
import { FlatList, Modal } from 'react-native';
|
|
18
17
|
|
|
19
18
|
type MarketMakerProps = {
|
|
20
19
|
player_id:string,
|
|
@@ -22,6 +21,9 @@ type MarketMakerProps = {
|
|
|
22
21
|
distinct_id:string
|
|
23
22
|
}
|
|
24
23
|
|
|
24
|
+
const contest_sections = ['header', 'toggle', 'funds', 'fund_owners', 'fund_requests', 'contests', 'markets']
|
|
25
|
+
const dashboard_sections = ['dashboard']
|
|
26
|
+
|
|
25
27
|
const MarketMaker = ({ player_id, access_token, distinct_id }:MarketMakerProps) => {
|
|
26
28
|
const [ ba_socket_data, setBASocketData ] = useState<BestAvailableResponseProps | undefined>(undefined);
|
|
27
29
|
const [ socket_fund, setSocketFund ] = useState<{ fund:FundProps, orders:OrderProps[] } | undefined>(undefined);
|
|
@@ -44,7 +46,7 @@ const MarketMaker = ({ player_id, access_token, distinct_id }:MarketMakerProps)
|
|
|
44
46
|
tournaments:[],
|
|
45
47
|
matches:[]
|
|
46
48
|
});
|
|
47
|
-
const {
|
|
49
|
+
const { leagues, events, markets, funds } = module_data;
|
|
48
50
|
|
|
49
51
|
const [ editing_fund, setEditingFund ] = useState<FundProps | undefined>(undefined);
|
|
50
52
|
const [ draft_order, setDraftOrder ] = useState<{
|
|
@@ -119,11 +121,6 @@ const MarketMaker = ({ player_id, access_token, distinct_id }:MarketMakerProps)
|
|
|
119
121
|
getLocation()
|
|
120
122
|
},[player_id]);
|
|
121
123
|
|
|
122
|
-
useEffect(() => {
|
|
123
|
-
if(!fund?.fund_id || !loaded){ return }
|
|
124
|
-
getDashData(fund.fund_id);
|
|
125
|
-
},[fund]);
|
|
126
|
-
|
|
127
124
|
useEffect(() => {
|
|
128
125
|
if(!ba_socket_data){ return }
|
|
129
126
|
//Reconcile and update ba_socket data!
|
|
@@ -163,6 +160,7 @@ const MarketMaker = ({ player_id, access_token, distinct_id }:MarketMakerProps)
|
|
|
163
160
|
}
|
|
164
161
|
|
|
165
162
|
const getDashData = async(fund_id:string) => {
|
|
163
|
+
setDashData({ ...dash_data, loading:true })
|
|
166
164
|
//Now load Dash data
|
|
167
165
|
console.log('1')
|
|
168
166
|
const ba = await MarketMakerApi.getBestAvailableOrders();
|
|
@@ -194,6 +192,7 @@ const MarketMaker = ({ player_id, access_token, distinct_id }:MarketMakerProps)
|
|
|
194
192
|
...dash_data,
|
|
195
193
|
loaded:true,
|
|
196
194
|
loading:false,
|
|
195
|
+
fund: fund_response.fund,
|
|
197
196
|
funding_requests:fr_requests,
|
|
198
197
|
players:plays,
|
|
199
198
|
fund_ownerships: fund_response.fund_ownerships,
|
|
@@ -207,6 +206,10 @@ const MarketMaker = ({ player_id, access_token, distinct_id }:MarketMakerProps)
|
|
|
207
206
|
}
|
|
208
207
|
|
|
209
208
|
|
|
209
|
+
const handleSelectFund = async(fund:FundProps) => {
|
|
210
|
+
await getDashData(fund.fund_id);
|
|
211
|
+
}
|
|
212
|
+
|
|
210
213
|
const getDataForMyAction = async(orders:OrderProps[], markets:MarketProps[]) => {
|
|
211
214
|
const ev_ids = orders.filter(o => o.event_type == 'team').map(o => o.event_id);
|
|
212
215
|
const mks = markets.filter(m => orders.map(o => o.market_id.toString()).includes(m.market_id.toString()))
|
|
@@ -243,39 +246,81 @@ const MarketMaker = ({ player_id, access_token, distinct_id }:MarketMakerProps)
|
|
|
243
246
|
})
|
|
244
247
|
}
|
|
245
248
|
|
|
249
|
+
const renderSections = (data:{ item:string, index:number }) => {
|
|
250
|
+
switch(data.item){
|
|
251
|
+
case 'header':
|
|
252
|
+
return (
|
|
253
|
+
<View>
|
|
254
|
+
<Text>Fund Manager!</Text>
|
|
255
|
+
</View>
|
|
256
|
+
)
|
|
257
|
+
case 'funds':
|
|
258
|
+
return (
|
|
259
|
+
<View style={{ margin:5 }}>
|
|
260
|
+
<FundSelector
|
|
261
|
+
funds={funds}
|
|
262
|
+
selected_fund_id={dash_data.fund?.fund_id}
|
|
263
|
+
onEditFund={(f) => {
|
|
264
|
+
setEditingFund(f)
|
|
265
|
+
}}
|
|
266
|
+
onCreateFund={(f) => {
|
|
267
|
+
setDashData({
|
|
268
|
+
...dash_data,
|
|
269
|
+
fund:f
|
|
270
|
+
})
|
|
271
|
+
setEditingFund(f);
|
|
272
|
+
}}
|
|
273
|
+
onSelectFund={(f) => handleSelectFund(f)}
|
|
274
|
+
/>
|
|
275
|
+
</View>
|
|
276
|
+
|
|
277
|
+
)
|
|
278
|
+
case 'contests':
|
|
279
|
+
return (
|
|
280
|
+
<View style={{ margin:5 }}>
|
|
281
|
+
<ContestSelector
|
|
282
|
+
maxHeight={300}
|
|
283
|
+
leagues={leagues.filter(l => l.status == 'active')}
|
|
284
|
+
events={events}
|
|
285
|
+
onSelectEvent={(e) => handleSelectEvent(e)}
|
|
286
|
+
onDeselectEvent={(e) => handleDeselectEvent(e)}
|
|
287
|
+
onSelectMatch={(m) => console.log(m)}
|
|
288
|
+
onSelectTournament={(t) => console.log(t)}
|
|
289
|
+
tournaments={[]}
|
|
290
|
+
matches={[]}
|
|
291
|
+
selected_events={selected_events.map(e => e.event_id)}
|
|
292
|
+
selected_matches={[]}
|
|
293
|
+
selected_tournaments={[]}
|
|
294
|
+
/>
|
|
295
|
+
</View>
|
|
296
|
+
)
|
|
297
|
+
case 'markets':
|
|
298
|
+
return (
|
|
299
|
+
<View style={{ margin:5 }}>
|
|
300
|
+
<MarketSelector
|
|
301
|
+
markets={selectable_markets.sort((a,b) => parseInt(a.market_id) - parseInt(b.market_id))}
|
|
302
|
+
onSelectMarket={(m) => setDashData({ ...dash_data, selected_markets: dash_data.selected_markets.concat(m) })}
|
|
303
|
+
onDeselectMarket={(m) => setDashData({ ...dash_data, selected_markets: dash_data.selected_markets.filter(se => se.market_id != m.market_id) })}
|
|
304
|
+
selected_markets={selected_markets.map(m => m.market_id)}
|
|
305
|
+
/>
|
|
306
|
+
</View>
|
|
307
|
+
|
|
308
|
+
)
|
|
309
|
+
case 'fund_owners':
|
|
310
|
+
if(!fund){ return <></> }
|
|
311
|
+
return (
|
|
312
|
+
<View style={{ margin:5 }}>
|
|
313
|
+
<FundOwnershipList
|
|
314
|
+
fund_ownerships={fund_ownerships}
|
|
315
|
+
players={players}
|
|
316
|
+
/>
|
|
317
|
+
</View>
|
|
246
318
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
<
|
|
252
|
-
funds={funds}
|
|
253
|
-
maxHeight={300}
|
|
254
|
-
selected_fund_id={dash_data.fund?.fund_id}
|
|
255
|
-
onEditFund={(f) => {
|
|
256
|
-
setEditingFund(f)
|
|
257
|
-
}}
|
|
258
|
-
onCreateFund={(f) => {
|
|
259
|
-
setDashData({
|
|
260
|
-
...dash_data,
|
|
261
|
-
fund:f
|
|
262
|
-
})
|
|
263
|
-
setEditingFund(f);
|
|
264
|
-
}}
|
|
265
|
-
onSelectFund={(f) => {
|
|
266
|
-
setDashData({
|
|
267
|
-
...dash_data,
|
|
268
|
-
fund:f
|
|
269
|
-
})
|
|
270
|
-
}}
|
|
271
|
-
/>
|
|
272
|
-
{fund ?
|
|
273
|
-
<FundOwnershipList
|
|
274
|
-
fund_ownerships={fund_ownerships}
|
|
275
|
-
players={players}
|
|
276
|
-
/>
|
|
277
|
-
:<></>}
|
|
278
|
-
{fund?
|
|
319
|
+
)
|
|
320
|
+
case 'fund_requests':
|
|
321
|
+
if(!fund){ return <></> }
|
|
322
|
+
return (
|
|
323
|
+
<View style={{ margin:5 }}>
|
|
279
324
|
<FundingRequestList
|
|
280
325
|
funding_requests={funding_requests}
|
|
281
326
|
players={players}
|
|
@@ -298,30 +343,11 @@ const MarketMaker = ({ player_id, access_token, distinct_id }:MarketMakerProps)
|
|
|
298
343
|
})
|
|
299
344
|
}}
|
|
300
345
|
/>
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
onSelectEvent={(e) => handleSelectEvent(e)}
|
|
307
|
-
onDeselectEvent={(e) => handleDeselectEvent(e)}
|
|
308
|
-
onSelectMatch={(m) => console.log(m)}
|
|
309
|
-
onSelectTournament={(t) => console.log(t)}
|
|
310
|
-
tournaments={[]}
|
|
311
|
-
matches={[]}
|
|
312
|
-
selected_events={selected_events.map(e => e.event_id)}
|
|
313
|
-
selected_matches={[]}
|
|
314
|
-
selected_tournaments={[]}
|
|
315
|
-
/>
|
|
316
|
-
<MarketSelector
|
|
317
|
-
maxHeight={300}
|
|
318
|
-
markets={selectable_markets.sort((a,b) => parseInt(a.market_id) - parseInt(b.market_id))}
|
|
319
|
-
onSelectMarket={(m) => setDashData({ ...dash_data, selected_markets: dash_data.selected_markets.concat(m) })}
|
|
320
|
-
onDeselectMarket={(m) => setDashData({ ...dash_data, selected_markets: dash_data.selected_markets.filter(se => se.market_id != m.market_id) })}
|
|
321
|
-
selected_markets={selected_markets.map(m => m.market_id)}
|
|
322
|
-
/>
|
|
323
|
-
</View>
|
|
324
|
-
<View style={{ flexGrow:1, flexShrink:1}}>
|
|
346
|
+
</View>
|
|
347
|
+
)
|
|
348
|
+
case 'dashboard':
|
|
349
|
+
return (
|
|
350
|
+
<View style={{ margin:5 }}>
|
|
325
351
|
<Dashboard
|
|
326
352
|
loaded={dash_data.loaded}
|
|
327
353
|
leagues={leagues}
|
|
@@ -392,30 +418,62 @@ const MarketMaker = ({ player_id, access_token, distinct_id }:MarketMakerProps)
|
|
|
392
418
|
})
|
|
393
419
|
}}
|
|
394
420
|
/>
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
421
|
+
</View>
|
|
422
|
+
)
|
|
423
|
+
default: return <></>
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
return (
|
|
428
|
+
<View style={{ flex:1 }}>
|
|
429
|
+
<View style={{ flexDirection:'row' }}>
|
|
430
|
+
<View style={{ flex:1 }}>
|
|
431
|
+
<FlatList
|
|
432
|
+
data={contest_sections}
|
|
433
|
+
key={'contest_sections'}
|
|
434
|
+
keyExtractor={item => item}
|
|
435
|
+
renderItem={renderSections}
|
|
436
|
+
/>
|
|
437
|
+
</View>
|
|
438
|
+
<View style={{ flex:3 }}>
|
|
439
|
+
<FlatList
|
|
440
|
+
data={dashboard_sections}
|
|
441
|
+
key={'dashboard_sections'}
|
|
442
|
+
keyExtractor={item => item}
|
|
443
|
+
renderItem={renderSections}
|
|
444
|
+
/>
|
|
445
|
+
</View>
|
|
446
|
+
</View>
|
|
447
|
+
<Modal
|
|
448
|
+
visible={editing_fund ? true : false}
|
|
449
|
+
transparent
|
|
450
|
+
style={{ flex:1 }}
|
|
451
|
+
>
|
|
452
|
+
<View type='blur' style={{ flex:1, justifyContent:'center', alignItems:'center' }}>
|
|
453
|
+
<View style={{ width:500 }}>
|
|
454
|
+
<ManageFundForm
|
|
455
|
+
fund={editing_fund}
|
|
456
|
+
onClose={() => setEditingFund(undefined)}
|
|
457
|
+
onFundUpdate={(f) => {
|
|
458
|
+
setEditingFund(undefined);
|
|
406
459
|
setDashData({
|
|
407
460
|
...dash_data,
|
|
408
|
-
|
|
409
|
-
orders:orders.concat(new_orders.orders)
|
|
461
|
+
fund: f
|
|
410
462
|
})
|
|
411
|
-
setDraftOrder({ visible:false });
|
|
412
463
|
}}
|
|
413
|
-
|
|
414
464
|
/>
|
|
415
465
|
</View>
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
466
|
+
</View>
|
|
467
|
+
</Modal>
|
|
468
|
+
|
|
469
|
+
<Modal
|
|
470
|
+
visible={fund && set_market_form_visible && set_market_market ? true : false}
|
|
471
|
+
style={{ flex:1 }}
|
|
472
|
+
transparent
|
|
473
|
+
>
|
|
474
|
+
<View type='blur' style={{ flex:1, justifyContent:'center', alignItems:'center' }}>
|
|
475
|
+
<View style={{ width:500 }}>
|
|
476
|
+
{fund && set_market_market ?
|
|
419
477
|
<SetMarketForm
|
|
420
478
|
fund={fund}
|
|
421
479
|
form_key={set_market_form_key}
|
|
@@ -436,25 +494,39 @@ const MarketMaker = ({ player_id, access_token, distinct_id }:MarketMakerProps)
|
|
|
436
494
|
}}
|
|
437
495
|
onClose={() => setMarketFormData({ set_market_form_visible: false, set_market_orders:[], set_market_form_key:'', set_market_prices:[] })}
|
|
438
496
|
/>
|
|
497
|
+
:<></>}
|
|
439
498
|
</View>
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
499
|
+
</View>
|
|
500
|
+
</Modal>
|
|
501
|
+
<Modal
|
|
502
|
+
visible={draft_order.order ? true : false}
|
|
503
|
+
style={{ flex:1 }}
|
|
504
|
+
transparent
|
|
505
|
+
>
|
|
506
|
+
<View type='blur' style={{ flex:1, justifyContent:'center', alignItems:'center' }}>
|
|
507
|
+
<View style={{ width:500 }}>
|
|
508
|
+
{fund ?
|
|
509
|
+
<OrderForm
|
|
510
|
+
fund={fund}
|
|
511
|
+
order={draft_order.order}
|
|
512
|
+
available={draft_order.available}
|
|
513
|
+
onClose={() => setDraftOrder({ visible:false })}
|
|
514
|
+
onSubmit={async(order) => {
|
|
515
|
+
if(!fund){ return alert('Unable to process') }
|
|
516
|
+
if(!location.region || !location.coordinates){ return alert('Location could not be verified to process orders') }
|
|
517
|
+
const new_orders = await MarketMakerApi.addOrdersToFund(fund.fund_id, [{ ...order, location: location.coordinates, region: location.region }]);
|
|
448
518
|
setDashData({
|
|
449
519
|
...dash_data,
|
|
450
|
-
|
|
520
|
+
fund_orders: fund_orders.concat(new_orders.fund_orders),
|
|
521
|
+
orders:orders.concat(new_orders.orders)
|
|
451
522
|
})
|
|
523
|
+
setDraftOrder({ visible:false });
|
|
452
524
|
}}
|
|
453
525
|
/>
|
|
526
|
+
:<></>}
|
|
454
527
|
</View>
|
|
455
|
-
:<></>}
|
|
456
528
|
</View>
|
|
457
|
-
</
|
|
529
|
+
</Modal>
|
|
458
530
|
<SocketManager
|
|
459
531
|
subscribed_events={['V1_LOAD_BEST_AVAILABLE', 'V1_UPDATE_FUND']}
|
|
460
532
|
access_token={access_token}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Image
|
|
2
|
+
import { Image} from 'react-native';
|
|
3
3
|
import type { PollCampaignProps } from '../../types';
|
|
4
|
-
import { Icons
|
|
5
|
-
import
|
|
4
|
+
import { Icons } from '../../Components';
|
|
5
|
+
import { Button, Text, View } from '../../Components/Themed';
|
|
6
|
+
import { useColors } from '../../constants/useColors';
|
|
6
7
|
|
|
7
8
|
type CampaignHeaderProps = {
|
|
8
9
|
poll_campaign:PollCampaignProps,
|
|
@@ -10,23 +11,23 @@ type CampaignHeaderProps = {
|
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
const CampaignHeader = ({ poll_campaign, onSharePollCampaign }:CampaignHeaderProps) => {
|
|
13
|
-
|
|
14
|
+
const Colors = useColors();
|
|
14
15
|
return (
|
|
15
16
|
<View>
|
|
16
|
-
<View nativeID="competition_header" style={{ flexDirection:'row', alignItems:'center', padding:20, borderBottomWidth:1
|
|
17
|
-
<View>
|
|
17
|
+
<View type='header' nativeID="competition_header" style={{ flexDirection:'row', alignItems:'center', padding:20, borderBottomWidth:1 }}>
|
|
18
|
+
<View transparent>
|
|
18
19
|
<Image
|
|
19
20
|
source={{ uri: poll_campaign.campaign_image?.url ?? 'https://res.cloudinary.com/hoabts6mc/image/upload/v1649737862/be_logo_jte2ux.webp' }}
|
|
20
|
-
style={{ height:50, width:50, borderRadius:4 }}
|
|
21
|
+
style={{ height:50, width:50, borderRadius:4, backgroundColor:Colors.text.white, padding:5 }}
|
|
21
22
|
resizeMode="cover"
|
|
22
23
|
/>
|
|
23
24
|
</View>
|
|
24
|
-
<View style={{ flex:1, marginLeft:10 }}>
|
|
25
|
-
<Text theme='
|
|
25
|
+
<View transparent style={{ flex:1, marginLeft:10, marginRight:10 }}>
|
|
26
|
+
<Text theme='h1'>{poll_campaign.name}</Text>
|
|
26
27
|
</View>
|
|
27
|
-
<
|
|
28
|
-
<Icons.ShareIcon color={Colors.
|
|
29
|
-
</
|
|
28
|
+
<Button onPress={() => onSharePollCampaign(poll_campaign)}>
|
|
29
|
+
<Icons.ShareIcon color={Colors.text.h1} size={14} />
|
|
30
|
+
</Button>
|
|
30
31
|
</View>
|
|
31
32
|
</View>
|
|
32
33
|
)
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Image, FlatList, ActivityIndicator } from "react-native"
|
|
3
3
|
import type { PollCampaignLeaderProps, PollCampaignProps, PublicPlayerProps } from '../../types';
|
|
4
4
|
import { PollCampaignApi } from '../api';
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
5
|
+
import { Icons } from '../../Components';
|
|
6
|
+
import { useColors } from '../../constants/useColors';
|
|
7
|
+
import { Button, Text, View } from '../../Components/Themed';
|
|
8
|
+
import Pagination from '../../Components/Pagination';
|
|
8
9
|
|
|
9
10
|
type CampaignLeaderboardProps = {
|
|
10
11
|
poll_campaign:PollCampaignProps,
|
|
11
12
|
view_mode: "short"|"full",
|
|
12
|
-
height?:number,
|
|
13
13
|
onShowFullLeaderboard?: () => void,
|
|
14
14
|
onClose?:() => void
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
const CampaignLeaderboard = ({ poll_campaign,
|
|
17
|
+
const CampaignLeaderboard = ({ poll_campaign, view_mode, onShowFullLeaderboard, onClose }:CampaignLeaderboardProps) => {
|
|
18
|
+
const Colors = useColors();
|
|
18
19
|
const [ leaderboard_data, setLeaderData ] = useState<{
|
|
19
20
|
loading:boolean,
|
|
20
21
|
offset:number,
|
|
@@ -60,9 +61,9 @@ const CampaignLeaderboard = ({ poll_campaign, height, view_mode, onShowFullLeade
|
|
|
60
61
|
|
|
61
62
|
const renderTrophy = (place:number) => {
|
|
62
63
|
switch(place){
|
|
63
|
-
case 1: return <Icons.TrophyIcon color={Colors.
|
|
64
|
-
case 2: return <Icons.TrophyIcon color={Colors.
|
|
65
|
-
case 3: return <Icons.TrophyIcon color={Colors.
|
|
64
|
+
case 1: return <Icons.TrophyIcon color={Colors.text.gold} size={16}/>
|
|
65
|
+
case 2: return <Icons.TrophyIcon color={Colors.text.silver} size={16}/>
|
|
66
|
+
case 3: return <Icons.TrophyIcon color={Colors.text.bronze} size={16}/>
|
|
66
67
|
default: return <></>
|
|
67
68
|
}
|
|
68
69
|
}
|
|
@@ -72,11 +73,11 @@ const CampaignLeaderboard = ({ poll_campaign, height, view_mode, onShowFullLeade
|
|
|
72
73
|
const player = players.find(p => p.player_id == data.item.player_id);
|
|
73
74
|
if(!player){ return <></> }
|
|
74
75
|
return (
|
|
75
|
-
<View style={{ flexDirection:'row', alignItems:'center', margin:4, padding:5, borderRadius:22
|
|
76
|
-
<View nativeID="place" style={{ margin:5, height:20, width:20, justifyContent:'center', alignItems:'center', borderRadius:100, borderWidth:1
|
|
77
|
-
<Text size={10} color={Colors.
|
|
76
|
+
<View float style={{ flexDirection:'row', alignItems:'center', margin:4, padding:5, borderRadius:22 }}>
|
|
77
|
+
<View transparent nativeID="place" style={{ margin:5, height:20, width:20, justifyContent:'center', alignItems:'center', borderRadius:100, borderWidth:1 }}>
|
|
78
|
+
<Text size={10} color={Colors.text.h1} weight='bold' textAlign="center">{offset > 0 ? offset:''}{data.index+1}</Text>
|
|
78
79
|
</View>
|
|
79
|
-
<View nativeID="player" style={{ flex:1, flexDirection:'row', alignItems:'center' }}>
|
|
80
|
+
<View transparent nativeID="player" style={{ flex:1, flexDirection:'row', alignItems:'center' }}>
|
|
80
81
|
<View nativeID="profile_pic" style={{ marginRight:10 }}>
|
|
81
82
|
<Image
|
|
82
83
|
source={{ uri: player.profile_pic && player.profile_pic != '' ? player.profile_pic : 'https://res.cloudinary.com/hoabts6mc/image/upload/v1689262384/default-avatar_bbkn2t.png' }}
|
|
@@ -84,11 +85,11 @@ const CampaignLeaderboard = ({ poll_campaign, height, view_mode, onShowFullLeade
|
|
|
84
85
|
resizeMode='cover'
|
|
85
86
|
/>
|
|
86
87
|
</View>
|
|
87
|
-
<View style={{ flex:1 }} nativeID="name">
|
|
88
|
-
<Text size={14} color={Colors.
|
|
89
|
-
<Text style={{ marginTop:3 }} size={12} color={Colors.
|
|
88
|
+
<View transparent style={{ flex:1 }} nativeID="name">
|
|
89
|
+
<Text size={14} color={Colors.text.h1} weight='bold'>{player.username}</Text>
|
|
90
|
+
<Text style={{ marginTop:3 }} size={12} color={Colors.text.h1} weight='regular'>{data.item.winnings.toFixed(2)} Points</Text>
|
|
90
91
|
</View>
|
|
91
|
-
<View>
|
|
92
|
+
<View float style={{ padding:5, borderRadius:100 }}>
|
|
92
93
|
{renderTrophy(data.index+1)}
|
|
93
94
|
</View>
|
|
94
95
|
</View>
|
|
@@ -97,77 +98,65 @@ const CampaignLeaderboard = ({ poll_campaign, height, view_mode, onShowFullLeade
|
|
|
97
98
|
}
|
|
98
99
|
|
|
99
100
|
return (
|
|
100
|
-
<View style={{ flex:1
|
|
101
|
+
<View style={{ flex:1}}>
|
|
101
102
|
{my_leader && me ?
|
|
102
|
-
<View nativeID="my_results" style={{
|
|
103
|
-
<Text style={{ padding:10 }} size={14}
|
|
104
|
-
<View style={{ flexDirection:'row', alignItems:'center', margin:4, padding:5, borderRadius:22
|
|
105
|
-
<View nativeID="player" style={{ flex:1, flexDirection:'row', alignItems:'center' }}>
|
|
106
|
-
<View nativeID="profile_pic" style={{ marginRight:10 }}>
|
|
103
|
+
<View type='header' nativeID="my_results" style={{ padding:10 }}>
|
|
104
|
+
<Text style={{ padding:10 }} size={14} theme='h1' weight='bold'>My Results</Text>
|
|
105
|
+
<View float style={{ flexDirection:'row', alignItems:'center', margin:4, padding:5, borderRadius:22 }}>
|
|
106
|
+
<View transparent nativeID="player" style={{ flex:1, flexDirection:'row', alignItems:'center' }}>
|
|
107
|
+
<View transparent nativeID="profile_pic" style={{ marginRight:10 }}>
|
|
107
108
|
<Image
|
|
108
109
|
source={{ uri: me.profile_pic && me.profile_pic != '' ? me.profile_pic : 'https://res.cloudinary.com/hoabts6mc/image/upload/v1689262384/default-avatar_bbkn2t.png' }}
|
|
109
110
|
style={{ height:35, width:35, borderRadius:100 }}
|
|
110
111
|
resizeMode='cover'
|
|
111
112
|
/>
|
|
112
113
|
</View>
|
|
113
|
-
<View style={{ flex:1 }} nativeID="name">
|
|
114
|
-
<Text size={14}
|
|
115
|
-
<Text style={{ marginTop:3 }} size={12}
|
|
114
|
+
<View transparent style={{ flex:1 }} nativeID="name">
|
|
115
|
+
<Text size={14} theme='h1' weight='bold'>{me.username}</Text>
|
|
116
|
+
<Text style={{ marginTop:3 }} size={12} theme='description' weight='regular'>{my_leader.winnings.toFixed(2)} Points</Text>
|
|
116
117
|
</View>
|
|
117
|
-
<View>
|
|
118
|
+
<View float style={{ padding:5, borderRadius:100 }}>
|
|
118
119
|
{renderTrophy(my_leader.place)}
|
|
119
120
|
</View>
|
|
120
121
|
</View>
|
|
121
122
|
</View>
|
|
122
123
|
</View>
|
|
123
124
|
:<></>}
|
|
124
|
-
<
|
|
125
|
+
<View style={{flex:1, padding:15 }}>
|
|
125
126
|
{loading ?
|
|
126
|
-
|
|
127
|
+
<ActivityIndicator size='large' color={Colors.text.h1} style={{ padding:20, alignSelf:'center' }} />
|
|
127
128
|
:<></>}
|
|
128
129
|
<FlatList
|
|
129
130
|
data={filtered_leaders}
|
|
130
131
|
renderItem={renderLeaders}
|
|
131
132
|
keyExtractor={((item) => item.player_id.toString())}
|
|
132
133
|
/>
|
|
133
|
-
</
|
|
134
|
+
</View>
|
|
134
135
|
{view_mode == 'full' ?
|
|
135
|
-
<View
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
backgroundColor='transparent'
|
|
141
|
-
onPress={() => getDataFromServer(offset - 1)}
|
|
142
|
-
/>
|
|
143
|
-
:<></>}
|
|
144
|
-
<View style={{flex:1}} />
|
|
145
|
-
<Button
|
|
146
|
-
title='NEXT'
|
|
147
|
-
title_color={Colors.brand.electric}
|
|
148
|
-
backgroundColor='transparent'
|
|
149
|
-
onPress={() => getDataFromServer(offset + 1)}
|
|
136
|
+
<View>
|
|
137
|
+
<Pagination
|
|
138
|
+
offset={offset}
|
|
139
|
+
onNext={() => getDataFromServer(offset + 1)}
|
|
140
|
+
onPrevious={() => getDataFromServer(offset - 1)}
|
|
150
141
|
/>
|
|
151
142
|
</View>
|
|
152
143
|
:<></>}
|
|
153
144
|
{view_mode == 'short' && onShowFullLeaderboard ?
|
|
154
|
-
<View style={{
|
|
145
|
+
<View type='footer' style={{ flexDirection:'row', padding:10 }}>
|
|
155
146
|
<Button
|
|
156
147
|
title='See Full Leaderboard'
|
|
157
|
-
style={{ flex:1, alignSelf:'center' }}
|
|
158
|
-
|
|
159
|
-
backgroundColor='transparent'
|
|
148
|
+
style={{ flex:1, alignSelf:'center', padding:0 }}
|
|
149
|
+
type='text'
|
|
160
150
|
onPress={() => onShowFullLeaderboard()}
|
|
161
151
|
/>
|
|
162
152
|
</View>
|
|
163
153
|
:<></>}
|
|
164
154
|
{onClose ?
|
|
165
|
-
<View style={{
|
|
155
|
+
<View type='footer' style={{ flexDirection:'row', padding:10 }}>
|
|
166
156
|
<Button
|
|
167
157
|
title='CLOSE'
|
|
168
158
|
style={{ flex:1 }}
|
|
169
|
-
|
|
170
|
-
backgroundColor={Colors.utility.error}
|
|
159
|
+
type='close'
|
|
171
160
|
onPress={() => onClose()}
|
|
172
161
|
/>
|
|
173
162
|
</View>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { FlatList
|
|
1
|
+
import { FlatList } from "react-native"
|
|
2
2
|
import React, { useState } from "react"
|
|
3
3
|
import type { PollCampaignProps, PollProps, PollResponseProps } from '../../types';
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
4
|
+
import { Icons } from '../../Components';
|
|
5
|
+
import { useColors } from "../../constants/useColors";
|
|
6
|
+
import { Button, Text, View } from "../../Components/Themed";
|
|
6
7
|
|
|
7
8
|
type CampaignProgressBarProps = {
|
|
8
9
|
poll_campaign:PollCampaignProps,
|
|
@@ -13,25 +14,26 @@ type CampaignProgressBarProps = {
|
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
const CampaignProgressBar = ({ poll_responses, active_poll, polls, onPollSelect}:CampaignProgressBarProps) => {
|
|
17
|
+
const Colors = useColors();
|
|
16
18
|
const [ progress_width, setProgressWidth ] = useState(0)
|
|
17
19
|
const getBarColor = (pr:PollResponseProps) => {
|
|
18
20
|
switch(pr.result_ind){
|
|
19
|
-
case 'win': return Colors.
|
|
20
|
-
case 'lose': return Colors.
|
|
21
|
-
default: return Colors.
|
|
21
|
+
case 'win': return Colors.text.success
|
|
22
|
+
case 'lose': return Colors.text.error
|
|
23
|
+
default: return Colors.text.warning
|
|
22
24
|
}
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
const renderProgress = (data: {item: PollProps, index:number }) => {
|
|
26
28
|
let width = progress_width / polls.length
|
|
27
|
-
let color = Colors.
|
|
29
|
+
let color = Colors.text.white
|
|
28
30
|
let response = poll_responses.find(pr => pr.poll_id == data.item.poll_id)
|
|
29
31
|
if(response){ color = getBarColor(response) }
|
|
30
32
|
const active = active_poll == data.item.poll_id ? true : false
|
|
31
33
|
return (
|
|
32
|
-
<
|
|
34
|
+
<Button
|
|
33
35
|
onPress={() => onPollSelect(data.item)}
|
|
34
|
-
style={{ margin:2, borderWidth:active?2:0, borderColor:Colors.brand.midnight, borderRadius:4, height:20, width: width - 4, backgroundColor:color }}
|
|
36
|
+
style={{ margin:2, borderWidth:active?2:0, padding:0, borderColor:Colors.absolutes.brand.midnight, borderRadius:4, height:20, width: width - 4, backgroundColor:color }}
|
|
35
37
|
/>
|
|
36
38
|
)
|
|
37
39
|
}
|
|
@@ -41,9 +43,9 @@ const CampaignProgressBar = ({ poll_responses, active_poll, polls, onPollSelect}
|
|
|
41
43
|
|
|
42
44
|
return (
|
|
43
45
|
<View style={{ flexDirection:'row', alignItems:'center' }}>
|
|
44
|
-
<View nativeID="questions_answered" style={{ flexDirection:'row', alignItems:'center', margin:5, borderRadius:4,
|
|
45
|
-
<Icons.UserIcon color={Colors.
|
|
46
|
-
<Text style={{ marginLeft:5 }} size={12} color={Colors.
|
|
46
|
+
<View nativeID="questions_answered" style={{ flexDirection:'row', alignItems:'center', margin:5, borderRadius:4, padding:5 }}>
|
|
47
|
+
<Icons.UserIcon color={Colors.text.h1} size={12} />
|
|
48
|
+
<Text style={{ marginLeft:5 }} size={12} color={Colors.text.h1} weight='semibold'>{questions_answered}</Text>
|
|
47
49
|
</View>
|
|
48
50
|
<View nativeID="progress_bar" style={{ flex:1 }} onLayout={(ev) => {
|
|
49
51
|
const { width } = ev.nativeEvent.layout;
|
|
@@ -56,9 +58,9 @@ const CampaignProgressBar = ({ poll_responses, active_poll, polls, onPollSelect}
|
|
|
56
58
|
renderItem={renderProgress}
|
|
57
59
|
/>
|
|
58
60
|
</View>
|
|
59
|
-
<View nativeID="questions_answered" style={{ flexDirection:'row', alignItems:'center', margin:5, borderRadius:4, backgroundColor:Colors.
|
|
60
|
-
<Icons.ListIcon color={Colors.
|
|
61
|
-
<Text style={{ marginLeft:5 }} size={12} color={Colors.
|
|
61
|
+
<View nativeID="questions_answered" style={{ flexDirection:'row', alignItems:'center', margin:5, borderRadius:4, backgroundColor:Colors.text.warning, padding:5 }}>
|
|
62
|
+
<Icons.ListIcon color={Colors.text.white} size={12} />
|
|
63
|
+
<Text style={{ marginLeft:5 }} size={12} color={Colors.text.white} weight='semibold'>{questions_unanswered}</Text>
|
|
62
64
|
</View>
|
|
63
65
|
</View>
|
|
64
66
|
)
|