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,10 +1,9 @@
|
|
|
1
|
-
import { TouchableOpacity, View } from "react-native"
|
|
2
1
|
import React, { useState } from "react"
|
|
3
2
|
import type { PollCampaignProps } from "../../types"
|
|
4
|
-
import { Icons
|
|
5
|
-
import Colors from '../../constants/colors';
|
|
6
|
-
import { view_styles } from "../../constants/styles"
|
|
3
|
+
import { Icons } from "../../Components"
|
|
7
4
|
import CampaignLeaderboard from "./CampaignLeaderboard"
|
|
5
|
+
import { Button, Text, View } from "../../Components/Themed"
|
|
6
|
+
import { useColors } from "../../constants/useColors"
|
|
8
7
|
|
|
9
8
|
type CampaignResultProps = {
|
|
10
9
|
poll_campaign:PollCampaignProps,
|
|
@@ -13,19 +12,20 @@ type CampaignResultProps = {
|
|
|
13
12
|
|
|
14
13
|
const CampaignResult = ({ poll_campaign, onShowFullLeaderboard } : CampaignResultProps) => {
|
|
15
14
|
const [ expanded, setExpanded ] = useState(false);
|
|
15
|
+
const Colors = useColors();
|
|
16
16
|
|
|
17
17
|
return (
|
|
18
|
-
<View style={{ flex:1
|
|
19
|
-
<
|
|
20
|
-
<Icons.PodiumIcon size={18} color={Colors.
|
|
21
|
-
<View style={{flex:1, marginLeft:10}}>
|
|
22
|
-
<Text theme="
|
|
23
|
-
<Text style={{ marginTop:3 }} theme="
|
|
18
|
+
<View float style={{ flex:1 }}>
|
|
19
|
+
<Button style={{ flexDirection:'row', alignItems:'center', padding:20, backgroundColor:Colors.views.header }} onPress={() => setExpanded(!expanded)}>
|
|
20
|
+
<Icons.PodiumIcon size={18} color={Colors.text.h1} />
|
|
21
|
+
<View transparent style={{flex:1, marginLeft:10}}>
|
|
22
|
+
<Text theme="h1">Leaderboard</Text>
|
|
23
|
+
<Text style={{ marginTop:3 }} theme="description">Below are the leaderboard results!</Text>
|
|
24
24
|
</View>
|
|
25
|
-
<Icons.ChevronIcon size={8} color={Colors.
|
|
26
|
-
</
|
|
25
|
+
<Icons.ChevronIcon size={8} color={Colors.text.h1} direction={expanded ? 'up' : 'down'} />
|
|
26
|
+
</Button>
|
|
27
27
|
{expanded ?
|
|
28
|
-
<View style={{
|
|
28
|
+
<View style={{ padding:0 }}>
|
|
29
29
|
<CampaignLeaderboard
|
|
30
30
|
view_mode="short"
|
|
31
31
|
poll_campaign={poll_campaign}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { FlatList, Image
|
|
1
|
+
import { ActivityIndicator, FlatList, Image } from 'react-native';
|
|
2
2
|
import React, { useEffect, useState } from 'react';
|
|
3
3
|
import PollOptionCard from './PollOptionCard';
|
|
4
4
|
import ResponseTimer from './ResponseTimer';
|
|
5
5
|
import type { PollOptionProps, PollProps, PollResponseProps, PollSummaryProps } from '../../types';
|
|
6
6
|
import { PollApi } from '../api';
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
7
|
+
import { Icons } from '../../Components';
|
|
8
|
+
import { useColors } from '../../constants/useColors';
|
|
9
|
+
import { Button, Text, View } from '../../Components/Themed';
|
|
10
10
|
|
|
11
11
|
type PollCardProps = {
|
|
12
|
-
poll_id
|
|
12
|
+
poll_id?:string,
|
|
13
13
|
poll_response?:PollResponseProps,
|
|
14
14
|
action_loading?:boolean,
|
|
15
|
+
width:number,
|
|
15
16
|
question_number?:number,
|
|
16
17
|
view?:string,
|
|
17
18
|
total_questions?:number,
|
|
@@ -20,9 +21,9 @@ type PollCardProps = {
|
|
|
20
21
|
onCancel:() => void,
|
|
21
22
|
onSkip: () => void
|
|
22
23
|
}
|
|
23
|
-
|
|
24
|
-
const PollCard = ({ poll_id, poll_response, action_loading, onSkip, onCancel, onResponse }: PollCardProps) => {
|
|
25
|
-
const
|
|
24
|
+
const sections = ['question','image','options','selected_option', 'correct_select', 'public_results']
|
|
25
|
+
const PollCard = ({ poll_id, width, poll_response, action_loading, onSkip, onCancel, onResponse }: PollCardProps) => {
|
|
26
|
+
const Colors = useColors();
|
|
26
27
|
const [ poll_data, setPollData ] = useState<{
|
|
27
28
|
poll?:PollProps,
|
|
28
29
|
loading:boolean,
|
|
@@ -38,6 +39,7 @@ const PollCard = ({ poll_id, poll_response, action_loading, onSkip, onCancel, on
|
|
|
38
39
|
const correct_option = poll_options.find(o => o.result_ind == 'win');
|
|
39
40
|
const responses = poll_summaries.reduce((a,b) => a + b.count, 0)
|
|
40
41
|
useEffect(() => {
|
|
42
|
+
if(!poll_id){ return }
|
|
41
43
|
getPollFromServer(poll_id)
|
|
42
44
|
},[poll_id])
|
|
43
45
|
|
|
@@ -144,111 +146,127 @@ const PollCard = ({ poll_id, poll_response, action_loading, onSkip, onCancel, on
|
|
|
144
146
|
)
|
|
145
147
|
}
|
|
146
148
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
<Text style={{ marginTop:5 }} theme='header'>{poll.poll_question}</Text>
|
|
158
|
-
</View>
|
|
159
|
-
</View>
|
|
160
|
-
<ScrollView style={{ flex:1 }}>
|
|
161
|
-
<View nativeID='question_image'>
|
|
162
|
-
{poll?.poll_image?.url ?
|
|
163
|
-
<Image
|
|
164
|
-
source={{ uri:poll.poll_image.url, width:poll_width, height: poll_width*0.5 }}
|
|
165
|
-
resizeMode='contain'
|
|
166
|
-
/>
|
|
167
|
-
:<></>}
|
|
168
|
-
</View>
|
|
169
|
-
|
|
170
|
-
{ poll.status == 'active' && !poll_response ?
|
|
171
|
-
<View nativeID='question_respond_options'>
|
|
172
|
-
<FlatList
|
|
173
|
-
data={poll_options.sort((a,b) => a.priority - b.priority)}
|
|
174
|
-
renderItem={renderPollOptions}
|
|
175
|
-
numColumns={2}
|
|
176
|
-
keyExtractor={(item) => item.poll_option_id.toString()}
|
|
177
|
-
/>
|
|
178
|
-
</View>
|
|
179
|
-
:
|
|
180
|
-
<View nativeID='question_answer' style={{ flex:1 }}>
|
|
181
|
-
{selected_option ?
|
|
182
|
-
<View nativeID='selected_option' style={{ marginBottom:10, padding:10 }}>
|
|
183
|
-
<Text style={{ marginBottom:5 }} size={14} color={Colors.brand.slate} weight='semibold'>MY SELECTED ANSWER</Text>
|
|
184
|
-
<PollOptionCard
|
|
185
|
-
show_result={true}
|
|
186
|
-
show_summary={false}
|
|
187
|
-
poll_response={poll_response}
|
|
188
|
-
onSelect={() => console.log('Hey')}
|
|
189
|
-
poll_option={selected_option}
|
|
190
|
-
/>
|
|
191
|
-
</View>
|
|
192
|
-
: (!poll_response || poll_response?.timed_out) ?
|
|
193
|
-
<View style={{ marginBottom:10, padding:10 }}>
|
|
194
|
-
<Text style={{ marginBottom:5 }} size={14} color={Colors.brand.slate} weight='semibold'>MY SELECTED ANSWER</Text>
|
|
195
|
-
<View style={{ flexDirection:'row', alignItems:'center', padding:10, borderRadius:22, borderWidth:1, borderColor:Colors.utility.error }}>
|
|
196
|
-
<Text style={{ flex:1 }} size={14} color={Colors.utility.error} textAlign='center' weight='semibold'>Timed Out</Text>
|
|
197
|
-
<Icons.CloseIcon color={Colors.utility.error} size={12}/>
|
|
149
|
+
const renderSections = (data:{ item:string, index:number }) => {
|
|
150
|
+
switch(data.item){
|
|
151
|
+
case 'question':
|
|
152
|
+
if(!poll){ return <></> }
|
|
153
|
+
return (
|
|
154
|
+
<View type='header' style={{ flexDirection:'row', alignItems:'center', padding:15, borderTopRightRadius:22, borderTopLeftRadius:22 }}>
|
|
155
|
+
<View transparent style={{ flex:1 }}>
|
|
156
|
+
<Text theme='h2'>Question {poll.priority}</Text>
|
|
157
|
+
<Text style={{ marginTop:5 }} theme='h1'>{poll.poll_question}</Text>
|
|
158
|
+
</View>
|
|
198
159
|
</View>
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
{
|
|
202
|
-
|
|
203
|
-
<
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
/>
|
|
210
|
-
</View>
|
|
211
|
-
:poll.poll_type == 'input' && poll.winning_value ?
|
|
212
|
-
<View style={{ marginBottom:10, padding:10 }}>
|
|
213
|
-
<Text style={{ marginBottom:5 }} size={14} color={Colors.brand.slate} weight='semibold'>CORRECT ANSWER</Text>
|
|
214
|
-
<View style={{ flexDirection:'row', alignItems:'center', padding:10, borderRadius:22, borderWidth:1, borderColor:Colors.utility.success }}>
|
|
215
|
-
<Text style={{ flex:1 }} size={14} color={Colors.utility.success} textAlign='center' weight='semibold'>{poll.winning_value}</Text>
|
|
216
|
-
<Icons.CheckIcon color={Colors.utility.success} size={12}/>
|
|
160
|
+
)
|
|
161
|
+
case 'image':
|
|
162
|
+
if(!poll?.poll_image?.url){ return <></> }
|
|
163
|
+
return (
|
|
164
|
+
<View nativeID='question_image'>
|
|
165
|
+
<Image
|
|
166
|
+
source={{ uri:poll.poll_image.url }}
|
|
167
|
+
style={{ width:width - 20, height:width/2}}
|
|
168
|
+
resizeMode='cover'
|
|
169
|
+
/>
|
|
217
170
|
</View>
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
<View style={{
|
|
223
|
-
<
|
|
224
|
-
|
|
225
|
-
|
|
171
|
+
)
|
|
172
|
+
case 'options':
|
|
173
|
+
if(!poll || poll.status != 'active' || poll_response){ return <></> }
|
|
174
|
+
return (
|
|
175
|
+
<View nativeID='question_respond_options' style={{ padding:12, maxHeight:550 }}>
|
|
176
|
+
<FlatList
|
|
177
|
+
data={poll_options.sort((a,b) => a.priority - b.priority)}
|
|
178
|
+
renderItem={renderPollOptions}
|
|
179
|
+
numColumns={2}
|
|
180
|
+
keyExtractor={(item) => item.poll_option_id.toString()}
|
|
181
|
+
/>
|
|
182
|
+
</View>
|
|
183
|
+
)
|
|
184
|
+
case 'selected_option':
|
|
185
|
+
if(!selected_option || !poll_response){ return <></> }
|
|
186
|
+
return (
|
|
187
|
+
<View nativeID='selected_option' style={{ marginBottom:10, padding:10 }}>
|
|
188
|
+
<Text style={{ marginBottom:5 }} size={14} theme='description'>MY SELECTED ANSWER</Text>
|
|
189
|
+
<PollOptionCard
|
|
190
|
+
show_result={true}
|
|
191
|
+
show_summary={false}
|
|
192
|
+
poll_response={poll_response}
|
|
193
|
+
onSelect={() => console.log('Hey')}
|
|
194
|
+
poll_option={selected_option}
|
|
195
|
+
/>
|
|
196
|
+
</View>
|
|
197
|
+
)
|
|
198
|
+
case 'correct_select':
|
|
199
|
+
if(!poll || poll.poll_type != 'select' || !correct_option){ return <></> }
|
|
200
|
+
return (
|
|
201
|
+
<View nativeID='selected_option' style={{ marginBottom:10, padding:10 }}>
|
|
202
|
+
<Text style={{ marginBottom:5 }} size={14} theme='description' weight='semibold'>CORRECT ANSWER</Text>
|
|
203
|
+
<PollOptionCard
|
|
204
|
+
show_summary={true}
|
|
205
|
+
show_result={true}
|
|
206
|
+
onSelect={() => console.log('')}
|
|
207
|
+
poll_option={correct_option}
|
|
208
|
+
/>
|
|
209
|
+
</View>
|
|
210
|
+
)
|
|
211
|
+
case 'correct_input':
|
|
212
|
+
if(!poll || poll.poll_type != 'input' || !poll.winning_value){ return <></> }
|
|
213
|
+
return (
|
|
214
|
+
<View style={{ marginBottom:10, padding:10 }}>
|
|
215
|
+
<Text style={{ marginBottom:5 }} size={14} theme='description' weight='semibold'>CORRECT ANSWER</Text>
|
|
216
|
+
<View style={{ flexDirection:'row', alignItems:'center', padding:10, borderRadius:22, borderWidth:1, borderColor:Colors.text.success }}>
|
|
217
|
+
<Text style={{ flex:1 }} size={14} color={Colors.text.success} textAlign='center' weight='semibold'>{poll.winning_value}</Text>
|
|
218
|
+
<Icons.CheckIcon color={Colors.text.success} size={12}/>
|
|
226
219
|
</View>
|
|
227
220
|
</View>
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
221
|
+
)
|
|
222
|
+
case 'public_results':
|
|
223
|
+
if(!poll || poll.poll_type != 'select' || !poll_response){ return <></> }
|
|
224
|
+
if(!poll.show_responses){ return <></> }
|
|
225
|
+
return (
|
|
226
|
+
<View nativeID='option_results' style={{ padding:10, borderRadius:8 }}>
|
|
227
|
+
<View style={{ flexDirection:'row', alignItems:'center', marginBottom:5 }}>
|
|
228
|
+
<Text style={{ flex:1 }} size={14} theme='description' weight='semibold'>PUBLIC RESULTS</Text>
|
|
229
|
+
<View style={{ borderRadius:22, padding:10 }}>
|
|
230
|
+
<Text size={14} theme='description'>{responses} Responses</Text>
|
|
231
|
+
</View>
|
|
232
|
+
</View>
|
|
233
|
+
{!poll.show_responses ?
|
|
234
|
+
<Text style={{ marginBottom:5 }} color={Colors.text.warning} size={12} >Responses are hidden until closed</Text>
|
|
235
|
+
:<></>}
|
|
236
|
+
<FlatList
|
|
237
|
+
data={poll_options}
|
|
238
|
+
renderItem={renderPollOptions}
|
|
239
|
+
keyExtractor={(item) => item.poll_option_id.toString()}
|
|
240
|
+
/>
|
|
241
|
+
</View>
|
|
242
|
+
)
|
|
243
|
+
default:return <></>
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
return (
|
|
248
|
+
<View float nativeID='poll' style={{ borderRadius:22 }}>
|
|
249
|
+
<View transparent style={{ flex:1 }}>
|
|
250
|
+
{loading || !poll ?
|
|
251
|
+
<ActivityIndicator style={{ padding:20, alignSelf:'center' }} color={Colors.text.h1} size='large' />
|
|
237
252
|
:<></>}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
253
|
+
<FlatList
|
|
254
|
+
data={sections}
|
|
255
|
+
key={'poll_question_sections'}
|
|
256
|
+
keyExtractor={item => item}
|
|
257
|
+
renderItem={renderSections}
|
|
258
|
+
/>
|
|
259
|
+
</View>
|
|
260
|
+
<View nativeID='question_actions' type='footer' style={{ flexDirection:'row', padding:12, borderBottomLeftRadius:22, borderBottomRightRadius:22 }}>
|
|
261
|
+
{poll && (!poll.seconds_allowed || poll_response) ?
|
|
262
|
+
<Button
|
|
263
|
+
style={{ marginRight:10, justifyContent:'center', padding:15, backgroundColor:Colors.text.warning, borderRadius:22, borderWidth:1, borderColor:Colors.text.warning }}
|
|
246
264
|
onPress={() => handleCancel()}
|
|
247
265
|
>
|
|
248
|
-
<Icons.ListIcon size={
|
|
249
|
-
</
|
|
266
|
+
<Icons.ListIcon size={16} color={Colors.text.white} />
|
|
267
|
+
</Button>
|
|
250
268
|
:<></>}
|
|
251
|
-
{poll.status == 'active' && poll.seconds_allowed && !poll_response ?
|
|
269
|
+
{poll &&poll.status == 'active' && poll.seconds_allowed && !poll_response ?
|
|
252
270
|
<View style={{ marginRight:5 }}>
|
|
253
271
|
<ResponseTimer
|
|
254
272
|
poll_id={poll.poll_id}
|
|
@@ -258,30 +276,23 @@ const PollCard = ({ poll_id, poll_response, action_loading, onSkip, onCancel, on
|
|
|
258
276
|
</View>
|
|
259
277
|
:
|
|
260
278
|
<Button
|
|
261
|
-
style={{flex:1, marginRight:5}}
|
|
262
|
-
|
|
279
|
+
style={{flex:1, marginRight:5, padding:15}}
|
|
280
|
+
type='action'
|
|
263
281
|
title={poll_response?'Next':'Skip'}
|
|
264
|
-
borderColor={Colors.brand.electric}
|
|
265
|
-
backgroundColor={Colors.shades.white}
|
|
266
|
-
borderRadius={22}
|
|
267
|
-
borderWidth={1}
|
|
268
|
-
padding={14}
|
|
269
282
|
onPress={() => handleSkip()}
|
|
270
283
|
/>
|
|
271
284
|
}
|
|
272
|
-
{!poll_response ?
|
|
285
|
+
{poll && !poll_response && !loading ?
|
|
273
286
|
<Button
|
|
274
|
-
style={{flex:2}}
|
|
275
|
-
|
|
287
|
+
style={{flex:2, padding:15, opacity: selected_option && !action_loading ? 1 : 0.5}}
|
|
288
|
+
loading={action_loading}
|
|
276
289
|
disabled={selected_option&&!action_loading?false:true}
|
|
290
|
+
type='success'
|
|
277
291
|
title={selected_option?`Submit!`:poll.status == 'active' ? 'Select Answer' : 'Not Active'}
|
|
278
|
-
backgroundColor={selected_option&&!action_loading?Colors.utility.success:Colors.brand.slate}
|
|
279
|
-
borderRadius={22}
|
|
280
292
|
onPress={() => handleSubmitResponse()}
|
|
281
293
|
/>
|
|
282
294
|
:<></>}
|
|
283
295
|
</View>
|
|
284
|
-
:<></>}
|
|
285
296
|
</View>
|
|
286
297
|
|
|
287
298
|
)
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
|
-
import { TextInput
|
|
2
|
+
import { TextInput } from "react-native"
|
|
3
3
|
import type { PollOptionProps, PollResponseProps, PollSummaryProps } 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 PollOptionCardProps = {
|
|
8
9
|
poll_option:PollOptionProps,
|
|
@@ -14,16 +15,17 @@ type PollOptionCardProps = {
|
|
|
14
15
|
onSelect: (PollOptionProps: PollOptionProps) => void
|
|
15
16
|
}
|
|
16
17
|
const PollOptionCard = ({ draft_selected, show_result, poll_option, poll_summary, show_summary, onSelect, poll_response } : PollOptionCardProps) => {
|
|
18
|
+
const Colors = useColors();
|
|
17
19
|
const [ option_width, setOptionWidth ] = useState(0);
|
|
18
20
|
const [ input_locked, setInputLocked ] = useState(false);
|
|
19
21
|
const [ input_value, setInputValue ] = useState('');
|
|
20
22
|
|
|
21
23
|
const getResultColor = (result_ind?:'win'|'lose'|'draw') => {
|
|
22
24
|
switch(result_ind){
|
|
23
|
-
case 'win': return Colors.
|
|
24
|
-
case 'lose': return Colors.
|
|
25
|
-
case 'draw': return Colors.
|
|
26
|
-
default: return Colors.
|
|
25
|
+
case 'win': return Colors.text.success
|
|
26
|
+
case 'lose': return Colors.text.error
|
|
27
|
+
case 'draw': return Colors.text.warning
|
|
28
|
+
default: return Colors.text.h1
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
|
|
@@ -41,39 +43,38 @@ const PollOptionCard = ({ draft_selected, show_result, poll_option, poll_summary
|
|
|
41
43
|
return (
|
|
42
44
|
<View>
|
|
43
45
|
{poll_option.option_type == 'select' ?
|
|
44
|
-
<
|
|
45
|
-
style={{ flex:1, flexDirection:'row', alignItems:'center', padding:10, borderRadius:22, borderWidth:1, borderColor:show_result?getResultColor(poll_option.result_ind):Colors.
|
|
46
|
+
<Button
|
|
47
|
+
style={{ flex:1, flexDirection:'row', alignItems:'center', padding:10, borderRadius:22, borderWidth:1, borderColor:show_result?getResultColor(poll_option.result_ind):Colors.borders.light, backgroundColor:draft_selected?Colors.absolutes.highlights.highlight500Faded:undefined }}
|
|
46
48
|
onPress={() => onSelect(poll_option)}
|
|
47
49
|
onLayout={(ev) => {
|
|
48
50
|
const { width } = ev.nativeEvent.layout
|
|
49
51
|
setOptionWidth(width)
|
|
50
52
|
}}
|
|
51
53
|
>
|
|
52
|
-
<Text style={{ flex:1 }} textAlign="center" size={14} color={show_result?getResultColor(poll_option.result_ind):Colors.
|
|
54
|
+
<Text style={{ flex:1 }} textAlign="center" size={14} color={show_result?getResultColor(poll_option.result_ind):Colors.text.h1} weight='bold'>{poll_option.option_name}</Text>
|
|
53
55
|
{show_result && poll_option.result_ind ?
|
|
54
|
-
<View>
|
|
56
|
+
<View transparent>
|
|
55
57
|
{getResultIcon(poll_option.result_ind)}
|
|
56
58
|
</View>
|
|
57
59
|
:<></>}
|
|
58
60
|
{show_summary && poll_summary?
|
|
59
|
-
<View style={{ position: 'absolute', left:0, top:0, bottom:0, width:poll_summary.pct*option_width, borderRadius:22, backgroundColor:Colors.highlights.highlight400Faded }} />
|
|
61
|
+
<View transparent style={{ position: 'absolute', left:0, top:0, bottom:0, width:poll_summary.pct*option_width, borderRadius:22, backgroundColor:Colors.absolutes.highlights.highlight400Faded }} />
|
|
60
62
|
:<></>}
|
|
61
63
|
{show_summary && poll_summary ?
|
|
62
|
-
<View style={{ position:'absolute', right:5, top:0, bottom:0, justifyContent:'center' }}>
|
|
63
|
-
<Text weight='regular' size={10} color={Colors.
|
|
64
|
+
<View transparent style={{ position:'absolute', right:5, top:0, bottom:0, justifyContent:'center' }}>
|
|
65
|
+
<Text weight='regular' size={10} color={Colors.text.h1}>{(poll_summary.pct * 100).toFixed(2)}%</Text>
|
|
64
66
|
</View>
|
|
65
67
|
:<></>}
|
|
66
|
-
</
|
|
68
|
+
</Button>
|
|
67
69
|
:
|
|
68
70
|
<View style={{ flexDirection:'row' }}>
|
|
69
|
-
<View style={{ flex:1, flexDirection:'row', alignItems:'center', paddingRight:10, borderRadius:22, borderWidth: 1, borderColor: show_result?getResultColor(poll_response?.result_ind):Colors.
|
|
71
|
+
<View style={{ flex:1, flexDirection:'row', alignItems:'center', paddingRight:10, borderRadius:22, borderWidth: 1, borderColor: show_result?getResultColor(poll_response?.result_ind):Colors.borders.light }}>
|
|
70
72
|
<TextInput
|
|
71
73
|
style={{ flex:1, textAlign:'center', fontSize:14, padding:10, color:getResultColor(poll_response?.result_ind) }}
|
|
72
74
|
keyboardType={poll_option.input_type == 'number' ? 'decimal-pad' : 'default'}
|
|
73
75
|
editable={show_result?false:true}
|
|
74
76
|
placeholder="Input Answer"
|
|
75
77
|
value={poll_response ? poll_response.input_value : input_value}
|
|
76
|
-
placeholderTextColor={Colors.shades.shade600}
|
|
77
78
|
onChangeText={(text) => {
|
|
78
79
|
if(draft_selected){ onSelect(poll_option) }
|
|
79
80
|
setInputValue(text)
|
|
@@ -88,11 +89,9 @@ const PollOptionCard = ({ draft_selected, show_result, poll_option, poll_summary
|
|
|
88
89
|
</View>
|
|
89
90
|
{!show_result ?
|
|
90
91
|
<Button
|
|
91
|
-
style={{ marginLeft:5 }}
|
|
92
|
-
borderRadius={22}
|
|
92
|
+
style={{ marginLeft:5, opacity: input_locked?1:0.5 }}
|
|
93
93
|
title={input_locked?'Locked In':'Lock It In'}
|
|
94
|
-
|
|
95
|
-
title_color={Colors.shades.white}
|
|
94
|
+
type='action'
|
|
96
95
|
onPress={() => {
|
|
97
96
|
if(!input_value || input_value == ''){ return alert('Please enter valid value') }
|
|
98
97
|
setInputLocked(true)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { FlatList } from "react-native"
|
|
3
3
|
import type { PollCampaignProps, PollProps, PollResponseProps } from "../../types"
|
|
4
|
-
import {
|
|
5
|
-
import { Icons, Text } from '../../Components';
|
|
6
|
-
import Colors from '../../constants/colors';
|
|
4
|
+
import { Icons } from '../../Components';
|
|
7
5
|
import PollSelectCard from './PollSelectCard';
|
|
6
|
+
import { Button, Text, View } from '../../Components/Themed';
|
|
7
|
+
import { useColors } from '../../constants/useColors';
|
|
8
8
|
|
|
9
9
|
type PollQuestionsSectionProps = {
|
|
10
10
|
poll_campaign:PollCampaignProps,
|
|
@@ -14,6 +14,7 @@ type PollQuestionsSectionProps = {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
const PollQuestionsSection = ({ poll_campaign, polls, poll_responses, onSelectPoll }:PollQuestionsSectionProps) => {
|
|
17
|
+
const Colors = useColors();
|
|
17
18
|
const [ section_data, setSectionData ] = useState<{
|
|
18
19
|
loading:boolean,
|
|
19
20
|
expanded:boolean,
|
|
@@ -28,7 +29,7 @@ const PollQuestionsSection = ({ poll_campaign, polls, poll_responses, onSelectPo
|
|
|
28
29
|
const my_response = poll_responses.find(r => r.poll_id == data.item.poll_id)
|
|
29
30
|
const response_option = data.item.poll_options?.find(po => po.poll_option_id == my_response?.poll_option_id);
|
|
30
31
|
return (
|
|
31
|
-
<View style={{ borderBottomWidth:1, borderBottomColor:Colors.
|
|
32
|
+
<View transparent style={{ borderBottomWidth:1, borderBottomColor:Colors.borders.light }}>
|
|
32
33
|
<PollSelectCard
|
|
33
34
|
poll={data.item}
|
|
34
35
|
disabled={false}
|
|
@@ -44,17 +45,17 @@ const PollQuestionsSection = ({ poll_campaign, polls, poll_responses, onSelectPo
|
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
return (
|
|
47
|
-
<View
|
|
48
|
-
<
|
|
49
|
-
<Icons.QuestionIcon size={18} color={Colors.
|
|
50
|
-
<View style={{flex:1, marginLeft:10}}>
|
|
51
|
-
<Text theme='
|
|
52
|
-
<Text style={{ marginTop:3 }} theme='
|
|
48
|
+
<View float>
|
|
49
|
+
<Button style={{ flexDirection:'row', alignItems:'center', padding:20, backgroundColor:Colors.views.header }} onPress={() => setSectionData({ ...section_data, expanded: !expanded })}>
|
|
50
|
+
<Icons.QuestionIcon size={18} color={Colors.text.h1} />
|
|
51
|
+
<View transparent style={{flex:1, marginLeft:10}}>
|
|
52
|
+
<Text theme='h1'>Questions</Text>
|
|
53
|
+
<Text style={{ marginTop:3 }} theme='description'>Available questions can be found below</Text>
|
|
53
54
|
</View>
|
|
54
|
-
<Icons.ChevronIcon direction={expanded?'up':'down'} color={Colors.
|
|
55
|
-
</
|
|
55
|
+
<Icons.ChevronIcon direction={expanded?'up':'down'} color={Colors.text.h1} size={8} />
|
|
56
|
+
</Button>
|
|
56
57
|
{expanded ?
|
|
57
|
-
<View style={{
|
|
58
|
+
<View transparent type='body' style={{ padding:10 }}>
|
|
58
59
|
<FlatList
|
|
59
60
|
data={polls.sort((a,b) => a.priority - b.priority)}
|
|
60
61
|
renderItem={renderPolls}
|