@100mslive/react-native-room-kit 1.1.1 → 1.1.3
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/README.md +1 -1
- package/lib/commonjs/HMSRoomSetup.js +15 -5
- package/lib/commonjs/HMSRoomSetup.js.map +1 -1
- package/lib/commonjs/Icons/Check/assets/check-in-circle.png +0 -0
- package/lib/commonjs/Icons/Check/assets/check-in-circle@2x.png +0 -0
- package/lib/commonjs/Icons/Check/assets/check-in-circle@3x.png +0 -0
- package/lib/commonjs/Icons/Check/index.js +2 -1
- package/lib/commonjs/Icons/Check/index.js.map +1 -1
- package/lib/commonjs/Icons/CheckBox/index.js +8 -1
- package/lib/commonjs/Icons/CheckBox/index.js.map +1 -1
- package/lib/commonjs/Icons/Clock/assets/clock-vector.png +0 -0
- package/lib/commonjs/Icons/Clock/assets/clock-vector@2x.png +0 -0
- package/lib/commonjs/Icons/Clock/assets/clock-vector@3x.png +0 -0
- package/lib/commonjs/Icons/Clock/assets/clock.png +0 -0
- package/lib/commonjs/Icons/Clock/assets/clock@2x.png +0 -0
- package/lib/commonjs/Icons/Clock/assets/clock@3x.png +0 -0
- package/lib/commonjs/Icons/Clock/index.js +7 -2
- package/lib/commonjs/Icons/Clock/index.js.map +1 -1
- package/lib/commonjs/components/CreatePoll.js +100 -53
- package/lib/commonjs/components/CreatePoll.js.map +1 -1
- package/lib/commonjs/components/GridView.js +4 -8
- package/lib/commonjs/components/GridView.js.map +1 -1
- package/lib/commonjs/components/HLSView.js +15 -1
- package/lib/commonjs/components/HLSView.js.map +1 -1
- package/lib/commonjs/components/HMSPollsQuizzesNotification.js +2 -2
- package/lib/commonjs/components/HMSPollsQuizzesNotification.js.map +1 -1
- package/lib/commonjs/components/LeaderboardEntry.js +135 -0
- package/lib/commonjs/components/LeaderboardEntry.js.map +1 -0
- package/lib/commonjs/components/PollAndQuizQuestionResponseCard.js +80 -32
- package/lib/commonjs/components/PollAndQuizQuestionResponseCard.js.map +1 -1
- package/lib/commonjs/components/PollAndQuizQuestionResponseCards.js +53 -0
- package/lib/commonjs/components/PollAndQuizQuestionResponseCards.js.map +1 -0
- package/lib/commonjs/components/PollAndQuizSheetScreen.js +69 -0
- package/lib/commonjs/components/PollAndQuizSheetScreen.js.map +1 -0
- package/lib/commonjs/components/PollAndQuizVoting.js +145 -17
- package/lib/commonjs/components/PollAndQuizVoting.js.map +1 -1
- package/lib/commonjs/components/PollQuestion.js +70 -14
- package/lib/commonjs/components/PollQuestion.js.map +1 -1
- package/lib/commonjs/components/PollQuestions.js +126 -12
- package/lib/commonjs/components/PollQuestions.js.map +1 -1
- package/lib/commonjs/components/PollsAndQuizBottomSheet.js +9 -11
- package/lib/commonjs/components/PollsAndQuizBottomSheet.js.map +1 -1
- package/lib/commonjs/components/PollsAndQuizzesCard.js +1 -1
- package/lib/commonjs/components/PollsAndQuizzesCard.js.map +1 -1
- package/lib/commonjs/components/PollsAndQuizzesModalContent.js +26 -120
- package/lib/commonjs/components/PollsAndQuizzesModalContent.js.map +1 -1
- package/lib/commonjs/components/PollsConfigAndList.js +81 -4
- package/lib/commonjs/components/PollsConfigAndList.js.map +1 -1
- package/lib/commonjs/components/PreviousPollsAndQuizzesList.js +7 -15
- package/lib/commonjs/components/PreviousPollsAndQuizzesList.js.map +1 -1
- package/lib/commonjs/components/QuizEndOptionsView.js +63 -0
- package/lib/commonjs/components/QuizEndOptionsView.js.map +1 -0
- package/lib/commonjs/components/QuizLeaderboardEntriesScreen.js +284 -0
- package/lib/commonjs/components/QuizLeaderboardEntriesScreen.js.map +1 -0
- package/lib/commonjs/components/QuizLeaderboardScreen.js +279 -0
- package/lib/commonjs/components/QuizLeaderboardScreen.js.map +1 -0
- package/lib/commonjs/components/QuizLeaderboardSummary.js +195 -0
- package/lib/commonjs/components/QuizLeaderboardSummary.js.map +1 -0
- package/lib/commonjs/components/RadioInput.js +9 -2
- package/lib/commonjs/components/RadioInput.js.map +1 -1
- package/lib/commonjs/components/RoomSettingsModalContent.js +1 -1
- package/lib/commonjs/components/RoomSettingsModalContent.js.map +1 -1
- package/lib/commonjs/components/TilesContainer.js +3 -4
- package/lib/commonjs/components/TilesContainer.js.map +1 -1
- package/lib/commonjs/components/VoterParticipationSummary.js +46 -0
- package/lib/commonjs/components/VoterParticipationSummary.js.map +1 -0
- package/lib/commonjs/hooks-util.js +1 -1
- package/lib/commonjs/hooks-util.js.map +1 -1
- package/lib/commonjs/redux/actionTypes.js +9 -1
- package/lib/commonjs/redux/actionTypes.js.map +1 -1
- package/lib/commonjs/redux/actions/index.js +38 -5
- package/lib/commonjs/redux/actions/index.js.map +1 -1
- package/lib/commonjs/redux/reducers/polls.js +95 -8
- package/lib/commonjs/redux/reducers/polls.js.map +1 -1
- package/lib/commonjs/utils/functions.js +48 -3
- package/lib/commonjs/utils/functions.js.map +1 -1
- package/lib/commonjs/utils/hooks.js +107 -2
- package/lib/commonjs/utils/hooks.js.map +1 -1
- package/lib/module/HMSRoomSetup.js +16 -6
- package/lib/module/HMSRoomSetup.js.map +1 -1
- package/lib/module/Icons/Check/assets/check-in-circle.png +0 -0
- package/lib/module/Icons/Check/assets/check-in-circle@2x.png +0 -0
- package/lib/module/Icons/Check/assets/check-in-circle@3x.png +0 -0
- package/lib/module/Icons/Check/index.js +2 -1
- package/lib/module/Icons/Check/index.js.map +1 -1
- package/lib/module/Icons/CheckBox/index.js +9 -2
- package/lib/module/Icons/CheckBox/index.js.map +1 -1
- package/lib/module/Icons/Clock/assets/clock-vector.png +0 -0
- package/lib/module/Icons/Clock/assets/clock-vector@2x.png +0 -0
- package/lib/module/Icons/Clock/assets/clock-vector@3x.png +0 -0
- package/lib/module/Icons/Clock/assets/clock.png +0 -0
- package/lib/module/Icons/Clock/assets/clock@2x.png +0 -0
- package/lib/module/Icons/Clock/assets/clock@3x.png +0 -0
- package/lib/module/Icons/Clock/index.js +7 -2
- package/lib/module/Icons/Clock/index.js.map +1 -1
- package/lib/module/components/CreatePoll.js +102 -56
- package/lib/module/components/CreatePoll.js.map +1 -1
- package/lib/module/components/GridView.js +5 -9
- package/lib/module/components/GridView.js.map +1 -1
- package/lib/module/components/HLSView.js +17 -3
- package/lib/module/components/HLSView.js.map +1 -1
- package/lib/module/components/HMSPollsQuizzesNotification.js +3 -3
- package/lib/module/components/HMSPollsQuizzesNotification.js.map +1 -1
- package/lib/module/components/LeaderboardEntry.js +126 -0
- package/lib/module/components/LeaderboardEntry.js.map +1 -0
- package/lib/module/components/PollAndQuizQuestionResponseCard.js +81 -33
- package/lib/module/components/PollAndQuizQuestionResponseCard.js.map +1 -1
- package/lib/module/components/PollAndQuizQuestionResponseCards.js +44 -0
- package/lib/module/components/PollAndQuizQuestionResponseCards.js.map +1 -0
- package/lib/module/components/PollAndQuizSheetScreen.js +60 -0
- package/lib/module/components/PollAndQuizSheetScreen.js.map +1 -0
- package/lib/module/components/PollAndQuizVoting.js +148 -20
- package/lib/module/components/PollAndQuizVoting.js.map +1 -1
- package/lib/module/components/PollQuestion.js +73 -17
- package/lib/module/components/PollQuestion.js.map +1 -1
- package/lib/module/components/PollQuestions.js +129 -15
- package/lib/module/components/PollQuestions.js.map +1 -1
- package/lib/module/components/PollsAndQuizBottomSheet.js +11 -13
- package/lib/module/components/PollsAndQuizBottomSheet.js.map +1 -1
- package/lib/module/components/PollsAndQuizzesCard.js +2 -2
- package/lib/module/components/PollsAndQuizzesCard.js.map +1 -1
- package/lib/module/components/PollsAndQuizzesModalContent.js +28 -122
- package/lib/module/components/PollsAndQuizzesModalContent.js.map +1 -1
- package/lib/module/components/PollsConfigAndList.js +82 -5
- package/lib/module/components/PollsConfigAndList.js.map +1 -1
- package/lib/module/components/PreviousPollsAndQuizzesList.js +7 -15
- package/lib/module/components/PreviousPollsAndQuizzesList.js.map +1 -1
- package/lib/module/components/QuizEndOptionsView.js +54 -0
- package/lib/module/components/QuizEndOptionsView.js.map +1 -0
- package/lib/module/components/QuizLeaderboardEntriesScreen.js +275 -0
- package/lib/module/components/QuizLeaderboardEntriesScreen.js.map +1 -0
- package/lib/module/components/QuizLeaderboardScreen.js +270 -0
- package/lib/module/components/QuizLeaderboardScreen.js.map +1 -0
- package/lib/module/components/QuizLeaderboardSummary.js +186 -0
- package/lib/module/components/QuizLeaderboardSummary.js.map +1 -0
- package/lib/module/components/RadioInput.js +10 -3
- package/lib/module/components/RadioInput.js.map +1 -1
- package/lib/module/components/RoomSettingsModalContent.js +1 -1
- package/lib/module/components/RoomSettingsModalContent.js.map +1 -1
- package/lib/module/components/TilesContainer.js +5 -6
- package/lib/module/components/TilesContainer.js.map +1 -1
- package/lib/module/components/VoterParticipationSummary.js +37 -0
- package/lib/module/components/VoterParticipationSummary.js.map +1 -0
- package/lib/module/hooks-util.js +2 -4
- package/lib/module/hooks-util.js.map +1 -1
- package/lib/module/redux/actionTypes.js +9 -1
- package/lib/module/redux/actionTypes.js.map +1 -1
- package/lib/module/redux/actions/index.js +29 -3
- package/lib/module/redux/actions/index.js.map +1 -1
- package/lib/module/redux/reducers/polls.js +96 -9
- package/lib/module/redux/reducers/polls.js.map +1 -1
- package/lib/module/utils/functions.js +43 -3
- package/lib/module/utils/functions.js.map +1 -1
- package/lib/module/utils/hooks.js +105 -2
- package/lib/module/utils/hooks.js.map +1 -1
- package/lib/typescript/HMSRoomSetup.d.ts.map +1 -1
- package/lib/typescript/Icons/Check/index.d.ts +1 -0
- package/lib/typescript/Icons/Check/index.d.ts.map +1 -1
- package/lib/typescript/Icons/CheckBox/index.d.ts +1 -0
- package/lib/typescript/Icons/CheckBox/index.d.ts.map +1 -1
- package/lib/typescript/Icons/Clock/index.d.ts +1 -0
- package/lib/typescript/Icons/Clock/index.d.ts.map +1 -1
- package/lib/typescript/components/CreatePoll.d.ts.map +1 -1
- package/lib/typescript/components/GridView.d.ts.map +1 -1
- package/lib/typescript/components/HLSView.d.ts.map +1 -1
- package/lib/typescript/components/LeaderboardEntry.d.ts +11 -0
- package/lib/typescript/components/LeaderboardEntry.d.ts.map +1 -0
- package/lib/typescript/components/PollAndQuizQuestionResponseCard.d.ts.map +1 -1
- package/lib/typescript/components/PollAndQuizQuestionResponseCards.d.ts +9 -0
- package/lib/typescript/components/PollAndQuizQuestionResponseCards.d.ts.map +1 -0
- package/lib/typescript/components/PollAndQuizSheetScreen.d.ts +8 -0
- package/lib/typescript/components/PollAndQuizSheetScreen.d.ts.map +1 -0
- package/lib/typescript/components/PollAndQuizVoting.d.ts +2 -0
- package/lib/typescript/components/PollAndQuizVoting.d.ts.map +1 -1
- package/lib/typescript/components/PollQuestion.d.ts +1 -0
- package/lib/typescript/components/PollQuestion.d.ts.map +1 -1
- package/lib/typescript/components/PollQuestions.d.ts +2 -0
- package/lib/typescript/components/PollQuestions.d.ts.map +1 -1
- package/lib/typescript/components/PollsAndQuizBottomSheet.d.ts.map +1 -1
- package/lib/typescript/components/PollsAndQuizzesModalContent.d.ts +0 -1
- package/lib/typescript/components/PollsAndQuizzesModalContent.d.ts.map +1 -1
- package/lib/typescript/components/PollsConfigAndList.d.ts +1 -0
- package/lib/typescript/components/PollsConfigAndList.d.ts.map +1 -1
- package/lib/typescript/components/PreviousPollsAndQuizzesList.d.ts.map +1 -1
- package/lib/typescript/components/QuizEndOptionsView.d.ts +10 -0
- package/lib/typescript/components/QuizEndOptionsView.d.ts.map +1 -0
- package/lib/typescript/components/QuizLeaderboardEntriesScreen.d.ts +8 -0
- package/lib/typescript/components/QuizLeaderboardEntriesScreen.d.ts.map +1 -0
- package/lib/typescript/components/QuizLeaderboardScreen.d.ts +8 -0
- package/lib/typescript/components/QuizLeaderboardScreen.d.ts.map +1 -0
- package/lib/typescript/components/QuizLeaderboardSummary.d.ts +9 -0
- package/lib/typescript/components/QuizLeaderboardSummary.d.ts.map +1 -0
- package/lib/typescript/components/RadioInput.d.ts +1 -0
- package/lib/typescript/components/RadioInput.d.ts.map +1 -1
- package/lib/typescript/components/VoterParticipationSummary.d.ts +7 -0
- package/lib/typescript/components/VoterParticipationSummary.d.ts.map +1 -0
- package/lib/typescript/hooks-util.d.ts.map +1 -1
- package/lib/typescript/redux/actionTypes.d.ts +45 -9
- package/lib/typescript/redux/actionTypes.d.ts.map +1 -1
- package/lib/typescript/redux/actions/index.d.ts +8 -2
- package/lib/typescript/redux/actions/index.d.ts.map +1 -1
- package/lib/typescript/redux/index.d.ts +2 -1
- package/lib/typescript/redux/index.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/index.d.ts +2 -1
- package/lib/typescript/redux/reducers/index.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/polls.d.ts +3 -2
- package/lib/typescript/redux/reducers/polls.d.ts.map +1 -1
- package/lib/typescript/utils/functions.d.ts +6 -2
- package/lib/typescript/utils/functions.d.ts.map +1 -1
- package/lib/typescript/utils/hooks.d.ts +6 -0
- package/lib/typescript/utils/hooks.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/HMSRoomSetup.tsx +25 -6
- package/src/Icons/Check/assets/check-in-circle.png +0 -0
- package/src/Icons/Check/assets/check-in-circle@2x.png +0 -0
- package/src/Icons/Check/assets/check-in-circle@3x.png +0 -0
- package/src/Icons/Check/index.tsx +9 -2
- package/src/Icons/CheckBox/index.tsx +16 -2
- package/src/Icons/Clock/assets/clock-vector.png +0 -0
- package/src/Icons/Clock/assets/clock-vector@2x.png +0 -0
- package/src/Icons/Clock/assets/clock-vector@3x.png +0 -0
- package/src/Icons/Clock/assets/clock.png +0 -0
- package/src/Icons/Clock/assets/clock@2x.png +0 -0
- package/src/Icons/Clock/assets/clock@3x.png +0 -0
- package/src/Icons/Clock/index.tsx +16 -3
- package/src/components/CreatePoll.tsx +150 -72
- package/src/components/GridView.tsx +4 -14
- package/src/components/HLSView.tsx +27 -1
- package/src/components/HMSPollsQuizzesNotification.tsx +3 -3
- package/src/components/LeaderboardEntry.tsx +172 -0
- package/src/components/PollAndQuizQuestionResponseCard.tsx +151 -48
- package/src/components/PollAndQuizQuestionResponseCards.tsx +62 -0
- package/src/components/PollAndQuizSheetScreen.tsx +85 -0
- package/src/components/PollAndQuizVoting.tsx +206 -28
- package/src/components/PollQuestion.tsx +140 -25
- package/src/components/PollQuestions.tsx +214 -74
- package/src/components/PollsAndQuizBottomSheet.tsx +20 -42
- package/src/components/PollsAndQuizzesCard.tsx +2 -2
- package/src/components/PollsAndQuizzesModalContent.tsx +40 -163
- package/src/components/PollsConfigAndList.tsx +107 -11
- package/src/components/PreviousPollsAndQuizzesList.tsx +33 -40
- package/src/components/QuizEndOptionsView.tsx +71 -0
- package/src/components/QuizLeaderboardEntriesScreen.tsx +323 -0
- package/src/components/QuizLeaderboardScreen.tsx +342 -0
- package/src/components/QuizLeaderboardSummary.tsx +207 -0
- package/src/components/RadioInput.tsx +14 -2
- package/src/components/RoomSettingsModalContent.tsx +1 -1
- package/src/components/TilesContainer.tsx +4 -4
- package/src/components/VoterParticipationSummary.tsx +67 -0
- package/src/hooks-util.ts +1 -3
- package/src/redux/actionTypes.ts +56 -6
- package/src/redux/actions/index.ts +56 -6
- package/src/redux/reducers/polls.ts +139 -11
- package/src/utils/functions.ts +90 -6
- package/src/utils/hooks.ts +190 -3
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Text, StyleSheet, View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { useHMSRoomStyleSheet } from '../hooks-util';
|
|
5
|
+
|
|
6
|
+
export interface QuizLeaderboardSummaryProps {
|
|
7
|
+
data: { label: string; value: any }[][];
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const QuizLeaderboardSummary: React.FC<QuizLeaderboardSummaryProps> = ({
|
|
11
|
+
data,
|
|
12
|
+
}) => {
|
|
13
|
+
const hmsRoomStyles = useHMSRoomStyleSheet((theme, typography) => ({
|
|
14
|
+
regularHighText: {
|
|
15
|
+
color: theme.palette.on_surface_high,
|
|
16
|
+
fontFamily: `${typography.font_family}-Regular`,
|
|
17
|
+
},
|
|
18
|
+
regularMediumText: {
|
|
19
|
+
color: theme.palette.on_surface_medium,
|
|
20
|
+
fontFamily: `${typography.font_family}-Regular`,
|
|
21
|
+
},
|
|
22
|
+
semiBoldMediumText: {
|
|
23
|
+
color: theme.palette.on_surface_medium,
|
|
24
|
+
fontFamily: `${typography.font_family}-SemiBold`,
|
|
25
|
+
},
|
|
26
|
+
semiBoldHighText: {
|
|
27
|
+
color: theme.palette.on_surface_high,
|
|
28
|
+
fontFamily: `${typography.font_family}-SemiBold`,
|
|
29
|
+
},
|
|
30
|
+
headerText: {
|
|
31
|
+
color: theme.palette.on_surface_high,
|
|
32
|
+
fontFamily: `${typography.font_family}-SemiBold`,
|
|
33
|
+
},
|
|
34
|
+
container: {
|
|
35
|
+
backgroundColor: theme.palette.surface_dim,
|
|
36
|
+
},
|
|
37
|
+
summaryContainer: {
|
|
38
|
+
backgroundColor: theme.palette.surface_default,
|
|
39
|
+
},
|
|
40
|
+
entriesCard: {
|
|
41
|
+
backgroundColor: theme.palette.surface_default,
|
|
42
|
+
},
|
|
43
|
+
divider: {
|
|
44
|
+
backgroundColor: theme.palette.border_bright,
|
|
45
|
+
},
|
|
46
|
+
}));
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<View style={{}}>
|
|
50
|
+
<Text
|
|
51
|
+
style={[
|
|
52
|
+
styles.normalText,
|
|
53
|
+
styles.marginBottom16,
|
|
54
|
+
hmsRoomStyles.semiBoldHighText,
|
|
55
|
+
]}
|
|
56
|
+
>
|
|
57
|
+
Participation Summary
|
|
58
|
+
</Text>
|
|
59
|
+
|
|
60
|
+
<View style={styles.marginBottom16}>
|
|
61
|
+
{data.map((summaryMap, index) => (
|
|
62
|
+
<View key={index} style={{ marginBottom: 8, flexDirection: 'row' }}>
|
|
63
|
+
{summaryMap.map((summary, index) => (
|
|
64
|
+
<React.Fragment key={summary.label}>
|
|
65
|
+
{index > 0 ? <View style={{ width: 8 }} /> : null}
|
|
66
|
+
|
|
67
|
+
<View
|
|
68
|
+
style={[
|
|
69
|
+
styles.summaryWrapper,
|
|
70
|
+
hmsRoomStyles.summaryContainer,
|
|
71
|
+
]}
|
|
72
|
+
>
|
|
73
|
+
<Text
|
|
74
|
+
style={[
|
|
75
|
+
styles.tinyText,
|
|
76
|
+
styles.marginBottom8,
|
|
77
|
+
hmsRoomStyles.semiBoldMediumText,
|
|
78
|
+
]}
|
|
79
|
+
>
|
|
80
|
+
{summary.label}
|
|
81
|
+
</Text>
|
|
82
|
+
|
|
83
|
+
<Text
|
|
84
|
+
style={[styles.normalText, hmsRoomStyles.semiBoldHighText]}
|
|
85
|
+
>
|
|
86
|
+
{summary.value}
|
|
87
|
+
</Text>
|
|
88
|
+
</View>
|
|
89
|
+
</React.Fragment>
|
|
90
|
+
))}
|
|
91
|
+
</View>
|
|
92
|
+
))}
|
|
93
|
+
</View>
|
|
94
|
+
</View>
|
|
95
|
+
);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const styles = StyleSheet.create({
|
|
99
|
+
tinyText: {
|
|
100
|
+
fontSize: 10,
|
|
101
|
+
lineHeight: 16,
|
|
102
|
+
letterSpacing: 1.5,
|
|
103
|
+
},
|
|
104
|
+
smallerText: {
|
|
105
|
+
fontSize: 12,
|
|
106
|
+
lineHeight: 16,
|
|
107
|
+
},
|
|
108
|
+
smallText: {
|
|
109
|
+
fontSize: 14,
|
|
110
|
+
lineHeight: 20,
|
|
111
|
+
},
|
|
112
|
+
normalText: {
|
|
113
|
+
fontSize: 16,
|
|
114
|
+
lineHeight: 24,
|
|
115
|
+
},
|
|
116
|
+
marginBottom8: {
|
|
117
|
+
marginBottom: 8,
|
|
118
|
+
},
|
|
119
|
+
marginBottom16: {
|
|
120
|
+
marginBottom: 16,
|
|
121
|
+
},
|
|
122
|
+
contentContainer: {
|
|
123
|
+
paddingHorizontal: 24,
|
|
124
|
+
},
|
|
125
|
+
scrollViewContentContainer: {
|
|
126
|
+
flexGrow: 1,
|
|
127
|
+
paddingVertical: 24,
|
|
128
|
+
},
|
|
129
|
+
summaryWrapper: {
|
|
130
|
+
flexBasis: '50%',
|
|
131
|
+
flexGrow: 1,
|
|
132
|
+
flexShrink: 1,
|
|
133
|
+
padding: 16,
|
|
134
|
+
borderRadius: 12,
|
|
135
|
+
},
|
|
136
|
+
position: {
|
|
137
|
+
width: 24,
|
|
138
|
+
height: 24,
|
|
139
|
+
borderRadius: 12,
|
|
140
|
+
textAlign: 'center',
|
|
141
|
+
textAlignVertical: 'center',
|
|
142
|
+
marginRight: 12,
|
|
143
|
+
},
|
|
144
|
+
firstPosition: {
|
|
145
|
+
backgroundColor: '#D69516', // '#FFD700'
|
|
146
|
+
},
|
|
147
|
+
secondPosition: {
|
|
148
|
+
backgroundColor: '#3E3E3E', // '#C0C0C0'
|
|
149
|
+
},
|
|
150
|
+
thirdPosition: {
|
|
151
|
+
backgroundColor: '#583B0F', // '#CD7F32'
|
|
152
|
+
},
|
|
153
|
+
iconWrapper: {
|
|
154
|
+
flexDirection: 'row',
|
|
155
|
+
alignItems: 'center',
|
|
156
|
+
marginLeft: 12,
|
|
157
|
+
},
|
|
158
|
+
// Utilities
|
|
159
|
+
fullView: {
|
|
160
|
+
flex: 1,
|
|
161
|
+
},
|
|
162
|
+
// Header
|
|
163
|
+
header: {
|
|
164
|
+
flexDirection: 'row',
|
|
165
|
+
alignItems: 'center',
|
|
166
|
+
justifyContent: 'space-between',
|
|
167
|
+
marginTop: 24,
|
|
168
|
+
marginHorizontal: 24,
|
|
169
|
+
},
|
|
170
|
+
headerControls: {
|
|
171
|
+
flexDirection: 'row',
|
|
172
|
+
alignItems: 'center',
|
|
173
|
+
flexShrink: 1,
|
|
174
|
+
},
|
|
175
|
+
headerText: {
|
|
176
|
+
fontSize: 20,
|
|
177
|
+
lineHeight: 24,
|
|
178
|
+
letterSpacing: 0.15,
|
|
179
|
+
marginRight: 12,
|
|
180
|
+
},
|
|
181
|
+
closeIconHitSlop: {
|
|
182
|
+
bottom: 16,
|
|
183
|
+
left: 16,
|
|
184
|
+
right: 16,
|
|
185
|
+
top: 16,
|
|
186
|
+
},
|
|
187
|
+
backIcon: {
|
|
188
|
+
marginRight: 8,
|
|
189
|
+
},
|
|
190
|
+
// Divider
|
|
191
|
+
halfDivider: {
|
|
192
|
+
marginHorizontal: 24,
|
|
193
|
+
marginVertical: 0,
|
|
194
|
+
marginTop: 24,
|
|
195
|
+
width: undefined,
|
|
196
|
+
},
|
|
197
|
+
divider: { height: 1, width: '100%' },
|
|
198
|
+
viewAllBtn: {
|
|
199
|
+
flexDirection: 'row',
|
|
200
|
+
alignItems: 'center',
|
|
201
|
+
justifyContent: 'flex-end',
|
|
202
|
+
paddingVertical: 12,
|
|
203
|
+
paddingHorizontal: 16,
|
|
204
|
+
},
|
|
205
|
+
leaderboardEntry: { marginBottom: 16, marginHorizontal: 16 },
|
|
206
|
+
entriesCard: { paddingTop: 12, borderRadius: 8 },
|
|
207
|
+
});
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { View, StyleSheet } from 'react-native';
|
|
2
|
+
import { View, StyleSheet, TouchableOpacity } from 'react-native';
|
|
3
3
|
import type { ColorValue } from 'react-native';
|
|
4
4
|
|
|
5
5
|
export interface RadioInputProps {
|
|
6
6
|
selected: boolean;
|
|
7
7
|
size?: number;
|
|
8
8
|
color?: ColorValue;
|
|
9
|
+
onChange?: (selected: boolean) => void;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
export const RadioInput: React.FC<RadioInputProps> = ({
|
|
12
13
|
selected,
|
|
13
14
|
size = 24,
|
|
14
15
|
color = 'white',
|
|
16
|
+
onChange,
|
|
15
17
|
}) => {
|
|
16
18
|
const outerCircleStyle = {
|
|
17
19
|
width: size,
|
|
@@ -28,11 +30,21 @@ export const RadioInput: React.FC<RadioInputProps> = ({
|
|
|
28
30
|
backgroundColor: color,
|
|
29
31
|
};
|
|
30
32
|
|
|
31
|
-
|
|
33
|
+
const radio = (
|
|
32
34
|
<View style={[styles.outerCircle, outerCircleStyle]}>
|
|
33
35
|
{selected ? <View style={innerCircleStyle} /> : null}
|
|
34
36
|
</View>
|
|
35
37
|
);
|
|
38
|
+
|
|
39
|
+
if (typeof onChange !== 'function') {
|
|
40
|
+
return radio;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<TouchableOpacity onPress={() => onChange(!selected)}>
|
|
45
|
+
{radio}
|
|
46
|
+
</TouchableOpacity>
|
|
47
|
+
);
|
|
36
48
|
};
|
|
37
49
|
|
|
38
50
|
const styles = StyleSheet.create({
|
|
@@ -316,7 +316,7 @@ export const RoomSettingsModalContent: React.FC<
|
|
|
316
316
|
{
|
|
317
317
|
id: 'polls-and-quizes',
|
|
318
318
|
icon: <PollVoteIcon style={{ width: 20, height: 20 }} />,
|
|
319
|
-
label: 'Polls',
|
|
319
|
+
label: 'Polls and Quizzes',
|
|
320
320
|
pressHandler: openPollsQuizzesModal,
|
|
321
321
|
isActive: false,
|
|
322
322
|
hide: !canReadOrWritePoll,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { View
|
|
2
|
+
import { View } from 'react-native';
|
|
3
3
|
import { useSelector } from 'react-redux';
|
|
4
4
|
import type { ViewStyle } from 'react-native';
|
|
5
|
-
import {
|
|
5
|
+
import { useSafeAreaFrame } from 'react-native-safe-area-context';
|
|
6
6
|
import type { HMSView } from '@100mslive/react-native-hms';
|
|
7
7
|
|
|
8
8
|
import { Tile } from './Tile';
|
|
@@ -22,7 +22,7 @@ const _TilesContainer: React.FC<TilesContainerProps> = ({
|
|
|
22
22
|
setHmsViewRefs,
|
|
23
23
|
onPeerTileMorePress,
|
|
24
24
|
}) => {
|
|
25
|
-
const {
|
|
25
|
+
const { width: safeWidth } = useSafeAreaFrame();
|
|
26
26
|
const isLandscapeOrientation = useIsLandscapeOrientation();
|
|
27
27
|
|
|
28
28
|
const screenshareTilesAvailable = useSelector(
|
|
@@ -55,7 +55,7 @@ const _TilesContainer: React.FC<TilesContainerProps> = ({
|
|
|
55
55
|
? 'row'
|
|
56
56
|
: 'column',
|
|
57
57
|
},
|
|
58
|
-
{ width:
|
|
58
|
+
{ width: safeWidth },
|
|
59
59
|
]}
|
|
60
60
|
>
|
|
61
61
|
{peerTrackNodes.length <= 3 ? (
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { HMSPoll } from '@100mslive/react-native-hms';
|
|
3
|
+
import { useSelector } from 'react-redux';
|
|
4
|
+
|
|
5
|
+
import type { RootState } from '../redux';
|
|
6
|
+
import { QuizLeaderboardSummary } from './QuizLeaderboardSummary';
|
|
7
|
+
import { useFetchLeaderboardResponse } from '../utils/hooks';
|
|
8
|
+
|
|
9
|
+
export interface VoterParticipationSummaryProps {
|
|
10
|
+
pollId: HMSPoll['pollId'];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const VoterParticipationSummary: React.FC<
|
|
14
|
+
VoterParticipationSummaryProps
|
|
15
|
+
> = ({ pollId }) => {
|
|
16
|
+
const localPeerUserId = useSelector(
|
|
17
|
+
(state: RootState) => state.hmsStates.localPeer?.customerUserID
|
|
18
|
+
);
|
|
19
|
+
const leaderboardData = useFetchLeaderboardResponse(pollId);
|
|
20
|
+
const totalQuestions = useSelector(
|
|
21
|
+
(state: RootState) => state.polls.polls[pollId]?.questions?.length
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
const localLeaderboardEntry =
|
|
25
|
+
localPeerUserId && leaderboardData && Array.isArray(leaderboardData.entries)
|
|
26
|
+
? leaderboardData.entries.find(
|
|
27
|
+
(entry) => entry.peer?.customerUserId === localPeerUserId
|
|
28
|
+
)
|
|
29
|
+
: null;
|
|
30
|
+
|
|
31
|
+
const data = React.useMemo(() => {
|
|
32
|
+
return [
|
|
33
|
+
[
|
|
34
|
+
{
|
|
35
|
+
label: 'ANSWERED',
|
|
36
|
+
value:
|
|
37
|
+
localLeaderboardEntry &&
|
|
38
|
+
typeof localLeaderboardEntry.totalResponses === 'number' &&
|
|
39
|
+
typeof totalQuestions === 'number'
|
|
40
|
+
? `${Math.round((localLeaderboardEntry.totalResponses / totalQuestions) * 100)}% (${localLeaderboardEntry.totalResponses}/${totalQuestions})`
|
|
41
|
+
: '-',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
label: 'CORRECT ANSWERS',
|
|
45
|
+
value:
|
|
46
|
+
localLeaderboardEntry &&
|
|
47
|
+
typeof localLeaderboardEntry.correctResponses === 'number' &&
|
|
48
|
+
typeof totalQuestions === 'number'
|
|
49
|
+
? `${Math.round((localLeaderboardEntry.correctResponses / totalQuestions) * 100)}% (${localLeaderboardEntry.correctResponses}/${totalQuestions})`
|
|
50
|
+
: '-',
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
[
|
|
54
|
+
{
|
|
55
|
+
label: 'TIME TAKEN',
|
|
56
|
+
value:
|
|
57
|
+
localLeaderboardEntry &&
|
|
58
|
+
typeof localLeaderboardEntry.duration === 'number'
|
|
59
|
+
? `${(localLeaderboardEntry.duration / 1000).toFixed(2)}s`
|
|
60
|
+
: '-',
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
];
|
|
64
|
+
}, [localLeaderboardEntry]);
|
|
65
|
+
|
|
66
|
+
return <QuizLeaderboardSummary data={data} />;
|
|
67
|
+
};
|
package/src/hooks-util.ts
CHANGED
|
@@ -24,8 +24,6 @@ import {
|
|
|
24
24
|
WindowController,
|
|
25
25
|
useHMSHLSPlayerCue,
|
|
26
26
|
HMSPollUpdateType,
|
|
27
|
-
HMSPollType,
|
|
28
|
-
// useHMSPeerUpdates,
|
|
29
27
|
} from '@100mslive/react-native-hms';
|
|
30
28
|
import type { Chat as ChatConfig } from '@100mslive/types-prebuilt/elements/chat';
|
|
31
29
|
import { SoftInputModes } from '@100mslive/react-native-hms';
|
|
@@ -2572,7 +2570,7 @@ export const useHLSCuedPolls = () => {
|
|
|
2572
2570
|
? store.getState().polls.polls[pollId]
|
|
2573
2571
|
: null;
|
|
2574
2572
|
|
|
2575
|
-
if (poll
|
|
2573
|
+
if (poll) {
|
|
2576
2574
|
console.log('HLS Cued Poll ID: ', pollId);
|
|
2577
2575
|
dispatch(addCuedPollId(poll.pollId));
|
|
2578
2576
|
dispatch(
|
package/src/redux/actionTypes.ts
CHANGED
|
@@ -2,6 +2,8 @@ import type {
|
|
|
2
2
|
HMSPoll,
|
|
3
3
|
HMSPollQuestion,
|
|
4
4
|
HMSPollQuestionType,
|
|
5
|
+
HMSPollType,
|
|
6
|
+
PollLeaderboardResponse,
|
|
5
7
|
} from '@100mslive/react-native-hms';
|
|
6
8
|
|
|
7
9
|
const createRequests = (base: String) => {
|
|
@@ -194,9 +196,12 @@ export enum CreatePollStages {
|
|
|
194
196
|
POLL_CONFIG,
|
|
195
197
|
POLL_QUESTION_CONFIG,
|
|
196
198
|
POLL_VOTING,
|
|
199
|
+
QUIZ_LEADERBOARD,
|
|
200
|
+
QUIZ_LEADERBOARD_ENTRIES,
|
|
197
201
|
}
|
|
198
202
|
|
|
199
203
|
export type PollConfig = {
|
|
204
|
+
type: HMSPollType;
|
|
200
205
|
voteCountHidden: boolean;
|
|
201
206
|
resultsAnonymous: boolean;
|
|
202
207
|
};
|
|
@@ -206,7 +211,8 @@ export type PollQuestionUI = {
|
|
|
206
211
|
title: string;
|
|
207
212
|
skippable: boolean;
|
|
208
213
|
responseEditable: boolean;
|
|
209
|
-
|
|
214
|
+
pointWeightage: string;
|
|
215
|
+
options?: [boolean, string][];
|
|
210
216
|
saved: boolean;
|
|
211
217
|
};
|
|
212
218
|
|
|
@@ -214,15 +220,20 @@ export type PollsActionType =
|
|
|
214
220
|
| SetDeleteConfirmationVisible
|
|
215
221
|
| SetPollNameAction
|
|
216
222
|
| SetPollConfigAction
|
|
217
|
-
|
|
|
223
|
+
| PushToNavigationStackAction
|
|
224
|
+
| ResetNavigationStackAction
|
|
225
|
+
| PopFromNavigationStackAction
|
|
226
|
+
| ReplaceTopOfNavigationStackAction
|
|
218
227
|
| AddPollQuestionAction
|
|
219
228
|
| DeletePollQuestionAction
|
|
220
229
|
| SetSelectedQuestionIndexAction
|
|
221
230
|
| SetQuestionTypeAction
|
|
222
231
|
| SetQuestionTitleAction
|
|
232
|
+
| SetQuestionPointWeightageAction
|
|
223
233
|
| AddQuestionOptionAction
|
|
224
234
|
| DeleteQuestionOptionAction
|
|
225
235
|
| EditQuestionOptionAction
|
|
236
|
+
| SetQuestionCorrectOptionAction
|
|
226
237
|
| SetQuestionSkippable
|
|
227
238
|
| SetQuestionResponseEditable
|
|
228
239
|
| SetQuestionSavedAction
|
|
@@ -236,6 +247,7 @@ export type PollsActionType =
|
|
|
236
247
|
| AddPollQuestionResponseAction
|
|
237
248
|
| RemovePollQuestionResponseAction
|
|
238
249
|
| AddCuedPollIdAction
|
|
250
|
+
| AddLeaderboardAction
|
|
239
251
|
| { type: HmsStateActionTypes.CLEAR_STATES };
|
|
240
252
|
|
|
241
253
|
export type ClearPollFormStateAction = {
|
|
@@ -257,9 +269,22 @@ export type SetPollConfigAction = {
|
|
|
257
269
|
pollConfig: Partial<PollConfig>;
|
|
258
270
|
};
|
|
259
271
|
|
|
260
|
-
export type
|
|
261
|
-
type: PollsStateActionTypes.
|
|
262
|
-
|
|
272
|
+
export type PushToNavigationStackAction = {
|
|
273
|
+
type: PollsStateActionTypes.PUSH_TO_NAVIGATION_STACK;
|
|
274
|
+
screen: CreatePollStages;
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
export type ResetNavigationStackAction = {
|
|
278
|
+
type: PollsStateActionTypes.RESET_NAVIGATION_STACK;
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
export type PopFromNavigationStackAction = {
|
|
282
|
+
type: PollsStateActionTypes.POP_FROM_NAVIGATION_STACK;
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
export type ReplaceTopOfNavigationStackAction = {
|
|
286
|
+
type: PollsStateActionTypes.REPLACE_TOP_OF_NAVIGATION_STACK;
|
|
287
|
+
screen: CreatePollStages;
|
|
263
288
|
};
|
|
264
289
|
|
|
265
290
|
export type AddPollQuestionAction = {
|
|
@@ -287,6 +312,12 @@ export type SetQuestionTitleAction = {
|
|
|
287
312
|
title: string;
|
|
288
313
|
};
|
|
289
314
|
|
|
315
|
+
export type SetQuestionPointWeightageAction = {
|
|
316
|
+
type: PollsStateActionTypes.SET_POINT_WEIGHTAGE;
|
|
317
|
+
questionIndex: number;
|
|
318
|
+
pointWeightage: string;
|
|
319
|
+
};
|
|
320
|
+
|
|
290
321
|
export type AddQuestionOptionAction = {
|
|
291
322
|
type: PollsStateActionTypes.ADD_QUESTION_OPTION;
|
|
292
323
|
questionIndex: number;
|
|
@@ -305,6 +336,13 @@ export type EditQuestionOptionAction = {
|
|
|
305
336
|
option: string;
|
|
306
337
|
};
|
|
307
338
|
|
|
339
|
+
export type SetQuestionCorrectOptionAction = {
|
|
340
|
+
type: PollsStateActionTypes.SET_QUESTION_CORRECT_OPTION;
|
|
341
|
+
questionIndex: number;
|
|
342
|
+
optionIndex: number;
|
|
343
|
+
correctOption: boolean;
|
|
344
|
+
};
|
|
345
|
+
|
|
308
346
|
export type SetQuestionSkippable = {
|
|
309
347
|
type: PollsStateActionTypes.SET_QUESTION_SKIPPABLE;
|
|
310
348
|
questionIndex: number;
|
|
@@ -373,20 +411,31 @@ export type AddCuedPollIdAction = {
|
|
|
373
411
|
pollId: HMSPoll['pollId'];
|
|
374
412
|
};
|
|
375
413
|
|
|
414
|
+
export type AddLeaderboardAction = {
|
|
415
|
+
type: PollsStateActionTypes.ADD_LEADERBOARD;
|
|
416
|
+
pollId: HMSPoll['pollId'];
|
|
417
|
+
leaderboard: PollLeaderboardResponse;
|
|
418
|
+
};
|
|
419
|
+
|
|
376
420
|
export enum PollsStateActionTypes {
|
|
377
421
|
CLEAR_POLL_FORM_STATE = 'CLEAR_POLL_FORM_STATE',
|
|
378
422
|
SET_DELETE_CONFIRMATION_VISIBLE = 'SET_DELETE_CONFIRMATION_VISIBLE',
|
|
379
423
|
SET_POLL_NAME = 'SET_POLL_NAME',
|
|
380
424
|
SET_POLL_CONFIG = 'SET_POLL_CONFIG',
|
|
381
|
-
|
|
425
|
+
PUSH_TO_NAVIGATION_STACK = 'PUSH_TO_NAVIGATION_STACK',
|
|
426
|
+
RESET_NAVIGATION_STACK = 'RESET_NAVIGATION_STACK',
|
|
427
|
+
POP_FROM_NAVIGATION_STACK = 'POP_FROM_NAVIGATION_STACK',
|
|
428
|
+
REPLACE_TOP_OF_NAVIGATION_STACK = 'REPLACE_TOP_OF_NAVIGATION_STACK',
|
|
382
429
|
ADD_POLL_QUESTION = 'ADD_POLL_QUESTION',
|
|
383
430
|
DELETE_POLL_QUESTION = 'DELETE_POLL_QUESTION',
|
|
384
431
|
SET_SELECTED_QUESTION_INDEX = 'SET_SELECTED_QUESTION_INDEX',
|
|
385
432
|
SET_QUESTION_TYPE = 'SET_QUESTION_TYPE',
|
|
386
433
|
SET_QUESTION_TITLE = 'SET_QUESTION_TITLE',
|
|
434
|
+
SET_POINT_WEIGHTAGE = 'SET_POINT_WEIGHTAGE',
|
|
387
435
|
ADD_QUESTION_OPTION = 'ADD_QUESTION_OPTION',
|
|
388
436
|
DELETE_QUESTION_OPTION = 'DELETE_QUESTION_OPTION',
|
|
389
437
|
EDIT_QUESTION_OPTION = 'EDIT_QUESTION_OPTION',
|
|
438
|
+
SET_QUESTION_CORRECT_OPTION = 'SET_QUESTION_CORRECT_OPTION',
|
|
390
439
|
SET_QUESTION_SKIPPABLE = 'SET_QUESTION_SKIPPABLE',
|
|
391
440
|
SET_QUESTION_RES_EDITABLE = 'SET_QUESTION_RES_EDITABLE',
|
|
392
441
|
SET_QUESTION_SAVED = 'SET_QUESTION_SAVED',
|
|
@@ -399,4 +448,5 @@ export enum PollsStateActionTypes {
|
|
|
399
448
|
REMOVE_POLL_QUESTION_RESPONSE = 'REMOVE_POLL_QUESTION_RESPONSE',
|
|
400
449
|
ADD_POLL_QUESTION_RESPONSE = 'ADD_POLL_QUESTION_RESPONSE',
|
|
401
450
|
ADD_CUED_POLL_ID = 'ADD_CUED_POLL_ID',
|
|
451
|
+
ADD_LEADERBOARD = 'ADD_LEADERBOARD',
|
|
402
452
|
}
|
|
@@ -32,7 +32,6 @@ import type {
|
|
|
32
32
|
AddPollQuestionAction,
|
|
33
33
|
SetPollConfigAction,
|
|
34
34
|
SetPollNameAction,
|
|
35
|
-
SetPollStageAction,
|
|
36
35
|
DeletePollQuestionAction,
|
|
37
36
|
SetDeleteConfirmationVisible,
|
|
38
37
|
SetSelectedQuestionIndexAction,
|
|
@@ -52,6 +51,13 @@ import type {
|
|
|
52
51
|
AddPollQuestionResponseAction,
|
|
53
52
|
SetPollQuestionResponseAction,
|
|
54
53
|
RemovePollQuestionResponseAction,
|
|
54
|
+
SetQuestionPointWeightageAction,
|
|
55
|
+
SetQuestionCorrectOptionAction,
|
|
56
|
+
PushToNavigationStackAction,
|
|
57
|
+
PopFromNavigationStackAction,
|
|
58
|
+
ReplaceTopOfNavigationStackAction,
|
|
59
|
+
AddLeaderboardAction,
|
|
60
|
+
ResetNavigationStackAction,
|
|
55
61
|
} from '../actionTypes';
|
|
56
62
|
import { MeetingState } from '../../types';
|
|
57
63
|
import type { ChatState, Notification, PinnedMessage } from '../../types';
|
|
@@ -489,11 +495,26 @@ export const setPollConfig = (
|
|
|
489
495
|
pollConfig,
|
|
490
496
|
});
|
|
491
497
|
|
|
492
|
-
export const
|
|
493
|
-
|
|
494
|
-
):
|
|
495
|
-
type: PollsStateActionTypes.
|
|
496
|
-
|
|
498
|
+
export const pushToNavigationStack = (
|
|
499
|
+
screen: PushToNavigationStackAction['screen']
|
|
500
|
+
): PushToNavigationStackAction => ({
|
|
501
|
+
type: PollsStateActionTypes.PUSH_TO_NAVIGATION_STACK,
|
|
502
|
+
screen,
|
|
503
|
+
});
|
|
504
|
+
|
|
505
|
+
export const resetNavigationStack = (): ResetNavigationStackAction => ({
|
|
506
|
+
type: PollsStateActionTypes.RESET_NAVIGATION_STACK,
|
|
507
|
+
});
|
|
508
|
+
|
|
509
|
+
export const popFromNavigationStack = (): PopFromNavigationStackAction => ({
|
|
510
|
+
type: PollsStateActionTypes.POP_FROM_NAVIGATION_STACK,
|
|
511
|
+
});
|
|
512
|
+
|
|
513
|
+
export const replaceTopOfNavigationStack = (
|
|
514
|
+
screen: ReplaceTopOfNavigationStackAction['screen']
|
|
515
|
+
): ReplaceTopOfNavigationStackAction => ({
|
|
516
|
+
type: PollsStateActionTypes.REPLACE_TOP_OF_NAVIGATION_STACK,
|
|
517
|
+
screen,
|
|
497
518
|
});
|
|
498
519
|
|
|
499
520
|
export const addPollQuestion = (): AddPollQuestionAction => ({
|
|
@@ -529,6 +550,15 @@ export const setPollQuestionTitle = (
|
|
|
529
550
|
title,
|
|
530
551
|
});
|
|
531
552
|
|
|
553
|
+
export const setPollQuestionPointWeightage = (
|
|
554
|
+
questionIndex: SetQuestionPointWeightageAction['questionIndex'],
|
|
555
|
+
pointWeightage: SetQuestionPointWeightageAction['pointWeightage']
|
|
556
|
+
): SetQuestionPointWeightageAction => ({
|
|
557
|
+
type: PollsStateActionTypes.SET_POINT_WEIGHTAGE,
|
|
558
|
+
questionIndex,
|
|
559
|
+
pointWeightage,
|
|
560
|
+
});
|
|
561
|
+
|
|
532
562
|
export const addPollQuestionOption = (
|
|
533
563
|
questionIndex: AddQuestionOptionAction['questionIndex']
|
|
534
564
|
): AddQuestionOptionAction => ({
|
|
@@ -556,6 +586,17 @@ export const editPollQuestionOption = (
|
|
|
556
586
|
option,
|
|
557
587
|
});
|
|
558
588
|
|
|
589
|
+
export const setPollQuestionCorrectOption = (
|
|
590
|
+
questionIndex: SetQuestionCorrectOptionAction['questionIndex'],
|
|
591
|
+
optionIndex: SetQuestionCorrectOptionAction['optionIndex'],
|
|
592
|
+
correctOption: SetQuestionCorrectOptionAction['correctOption']
|
|
593
|
+
): SetQuestionCorrectOptionAction => ({
|
|
594
|
+
type: PollsStateActionTypes.SET_QUESTION_CORRECT_OPTION,
|
|
595
|
+
questionIndex,
|
|
596
|
+
optionIndex,
|
|
597
|
+
correctOption,
|
|
598
|
+
});
|
|
599
|
+
|
|
559
600
|
export const setPollQuestionSkippable = (
|
|
560
601
|
questionIndex: SetQuestionSkippable['questionIndex'],
|
|
561
602
|
skippable: boolean
|
|
@@ -650,3 +691,12 @@ export const addCuedPollId = (pollId: string) => ({
|
|
|
650
691
|
type: PollsStateActionTypes.ADD_CUED_POLL_ID,
|
|
651
692
|
pollId,
|
|
652
693
|
});
|
|
694
|
+
|
|
695
|
+
export const addLeaderboard = (
|
|
696
|
+
pollId: AddLeaderboardAction['pollId'],
|
|
697
|
+
leaderboard: AddLeaderboardAction['leaderboard']
|
|
698
|
+
): AddLeaderboardAction => ({
|
|
699
|
+
type: PollsStateActionTypes.ADD_LEADERBOARD,
|
|
700
|
+
pollId,
|
|
701
|
+
leaderboard,
|
|
702
|
+
});
|