@100mslive/react-native-room-kit 1.1.0 → 1.1.1
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/HMSRoomSetup.js +49 -0
- package/lib/commonjs/HMSRoomSetup.js.map +1 -1
- package/lib/commonjs/Icons/Add/assets/add-circle.png +0 -0
- package/lib/commonjs/Icons/Add/assets/add-circle@2x.png +0 -0
- package/lib/commonjs/Icons/Add/assets/add-circle@3x.png +0 -0
- package/lib/commonjs/Icons/Add/index.js +35 -0
- package/lib/commonjs/Icons/Add/index.js.map +1 -0
- package/lib/commonjs/Icons/CheckBox/assets/checkbox-checked.png +0 -0
- package/lib/commonjs/Icons/CheckBox/assets/checkbox-checked@2x.png +0 -0
- package/lib/commonjs/Icons/CheckBox/assets/checkbox-checked@3x.png +0 -0
- package/lib/commonjs/Icons/CheckBox/assets/checkbox.png +0 -0
- package/lib/commonjs/Icons/CheckBox/assets/checkbox@2x.png +0 -0
- package/lib/commonjs/Icons/CheckBox/assets/checkbox@3x.png +0 -0
- package/lib/commonjs/Icons/CheckBox/index.js +34 -0
- package/lib/commonjs/Icons/CheckBox/index.js.map +1 -0
- package/lib/commonjs/Icons/Poll/assets/poll.png +0 -0
- package/lib/commonjs/Icons/Poll/assets/poll@2x.png +0 -0
- package/lib/commonjs/Icons/Poll/assets/poll@3x.png +0 -0
- package/lib/commonjs/Icons/Poll/index.js +33 -0
- package/lib/commonjs/Icons/Poll/index.js.map +1 -0
- package/lib/commonjs/Icons/PollVote/assets/poll-vote.png +0 -0
- package/lib/commonjs/Icons/PollVote/assets/poll-vote@2x.png +0 -0
- package/lib/commonjs/Icons/PollVote/assets/poll-vote@3x.png +0 -0
- package/lib/commonjs/Icons/PollVote/index.js +33 -0
- package/lib/commonjs/Icons/PollVote/index.js.map +1 -0
- package/lib/commonjs/Icons/Quiz/assets/quiz.png +0 -0
- package/lib/commonjs/Icons/Quiz/assets/quiz@2x.png +0 -0
- package/lib/commonjs/Icons/Quiz/assets/quiz@3x.png +0 -0
- package/lib/commonjs/Icons/Quiz/index.js +33 -0
- package/lib/commonjs/Icons/Quiz/index.js.map +1 -0
- package/lib/commonjs/Icons/TrashBin/assets/trash-bin.png +0 -0
- package/lib/commonjs/Icons/TrashBin/assets/trash-bin@2x.png +0 -0
- package/lib/commonjs/Icons/TrashBin/assets/trash-bin@3x.png +0 -0
- package/lib/commonjs/Icons/TrashBin/index.js +34 -0
- package/lib/commonjs/Icons/TrashBin/index.js.map +1 -0
- package/lib/commonjs/Icons/index.js +66 -0
- package/lib/commonjs/Icons/index.js.map +1 -1
- package/lib/commonjs/components/CheckboxInputRow.js +53 -0
- package/lib/commonjs/components/CheckboxInputRow.js.map +1 -0
- package/lib/commonjs/components/CreatePoll.js +163 -0
- package/lib/commonjs/components/CreatePoll.js.map +1 -0
- package/lib/commonjs/components/Footer.js +6 -1
- package/lib/commonjs/components/Footer.js.map +1 -1
- package/lib/commonjs/components/HLSPlayerEmoticons.js +2 -3
- package/lib/commonjs/components/HLSPlayerEmoticons.js.map +1 -1
- package/lib/commonjs/components/HMSBaseButton.js +4 -2
- package/lib/commonjs/components/HMSBaseButton.js.map +1 -1
- package/lib/commonjs/components/HMSNotification.js +5 -1
- package/lib/commonjs/components/HMSNotification.js.map +1 -1
- package/lib/commonjs/components/HMSNotifications.js +4 -0
- package/lib/commonjs/components/HMSNotifications.js.map +1 -1
- package/lib/commonjs/components/HMSPollsQuizzesNotification.js +95 -0
- package/lib/commonjs/components/HMSPollsQuizzesNotification.js.map +1 -0
- package/lib/commonjs/components/HMSRoomOptions.js +2 -1
- package/lib/commonjs/components/HMSRoomOptions.js.map +1 -1
- package/lib/commonjs/components/HMSSecondaryButton.js +56 -0
- package/lib/commonjs/components/HMSSecondaryButton.js.map +1 -0
- package/lib/commonjs/components/PollAndQuizQuestionResponseCard.js +185 -0
- package/lib/commonjs/components/PollAndQuizQuestionResponseCard.js.map +1 -0
- package/lib/commonjs/components/PollAndQuizVoting.js +136 -0
- package/lib/commonjs/components/PollAndQuizVoting.js.map +1 -0
- package/lib/commonjs/components/PollAndQuizzStateLabel.js +72 -0
- package/lib/commonjs/components/PollAndQuizzStateLabel.js.map +1 -0
- package/lib/commonjs/components/PollQDeleteConfirmationSheetView.js +68 -0
- package/lib/commonjs/components/PollQDeleteConfirmationSheetView.js.map +1 -0
- package/lib/commonjs/components/PollQuestion.js +368 -0
- package/lib/commonjs/components/PollQuestion.js.map +1 -0
- package/lib/commonjs/components/PollQuestionDeleteConfirmation.js +97 -0
- package/lib/commonjs/components/PollQuestionDeleteConfirmation.js.map +1 -0
- package/lib/commonjs/components/PollQuestions.js +189 -0
- package/lib/commonjs/components/PollQuestions.js.map +1 -0
- package/lib/commonjs/components/PollResponseProgressView.js +68 -0
- package/lib/commonjs/components/PollResponseProgressView.js.map +1 -0
- package/lib/commonjs/components/PollsAndQuizBottomSheet.js +59 -0
- package/lib/commonjs/components/PollsAndQuizBottomSheet.js.map +1 -0
- package/lib/commonjs/components/PollsAndQuizzesCard.js +97 -0
- package/lib/commonjs/components/PollsAndQuizzesCard.js.map +1 -0
- package/lib/commonjs/components/PollsAndQuizzesModalContent.js +159 -0
- package/lib/commonjs/components/PollsAndQuizzesModalContent.js.map +1 -0
- package/lib/commonjs/components/PollsConfigAndList.js +32 -0
- package/lib/commonjs/components/PollsConfigAndList.js.map +1 -0
- package/lib/commonjs/components/PreviousPollsAndQuizzesList.js +76 -0
- package/lib/commonjs/components/PreviousPollsAndQuizzesList.js.map +1 -0
- package/lib/commonjs/components/RadioInput.js +42 -0
- package/lib/commonjs/components/RadioInput.js.map +1 -0
- package/lib/commonjs/components/RadioInputRow.js +57 -0
- package/lib/commonjs/components/RadioInputRow.js.map +1 -0
- package/lib/commonjs/components/RoomSettingsModalContent.js +31 -6
- package/lib/commonjs/components/RoomSettingsModalContent.js.map +1 -1
- package/lib/commonjs/components/SwitchRow.js +2 -1
- package/lib/commonjs/components/SwitchRow.js.map +1 -1
- package/lib/commonjs/hooks-util.js +26 -1
- package/lib/commonjs/hooks-util.js.map +1 -1
- package/lib/commonjs/redux/actionTypes.js +38 -1
- package/lib/commonjs/redux/actionTypes.js.map +1 -1
- package/lib/commonjs/redux/actions/index.js +140 -1
- package/lib/commonjs/redux/actions/index.js.map +1 -1
- package/lib/commonjs/redux/reducers/index.js +3 -1
- package/lib/commonjs/redux/reducers/index.js.map +1 -1
- package/lib/commonjs/redux/reducers/polls.js +251 -0
- package/lib/commonjs/redux/reducers/polls.js.map +1 -0
- package/lib/commonjs/types.js +1 -0
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils/functions.js +6 -1
- package/lib/commonjs/utils/functions.js.map +1 -1
- package/lib/commonjs/utils/types.js +1 -0
- package/lib/commonjs/utils/types.js.map +1 -1
- package/lib/module/HMSRoomSetup.js +52 -3
- package/lib/module/HMSRoomSetup.js.map +1 -1
- package/lib/module/Icons/Add/assets/add-circle.png +0 -0
- package/lib/module/Icons/Add/assets/add-circle@2x.png +0 -0
- package/lib/module/Icons/Add/assets/add-circle@3x.png +0 -0
- package/lib/module/Icons/Add/index.js +27 -0
- package/lib/module/Icons/Add/index.js.map +1 -0
- package/lib/module/Icons/CheckBox/assets/checkbox-checked.png +0 -0
- package/lib/module/Icons/CheckBox/assets/checkbox-checked@2x.png +0 -0
- package/lib/module/Icons/CheckBox/assets/checkbox-checked@3x.png +0 -0
- package/lib/module/Icons/CheckBox/assets/checkbox.png +0 -0
- package/lib/module/Icons/CheckBox/assets/checkbox@2x.png +0 -0
- package/lib/module/Icons/CheckBox/assets/checkbox@3x.png +0 -0
- package/lib/module/Icons/CheckBox/index.js +26 -0
- package/lib/module/Icons/CheckBox/index.js.map +1 -0
- package/lib/module/Icons/Poll/assets/poll.png +0 -0
- package/lib/module/Icons/Poll/assets/poll@2x.png +0 -0
- package/lib/module/Icons/Poll/assets/poll@3x.png +0 -0
- package/lib/module/Icons/Poll/index.js +25 -0
- package/lib/module/Icons/Poll/index.js.map +1 -0
- package/lib/module/Icons/PollVote/assets/poll-vote.png +0 -0
- package/lib/module/Icons/PollVote/assets/poll-vote@2x.png +0 -0
- package/lib/module/Icons/PollVote/assets/poll-vote@3x.png +0 -0
- package/lib/module/Icons/PollVote/index.js +25 -0
- package/lib/module/Icons/PollVote/index.js.map +1 -0
- package/lib/module/Icons/Quiz/assets/quiz.png +0 -0
- package/lib/module/Icons/Quiz/assets/quiz@2x.png +0 -0
- package/lib/module/Icons/Quiz/assets/quiz@3x.png +0 -0
- package/lib/module/Icons/Quiz/index.js +25 -0
- package/lib/module/Icons/Quiz/index.js.map +1 -0
- package/lib/module/Icons/TrashBin/assets/trash-bin.png +0 -0
- package/lib/module/Icons/TrashBin/assets/trash-bin@2x.png +0 -0
- package/lib/module/Icons/TrashBin/assets/trash-bin@3x.png +0 -0
- package/lib/module/Icons/TrashBin/index.js +26 -0
- package/lib/module/Icons/TrashBin/index.js.map +1 -0
- package/lib/module/Icons/index.js +6 -0
- package/lib/module/Icons/index.js.map +1 -1
- package/lib/module/components/CheckboxInputRow.js +45 -0
- package/lib/module/components/CheckboxInputRow.js.map +1 -0
- package/lib/module/components/CreatePoll.js +155 -0
- package/lib/module/components/CreatePoll.js.map +1 -0
- package/lib/module/components/Footer.js +6 -1
- package/lib/module/components/Footer.js.map +1 -1
- package/lib/module/components/HLSPlayerEmoticons.js +2 -3
- package/lib/module/components/HLSPlayerEmoticons.js.map +1 -1
- package/lib/module/components/HMSBaseButton.js +5 -3
- package/lib/module/components/HMSBaseButton.js.map +1 -1
- package/lib/module/components/HMSNotification.js +5 -1
- package/lib/module/components/HMSNotification.js.map +1 -1
- package/lib/module/components/HMSNotifications.js +4 -0
- package/lib/module/components/HMSNotifications.js.map +1 -1
- package/lib/module/components/HMSPollsQuizzesNotification.js +86 -0
- package/lib/module/components/HMSPollsQuizzesNotification.js.map +1 -0
- package/lib/module/components/HMSRoomOptions.js +2 -1
- package/lib/module/components/HMSRoomOptions.js.map +1 -1
- package/lib/module/components/HMSSecondaryButton.js +47 -0
- package/lib/module/components/HMSSecondaryButton.js.map +1 -0
- package/lib/module/components/PollAndQuizQuestionResponseCard.js +176 -0
- package/lib/module/components/PollAndQuizQuestionResponseCard.js.map +1 -0
- package/lib/module/components/PollAndQuizVoting.js +127 -0
- package/lib/module/components/PollAndQuizVoting.js.map +1 -0
- package/lib/module/components/PollAndQuizzStateLabel.js +63 -0
- package/lib/module/components/PollAndQuizzStateLabel.js.map +1 -0
- package/lib/module/components/PollQDeleteConfirmationSheetView.js +60 -0
- package/lib/module/components/PollQDeleteConfirmationSheetView.js.map +1 -0
- package/lib/module/components/PollQuestion.js +359 -0
- package/lib/module/components/PollQuestion.js.map +1 -0
- package/lib/module/components/PollQuestionDeleteConfirmation.js +88 -0
- package/lib/module/components/PollQuestionDeleteConfirmation.js.map +1 -0
- package/lib/module/components/PollQuestions.js +180 -0
- package/lib/module/components/PollQuestions.js.map +1 -0
- package/lib/module/components/PollResponseProgressView.js +59 -0
- package/lib/module/components/PollResponseProgressView.js.map +1 -0
- package/lib/module/components/PollsAndQuizBottomSheet.js +50 -0
- package/lib/module/components/PollsAndQuizBottomSheet.js.map +1 -0
- package/lib/module/components/PollsAndQuizzesCard.js +88 -0
- package/lib/module/components/PollsAndQuizzesCard.js.map +1 -0
- package/lib/module/components/PollsAndQuizzesModalContent.js +150 -0
- package/lib/module/components/PollsAndQuizzesModalContent.js.map +1 -0
- package/lib/module/components/PollsConfigAndList.js +23 -0
- package/lib/module/components/PollsConfigAndList.js.map +1 -0
- package/lib/module/components/PreviousPollsAndQuizzesList.js +67 -0
- package/lib/module/components/PreviousPollsAndQuizzesList.js.map +1 -0
- package/lib/module/components/RadioInput.js +34 -0
- package/lib/module/components/RadioInput.js.map +1 -0
- package/lib/module/components/RadioInputRow.js +49 -0
- package/lib/module/components/RadioInputRow.js.map +1 -0
- package/lib/module/components/RoomSettingsModalContent.js +32 -7
- package/lib/module/components/RoomSettingsModalContent.js.map +1 -1
- package/lib/module/components/SwitchRow.js +2 -1
- package/lib/module/components/SwitchRow.js.map +1 -1
- package/lib/module/hooks-util.js +26 -2
- package/lib/module/hooks-util.js.map +1 -1
- package/lib/module/redux/actionTypes.js +39 -0
- package/lib/module/redux/actionTypes.js.map +1 -1
- package/lib/module/redux/actions/index.js +116 -1
- package/lib/module/redux/actions/index.js.map +1 -1
- package/lib/module/redux/reducers/index.js +3 -1
- package/lib/module/redux/reducers/index.js.map +1 -1
- package/lib/module/redux/reducers/polls.js +245 -0
- package/lib/module/redux/reducers/polls.js.map +1 -0
- package/lib/module/types.js +1 -0
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/functions.js +5 -1
- package/lib/module/utils/functions.js.map +1 -1
- package/lib/module/utils/types.js +1 -0
- package/lib/module/utils/types.js.map +1 -1
- package/lib/typescript/HMSRoomSetup.d.ts.map +1 -1
- package/lib/typescript/Icons/Add/index.d.ts +8 -0
- package/lib/typescript/Icons/Add/index.d.ts.map +1 -0
- package/lib/typescript/Icons/CheckBox/index.d.ts +8 -0
- package/lib/typescript/Icons/CheckBox/index.d.ts.map +1 -0
- package/lib/typescript/Icons/Poll/index.d.ts +7 -0
- package/lib/typescript/Icons/Poll/index.d.ts.map +1 -0
- package/lib/typescript/Icons/PollVote/index.d.ts +7 -0
- package/lib/typescript/Icons/PollVote/index.d.ts.map +1 -0
- package/lib/typescript/Icons/Quiz/index.d.ts +7 -0
- package/lib/typescript/Icons/Quiz/index.d.ts.map +1 -0
- package/lib/typescript/Icons/TrashBin/index.d.ts +7 -0
- package/lib/typescript/Icons/TrashBin/index.d.ts.map +1 -0
- package/lib/typescript/Icons/index.d.ts +6 -0
- package/lib/typescript/Icons/index.d.ts.map +1 -1
- package/lib/typescript/components/CheckboxInputRow.d.ts +13 -0
- package/lib/typescript/components/CheckboxInputRow.d.ts.map +1 -0
- package/lib/typescript/components/CreatePoll.d.ts +5 -0
- package/lib/typescript/components/CreatePoll.d.ts.map +1 -0
- package/lib/typescript/components/Footer.d.ts.map +1 -1
- package/lib/typescript/components/HLSPlayerEmoticons.d.ts.map +1 -1
- package/lib/typescript/components/HMSBaseButton.d.ts +2 -1
- package/lib/typescript/components/HMSBaseButton.d.ts.map +1 -1
- package/lib/typescript/components/HMSNotifications.d.ts.map +1 -1
- package/lib/typescript/components/HMSPollsQuizzesNotification.d.ts +7 -0
- package/lib/typescript/components/HMSPollsQuizzesNotification.d.ts.map +1 -0
- package/lib/typescript/components/HMSPrimaryButton.d.ts +1 -1
- package/lib/typescript/components/HMSPrimaryButton.d.ts.map +1 -1
- package/lib/typescript/components/HMSRoomOptions.d.ts.map +1 -1
- package/lib/typescript/components/HMSSecondaryButton.d.ts +15 -0
- package/lib/typescript/components/HMSSecondaryButton.d.ts.map +1 -0
- package/lib/typescript/components/PollAndQuizQuestionResponseCard.d.ts +13 -0
- package/lib/typescript/components/PollAndQuizQuestionResponseCard.d.ts.map +1 -0
- package/lib/typescript/components/PollAndQuizVoting.d.ts +6 -0
- package/lib/typescript/components/PollAndQuizVoting.d.ts.map +1 -0
- package/lib/typescript/components/PollAndQuizzStateLabel.d.ts +7 -0
- package/lib/typescript/components/PollAndQuizzStateLabel.d.ts.map +1 -0
- package/lib/typescript/components/PollQDeleteConfirmationSheetView.d.ts +6 -0
- package/lib/typescript/components/PollQDeleteConfirmationSheetView.d.ts.map +1 -0
- package/lib/typescript/components/PollQuestion.d.ts +14 -0
- package/lib/typescript/components/PollQuestion.d.ts.map +1 -0
- package/lib/typescript/components/PollQuestionDeleteConfirmation.d.ts +6 -0
- package/lib/typescript/components/PollQuestionDeleteConfirmation.d.ts.map +1 -0
- package/lib/typescript/components/PollQuestions.d.ts +6 -0
- package/lib/typescript/components/PollQuestions.d.ts.map +1 -0
- package/lib/typescript/components/PollResponseProgressView.d.ts +9 -0
- package/lib/typescript/components/PollResponseProgressView.d.ts.map +1 -0
- package/lib/typescript/components/PollsAndQuizBottomSheet.d.ts +3 -0
- package/lib/typescript/components/PollsAndQuizBottomSheet.d.ts.map +1 -0
- package/lib/typescript/components/PollsAndQuizzesCard.d.ts +7 -0
- package/lib/typescript/components/PollsAndQuizzesCard.d.ts.map +1 -0
- package/lib/typescript/components/PollsAndQuizzesModalContent.d.ts +7 -0
- package/lib/typescript/components/PollsAndQuizzesModalContent.d.ts.map +1 -0
- package/lib/typescript/components/PollsConfigAndList.d.ts +5 -0
- package/lib/typescript/components/PollsConfigAndList.d.ts.map +1 -0
- package/lib/typescript/components/PreviousPollsAndQuizzesList.d.ts +5 -0
- package/lib/typescript/components/PreviousPollsAndQuizzesList.d.ts.map +1 -0
- package/lib/typescript/components/RadioInput.d.ts +9 -0
- package/lib/typescript/components/RadioInput.d.ts.map +1 -0
- package/lib/typescript/components/RadioInputRow.d.ts +16 -0
- package/lib/typescript/components/RadioInputRow.d.ts.map +1 -0
- package/lib/typescript/components/RoomSettingsModalContent.d.ts.map +1 -1
- package/lib/typescript/components/SwitchRow.d.ts +2 -1
- package/lib/typescript/components/SwitchRow.d.ts.map +1 -1
- package/lib/typescript/hooks-util.d.ts +1 -0
- package/lib/typescript/hooks-util.d.ts.map +1 -1
- package/lib/typescript/redux/actionTypes.d.ts +161 -0
- package/lib/typescript/redux/actionTypes.d.ts.map +1 -1
- package/lib/typescript/redux/actions/index.d.ts +36 -2
- package/lib/typescript/redux/actions/index.d.ts.map +1 -1
- package/lib/typescript/redux/index.d.ts +13 -0
- package/lib/typescript/redux/index.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/index.d.ts +13 -0
- package/lib/typescript/redux/reducers/index.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/polls.d.ts +19 -0
- package/lib/typescript/redux/reducers/polls.d.ts.map +1 -0
- package/lib/typescript/types.d.ts +3 -1
- package/lib/typescript/types.d.ts.map +1 -1
- package/lib/typescript/utils/functions.d.ts +2 -0
- package/lib/typescript/utils/functions.d.ts.map +1 -1
- package/lib/typescript/utils/types.d.ts +1 -0
- package/lib/typescript/utils/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/HMSRoomSetup.tsx +61 -0
- package/src/Icons/Add/assets/add-circle.png +0 -0
- package/src/Icons/Add/assets/add-circle@2x.png +0 -0
- package/src/Icons/Add/assets/add-circle@3x.png +0 -0
- package/src/Icons/Add/index.tsx +37 -0
- package/src/Icons/CheckBox/assets/checkbox-checked.png +0 -0
- package/src/Icons/CheckBox/assets/checkbox-checked@2x.png +0 -0
- package/src/Icons/CheckBox/assets/checkbox-checked@3x.png +0 -0
- package/src/Icons/CheckBox/assets/checkbox.png +0 -0
- package/src/Icons/CheckBox/assets/checkbox@2x.png +0 -0
- package/src/Icons/CheckBox/assets/checkbox@3x.png +0 -0
- package/src/Icons/CheckBox/index.tsx +40 -0
- package/src/Icons/Poll/assets/poll.png +0 -0
- package/src/Icons/Poll/assets/poll@2x.png +0 -0
- package/src/Icons/Poll/assets/poll@3x.png +0 -0
- package/src/Icons/Poll/index.tsx +30 -0
- package/src/Icons/PollVote/assets/poll-vote.png +0 -0
- package/src/Icons/PollVote/assets/poll-vote@2x.png +0 -0
- package/src/Icons/PollVote/assets/poll-vote@3x.png +0 -0
- package/src/Icons/PollVote/index.tsx +33 -0
- package/src/Icons/Quiz/assets/quiz.png +0 -0
- package/src/Icons/Quiz/assets/quiz@2x.png +0 -0
- package/src/Icons/Quiz/assets/quiz@3x.png +0 -0
- package/src/Icons/Quiz/index.tsx +30 -0
- package/src/Icons/TrashBin/assets/trash-bin.png +0 -0
- package/src/Icons/TrashBin/assets/trash-bin@2x.png +0 -0
- package/src/Icons/TrashBin/assets/trash-bin@3x.png +0 -0
- package/src/Icons/TrashBin/index.tsx +34 -0
- package/src/Icons/index.ts +6 -0
- package/src/components/CheckboxInputRow.tsx +68 -0
- package/src/components/CreatePoll.tsx +176 -0
- package/src/components/Footer.tsx +7 -1
- package/src/components/HLSPlayerEmoticons.tsx +2 -3
- package/src/components/HMSBaseButton.tsx +8 -3
- package/src/components/HMSNotification.tsx +1 -1
- package/src/components/HMSNotifications.tsx +7 -0
- package/src/components/HMSPollsQuizzesNotification.tsx +110 -0
- package/src/components/HMSPrimaryButton.tsx +1 -1
- package/src/components/HMSRoomOptions.tsx +3 -0
- package/src/components/HMSSecondaryButton.tsx +72 -0
- package/src/components/PollAndQuizQuestionResponseCard.tsx +311 -0
- package/src/components/PollAndQuizVoting.tsx +157 -0
- package/src/components/PollAndQuizzStateLabel.tsx +83 -0
- package/src/components/PollQDeleteConfirmationSheetView.tsx +82 -0
- package/src/components/PollQuestion.tsx +553 -0
- package/src/components/PollQuestionDeleteConfirmation.tsx +110 -0
- package/src/components/PollQuestions.tsx +259 -0
- package/src/components/PollResponseProgressView.tsx +77 -0
- package/src/components/PollsAndQuizBottomSheet.tsx +83 -0
- package/src/components/PollsAndQuizzesCard.tsx +111 -0
- package/src/components/PollsAndQuizzesModalContent.tsx +198 -0
- package/src/components/PollsConfigAndList.tsx +29 -0
- package/src/components/PreviousPollsAndQuizzesList.tsx +103 -0
- package/src/components/RadioInput.tsx +44 -0
- package/src/components/RadioInputRow.tsx +73 -0
- package/src/components/RoomSettingsModalContent.tsx +23 -0
- package/src/components/SwitchRow.tsx +4 -2
- package/src/hooks-util.ts +41 -0
- package/src/redux/actionTypes.ts +221 -0
- package/src/redux/actions/index.ts +218 -1
- package/src/redux/reducers/index.ts +2 -0
- package/src/redux/reducers/polls.ts +328 -0
- package/src/types.ts +2 -0
- package/src/utils/functions.ts +14 -0
- package/src/utils/types.ts +1 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
View,
|
|
4
|
+
Text,
|
|
5
|
+
StyleSheet,
|
|
6
|
+
TouchableOpacity,
|
|
7
|
+
Keyboard,
|
|
8
|
+
} from 'react-native';
|
|
9
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
10
|
+
|
|
11
|
+
import type { RootState } from '../redux';
|
|
12
|
+
import { useHMSRoomStyleSheet } from '../hooks-util';
|
|
13
|
+
import { BottomSheet } from './BottomSheet';
|
|
14
|
+
import { ChevronIcon, CloseIcon } from '../Icons';
|
|
15
|
+
import { TestIds } from '../utils/constants';
|
|
16
|
+
import { PollQuestions } from './PollQuestions';
|
|
17
|
+
import { CreatePollStages } from '../redux/actionTypes';
|
|
18
|
+
import { setPollStage } from '../redux/actions';
|
|
19
|
+
import { PollQDeleteConfirmationSheetView } from './PollQDeleteConfirmationSheetView';
|
|
20
|
+
import { PollsConfigAndList } from './PollsConfigAndList';
|
|
21
|
+
import { PollAndQuizVoting } from './PollAndQuizVoting';
|
|
22
|
+
import { PollAndQuizzStateLabel } from './PollAndQuizzStateLabel';
|
|
23
|
+
|
|
24
|
+
export interface PollsAndQuizzesModalContentProps {
|
|
25
|
+
fullHeight: boolean;
|
|
26
|
+
dismissModal(): void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const PollsAndQuizzesModalContent: React.FC<
|
|
30
|
+
PollsAndQuizzesModalContentProps
|
|
31
|
+
> = ({ fullHeight, dismissModal }) => {
|
|
32
|
+
const dispatch = useDispatch();
|
|
33
|
+
const headerTitle = useSelector((state: RootState) => {
|
|
34
|
+
const pollsData = state.polls;
|
|
35
|
+
if (pollsData.stage === CreatePollStages.POLL_QUESTION_CONFIG) {
|
|
36
|
+
return pollsData.pollName;
|
|
37
|
+
}
|
|
38
|
+
if (
|
|
39
|
+
pollsData.stage === CreatePollStages.POLL_VOTING &&
|
|
40
|
+
pollsData.selectedPollId !== null
|
|
41
|
+
) {
|
|
42
|
+
return pollsData.polls[pollsData.selectedPollId]?.title || null;
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
});
|
|
46
|
+
const selectedPoll = useSelector((state: RootState) => {
|
|
47
|
+
const pollsData = state.polls;
|
|
48
|
+
if (
|
|
49
|
+
pollsData.stage === CreatePollStages.POLL_VOTING &&
|
|
50
|
+
pollsData.selectedPollId !== null
|
|
51
|
+
) {
|
|
52
|
+
return pollsData.polls[pollsData.selectedPollId] || null;
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
});
|
|
56
|
+
const pollsStage = useSelector((state: RootState) => state.polls.stage);
|
|
57
|
+
const launchingPoll = useSelector(
|
|
58
|
+
(state: RootState) => state.polls.launchingPoll
|
|
59
|
+
);
|
|
60
|
+
const canCreateOrEndPoll = useSelector((state: RootState) => {
|
|
61
|
+
const permissions = state.hmsStates.localPeer?.role?.permissions;
|
|
62
|
+
return permissions?.pollWrite;
|
|
63
|
+
});
|
|
64
|
+
const canVoteOnPoll = useSelector((state: RootState) => {
|
|
65
|
+
const permissions = state.hmsStates.localPeer?.role?.permissions;
|
|
66
|
+
return permissions?.pollRead;
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const hmsRoomStyles = useHMSRoomStyleSheet((theme, typography) => ({
|
|
70
|
+
headerText: {
|
|
71
|
+
color: theme.palette.on_surface_high,
|
|
72
|
+
fontFamily: `${typography.font_family}-SemiBold`,
|
|
73
|
+
},
|
|
74
|
+
}));
|
|
75
|
+
|
|
76
|
+
const handleBackPress = () => {
|
|
77
|
+
Keyboard.dismiss();
|
|
78
|
+
dispatch(setPollStage(CreatePollStages.POLL_CONFIG));
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const handleClosePress = () => {
|
|
82
|
+
Keyboard.dismiss();
|
|
83
|
+
dismissModal();
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<View style={fullHeight ? styles.fullView : null}>
|
|
88
|
+
{/* Header */}
|
|
89
|
+
<View style={styles.header}>
|
|
90
|
+
<View style={styles.headerControls}>
|
|
91
|
+
{headerTitle ? (
|
|
92
|
+
<TouchableOpacity
|
|
93
|
+
onPress={handleBackPress}
|
|
94
|
+
disabled={launchingPoll}
|
|
95
|
+
hitSlop={styles.closeIconHitSlop}
|
|
96
|
+
style={[styles.backIcon, launchingPoll ? { opacity: 0.4 } : null]}
|
|
97
|
+
>
|
|
98
|
+
<ChevronIcon direction="left" />
|
|
99
|
+
</TouchableOpacity>
|
|
100
|
+
) : null}
|
|
101
|
+
|
|
102
|
+
<Text
|
|
103
|
+
testID={TestIds.change_name_modal_heading}
|
|
104
|
+
numberOfLines={2}
|
|
105
|
+
style={[
|
|
106
|
+
styles.headerText,
|
|
107
|
+
{ flexShrink: 1 },
|
|
108
|
+
hmsRoomStyles.headerText,
|
|
109
|
+
]}
|
|
110
|
+
>
|
|
111
|
+
{headerTitle ?? ('Polls' || 'Polls and Quizzes')}
|
|
112
|
+
</Text>
|
|
113
|
+
|
|
114
|
+
{selectedPoll?.state ? (
|
|
115
|
+
<PollAndQuizzStateLabel state={selectedPoll?.state} />
|
|
116
|
+
) : null}
|
|
117
|
+
</View>
|
|
118
|
+
|
|
119
|
+
<TouchableOpacity
|
|
120
|
+
testID={TestIds.change_name_modal_close_btn}
|
|
121
|
+
onPress={handleClosePress}
|
|
122
|
+
hitSlop={styles.closeIconHitSlop}
|
|
123
|
+
style={{ marginLeft: 16 }}
|
|
124
|
+
>
|
|
125
|
+
<CloseIcon />
|
|
126
|
+
</TouchableOpacity>
|
|
127
|
+
</View>
|
|
128
|
+
|
|
129
|
+
{/* Divider */}
|
|
130
|
+
<BottomSheet.Divider
|
|
131
|
+
style={fullHeight ? styles.halfDivider : styles.divider}
|
|
132
|
+
/>
|
|
133
|
+
|
|
134
|
+
{/* Content */}
|
|
135
|
+
<View style={fullHeight ? styles.fullView : null}>
|
|
136
|
+
{pollsStage === CreatePollStages.POLL_CONFIG ? (
|
|
137
|
+
<PollsConfigAndList />
|
|
138
|
+
) : pollsStage === CreatePollStages.POLL_QUESTION_CONFIG &&
|
|
139
|
+
canCreateOrEndPoll ? (
|
|
140
|
+
<PollQuestions dismissModal={dismissModal} />
|
|
141
|
+
) : pollsStage === CreatePollStages.POLL_VOTING &&
|
|
142
|
+
(canVoteOnPoll || canCreateOrEndPoll) ? (
|
|
143
|
+
<PollAndQuizVoting dismissModal={dismissModal} />
|
|
144
|
+
) : null}
|
|
145
|
+
</View>
|
|
146
|
+
|
|
147
|
+
{/* Modal */}
|
|
148
|
+
<PollQDeleteConfirmationSheetView />
|
|
149
|
+
</View>
|
|
150
|
+
);
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
const styles = StyleSheet.create({
|
|
154
|
+
// Utilities
|
|
155
|
+
fullView: {
|
|
156
|
+
flex: 1,
|
|
157
|
+
},
|
|
158
|
+
// Header
|
|
159
|
+
header: {
|
|
160
|
+
flexDirection: 'row',
|
|
161
|
+
alignItems: 'center',
|
|
162
|
+
justifyContent: 'space-between',
|
|
163
|
+
marginTop: 24,
|
|
164
|
+
marginHorizontal: 24,
|
|
165
|
+
},
|
|
166
|
+
headerControls: {
|
|
167
|
+
flexDirection: 'row',
|
|
168
|
+
alignItems: 'center',
|
|
169
|
+
flexShrink: 1,
|
|
170
|
+
},
|
|
171
|
+
headerText: {
|
|
172
|
+
fontSize: 20,
|
|
173
|
+
lineHeight: 24,
|
|
174
|
+
letterSpacing: 0.15,
|
|
175
|
+
marginRight: 12,
|
|
176
|
+
},
|
|
177
|
+
closeIconHitSlop: {
|
|
178
|
+
bottom: 16,
|
|
179
|
+
left: 16,
|
|
180
|
+
right: 16,
|
|
181
|
+
top: 16,
|
|
182
|
+
},
|
|
183
|
+
backIcon: {
|
|
184
|
+
marginRight: 8,
|
|
185
|
+
},
|
|
186
|
+
// Divider
|
|
187
|
+
halfDivider: {
|
|
188
|
+
marginHorizontal: 24,
|
|
189
|
+
marginVertical: 0,
|
|
190
|
+
marginTop: 24,
|
|
191
|
+
width: undefined,
|
|
192
|
+
},
|
|
193
|
+
divider: {
|
|
194
|
+
marginHorizontal: 24,
|
|
195
|
+
marginVertical: 24,
|
|
196
|
+
width: undefined,
|
|
197
|
+
},
|
|
198
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ScrollView } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { CreatePoll } from './CreatePoll';
|
|
5
|
+
import { PreviousPollsAndQuizzesList } from './PreviousPollsAndQuizzesList';
|
|
6
|
+
import { useSelector } from 'react-redux';
|
|
7
|
+
import type { RootState } from 'src/redux';
|
|
8
|
+
|
|
9
|
+
export interface PollsConfigAndListProps {}
|
|
10
|
+
|
|
11
|
+
export const PollsConfigAndList: React.FC<PollsConfigAndListProps> = ({}) => {
|
|
12
|
+
const canCreateOrEndPoll = useSelector((state: RootState) => {
|
|
13
|
+
const permissions = state.hmsStates.localPeer?.role?.permissions;
|
|
14
|
+
return permissions?.pollWrite;
|
|
15
|
+
});
|
|
16
|
+
const canVoteOnPoll = useSelector((state: RootState) => {
|
|
17
|
+
const permissions = state.hmsStates.localPeer?.role?.permissions;
|
|
18
|
+
return permissions?.pollRead;
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<ScrollView contentContainerStyle={{ paddingBottom: 24 }}>
|
|
23
|
+
{canCreateOrEndPoll ? <CreatePoll /> : null}
|
|
24
|
+
{canVoteOnPoll || canCreateOrEndPoll ? (
|
|
25
|
+
<PreviousPollsAndQuizzesList />
|
|
26
|
+
) : null}
|
|
27
|
+
</ScrollView>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { View, Text, StyleSheet } from 'react-native';
|
|
3
|
+
import { useSelector } from 'react-redux';
|
|
4
|
+
|
|
5
|
+
import { useHMSRoomStyleSheet, useIsHLSViewer } from '../hooks-util';
|
|
6
|
+
import { PollsAndQuizzesCard } from './PollsAndQuizzesCard';
|
|
7
|
+
import type { RootState } from '../redux';
|
|
8
|
+
import { visiblePollsSelector } from '../utils/functions';
|
|
9
|
+
|
|
10
|
+
export interface PreviousPollsAndQuizzesListProps {}
|
|
11
|
+
|
|
12
|
+
export const PreviousPollsAndQuizzesList: React.FC<
|
|
13
|
+
PreviousPollsAndQuizzesListProps
|
|
14
|
+
> = ({}) => {
|
|
15
|
+
const isHLSViewer = useIsHLSViewer();
|
|
16
|
+
const polls = useSelector((state: RootState) => state.polls.polls);
|
|
17
|
+
const hlsCuedPollIds = useSelector(
|
|
18
|
+
(state: RootState) => state.polls.cuedPollIds
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
const canCreateOrEndPoll = useSelector((state: RootState) => {
|
|
22
|
+
const permissions = state.hmsStates.localPeer?.role?.permissions;
|
|
23
|
+
return permissions?.pollWrite;
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const hmsRoomStyles = useHMSRoomStyleSheet((theme, typography) => ({
|
|
27
|
+
surfaceHighSemiBoldText: {
|
|
28
|
+
color: theme.palette.on_surface_high,
|
|
29
|
+
fontFamily: `${typography.font_family}-SemiBold`,
|
|
30
|
+
},
|
|
31
|
+
surfaceHighRegularText: {
|
|
32
|
+
color: theme.palette.on_surface_high,
|
|
33
|
+
fontFamily: `${typography.font_family}-Regular`,
|
|
34
|
+
},
|
|
35
|
+
}));
|
|
36
|
+
|
|
37
|
+
const pollsList = visiblePollsSelector(
|
|
38
|
+
Object.values(polls),
|
|
39
|
+
isHLSViewer,
|
|
40
|
+
hlsCuedPollIds
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
if (pollsList.length === 0 && !canCreateOrEndPoll) {
|
|
44
|
+
return (
|
|
45
|
+
<View style={styles.contentContainer}>
|
|
46
|
+
<Text
|
|
47
|
+
style={[
|
|
48
|
+
styles.subtitle,
|
|
49
|
+
hmsRoomStyles.surfaceHighRegularText,
|
|
50
|
+
styles.emptyList,
|
|
51
|
+
]}
|
|
52
|
+
>
|
|
53
|
+
No Polls to show
|
|
54
|
+
</Text>
|
|
55
|
+
</View>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<View style={styles.contentContainer}>
|
|
61
|
+
{pollsList.length > 0 && (
|
|
62
|
+
<Text style={[styles.title, hmsRoomStyles.surfaceHighSemiBoldText]}>
|
|
63
|
+
Previous Polls
|
|
64
|
+
</Text>
|
|
65
|
+
)}
|
|
66
|
+
|
|
67
|
+
{pollsList
|
|
68
|
+
.sort((a, b) => {
|
|
69
|
+
return a.state === b.state // If polls have same state, then sort as per startedAt
|
|
70
|
+
? a.startedAt !== undefined && b.startedAt !== undefined
|
|
71
|
+
? b.startedAt.getTime() - a.startedAt.getTime()
|
|
72
|
+
: 0
|
|
73
|
+
: // If polls have different state, then sort as per state
|
|
74
|
+
a.state !== undefined && b.state !== undefined
|
|
75
|
+
? a.state - b.state
|
|
76
|
+
: 0;
|
|
77
|
+
})
|
|
78
|
+
.map((poll) => (
|
|
79
|
+
<PollsAndQuizzesCard key={poll.pollId} poll={poll} />
|
|
80
|
+
))}
|
|
81
|
+
</View>
|
|
82
|
+
);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const styles = StyleSheet.create({
|
|
86
|
+
contentContainer: {
|
|
87
|
+
marginHorizontal: 24,
|
|
88
|
+
},
|
|
89
|
+
title: {
|
|
90
|
+
fontSize: 20,
|
|
91
|
+
lineHeight: 24,
|
|
92
|
+
letterSpacing: 0.15,
|
|
93
|
+
marginVertical: 24,
|
|
94
|
+
},
|
|
95
|
+
subtitle: {
|
|
96
|
+
fontSize: 16,
|
|
97
|
+
lineHeight: 20,
|
|
98
|
+
marginVertical: 24,
|
|
99
|
+
},
|
|
100
|
+
emptyList: {
|
|
101
|
+
textAlign: 'center',
|
|
102
|
+
},
|
|
103
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, StyleSheet } from 'react-native';
|
|
3
|
+
import type { ColorValue } from 'react-native';
|
|
4
|
+
|
|
5
|
+
export interface RadioInputProps {
|
|
6
|
+
selected: boolean;
|
|
7
|
+
size?: number;
|
|
8
|
+
color?: ColorValue;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const RadioInput: React.FC<RadioInputProps> = ({
|
|
12
|
+
selected,
|
|
13
|
+
size = 24,
|
|
14
|
+
color = 'white',
|
|
15
|
+
}) => {
|
|
16
|
+
const outerCircleStyle = {
|
|
17
|
+
width: size,
|
|
18
|
+
height: size,
|
|
19
|
+
borderRadius: size / 2,
|
|
20
|
+
borderWidth: size / 12,
|
|
21
|
+
borderColor: color,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const innerCircleStyle = {
|
|
25
|
+
width: size / 2,
|
|
26
|
+
height: size / 2,
|
|
27
|
+
borderRadius: size / 4,
|
|
28
|
+
backgroundColor: color,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<View style={[styles.outerCircle, outerCircleStyle]}>
|
|
33
|
+
{selected ? <View style={innerCircleStyle} /> : null}
|
|
34
|
+
</View>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const styles = StyleSheet.create({
|
|
39
|
+
outerCircle: {
|
|
40
|
+
alignItems: 'center',
|
|
41
|
+
justifyContent: 'center',
|
|
42
|
+
borderStyle: 'solid',
|
|
43
|
+
},
|
|
44
|
+
});
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, Text, StyleSheet, TouchableOpacity } from 'react-native';
|
|
3
|
+
import type { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
4
|
+
|
|
5
|
+
import { RadioInput } from './RadioInput';
|
|
6
|
+
import type { RadioInputProps } from './RadioInput';
|
|
7
|
+
import { useHMSRoomStyleSheet } from '../hooks-util';
|
|
8
|
+
|
|
9
|
+
interface RadioInputRowProps {
|
|
10
|
+
text: string;
|
|
11
|
+
selected: boolean;
|
|
12
|
+
onChange(value: boolean): void;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
radioSize?: RadioInputProps['size'];
|
|
15
|
+
radioColor?: RadioInputProps['color'];
|
|
16
|
+
textStyle?: StyleProp<TextStyle>;
|
|
17
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const RadioInputRow: React.FC<RadioInputRowProps> = ({
|
|
21
|
+
text,
|
|
22
|
+
containerStyle,
|
|
23
|
+
selected,
|
|
24
|
+
disabled,
|
|
25
|
+
textStyle,
|
|
26
|
+
radioSize,
|
|
27
|
+
radioColor,
|
|
28
|
+
onChange,
|
|
29
|
+
}) => {
|
|
30
|
+
const hmsRoomStyles = useHMSRoomStyleSheet((theme, typography) => ({
|
|
31
|
+
surfaceHighRegularText: {
|
|
32
|
+
color: theme.palette.on_surface_high,
|
|
33
|
+
fontFamily: `${typography.font_family}-Regular`,
|
|
34
|
+
},
|
|
35
|
+
}));
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<TouchableOpacity
|
|
39
|
+
disabled={disabled}
|
|
40
|
+
style={[styles.container, containerStyle]}
|
|
41
|
+
onPress={() => onChange(!selected)}
|
|
42
|
+
>
|
|
43
|
+
<View style={styles.radioWrapper}>
|
|
44
|
+
<RadioInput selected={selected} color={radioColor} size={radioSize} />
|
|
45
|
+
</View>
|
|
46
|
+
|
|
47
|
+
<Text
|
|
48
|
+
style={[
|
|
49
|
+
styles.normalText,
|
|
50
|
+
hmsRoomStyles.surfaceHighRegularText,
|
|
51
|
+
textStyle,
|
|
52
|
+
]}
|
|
53
|
+
>
|
|
54
|
+
{text}
|
|
55
|
+
</Text>
|
|
56
|
+
</TouchableOpacity>
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const styles = StyleSheet.create({
|
|
61
|
+
container: {
|
|
62
|
+
flexDirection: 'row',
|
|
63
|
+
alignItems: 'center',
|
|
64
|
+
},
|
|
65
|
+
radioWrapper: {
|
|
66
|
+
padding: 8,
|
|
67
|
+
marginRight: 8,
|
|
68
|
+
},
|
|
69
|
+
normalText: {
|
|
70
|
+
fontSize: 16,
|
|
71
|
+
lineHeight: 24,
|
|
72
|
+
},
|
|
73
|
+
});
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
HandIcon,
|
|
14
14
|
ParticipantsIcon,
|
|
15
15
|
PencilIcon,
|
|
16
|
+
PollVoteIcon,
|
|
16
17
|
RecordingIcon,
|
|
17
18
|
ScreenShareIcon,
|
|
18
19
|
} from '../Icons';
|
|
@@ -67,6 +68,11 @@ export const RoomSettingsModalContent: React.FC<
|
|
|
67
68
|
(state: RootState) => state.app.editUsernameDisabled
|
|
68
69
|
);
|
|
69
70
|
|
|
71
|
+
const canReadOrWritePoll = useSelector((state: RootState) => {
|
|
72
|
+
const permissions = state.hmsStates.localPeer?.role?.permissions;
|
|
73
|
+
return permissions?.pollRead || permissions?.pollWrite;
|
|
74
|
+
});
|
|
75
|
+
|
|
70
76
|
const { registerOnModalHideAction } = useBottomSheetActions();
|
|
71
77
|
|
|
72
78
|
const { canShowParticipants, show } = useShowChatAndParticipants();
|
|
@@ -187,6 +193,15 @@ export const RoomSettingsModalContent: React.FC<
|
|
|
187
193
|
closeRoomSettingsModal();
|
|
188
194
|
};
|
|
189
195
|
|
|
196
|
+
const openPollsQuizzesModal = () => {
|
|
197
|
+
registerOnModalHideAction(() => {
|
|
198
|
+
setModalVisible(ModalTypes.POLLS_AND_QUIZZES);
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
// Close the current bottom sheet
|
|
202
|
+
closeRoomSettingsModal();
|
|
203
|
+
};
|
|
204
|
+
|
|
190
205
|
const canShowBRB = useHMSLayoutConfig(
|
|
191
206
|
(layoutConfig) =>
|
|
192
207
|
!!layoutConfig?.screens?.conferencing?.default?.elements?.brb
|
|
@@ -298,6 +313,14 @@ export const RoomSettingsModalContent: React.FC<
|
|
|
298
313
|
isActive: false,
|
|
299
314
|
hide: isPublisher || editUsernameDisabled,
|
|
300
315
|
},
|
|
316
|
+
{
|
|
317
|
+
id: 'polls-and-quizes',
|
|
318
|
+
icon: <PollVoteIcon style={{ width: 20, height: 20 }} />,
|
|
319
|
+
label: 'Polls',
|
|
320
|
+
pressHandler: openPollsQuizzesModal,
|
|
321
|
+
isActive: false,
|
|
322
|
+
hide: !canReadOrWritePoll,
|
|
323
|
+
},
|
|
301
324
|
].filter((itm) => !itm.hide),
|
|
302
325
|
true
|
|
303
326
|
).map((itm, idx) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Switch, View, Text, StyleSheet } from 'react-native';
|
|
3
|
-
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import type { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
4
4
|
|
|
5
5
|
import { COLORS } from '../utils/theme';
|
|
6
6
|
|
|
@@ -9,6 +9,7 @@ interface SwitchRow {
|
|
|
9
9
|
onChange(value: boolean): void;
|
|
10
10
|
text: string;
|
|
11
11
|
containerStyle?: StyleProp<ViewStyle>;
|
|
12
|
+
textStyle?: StyleProp<TextStyle>;
|
|
12
13
|
LeftIcon?: React.ReactNode;
|
|
13
14
|
}
|
|
14
15
|
|
|
@@ -16,6 +17,7 @@ export const SwitchRow: React.FC<SwitchRow> = ({
|
|
|
16
17
|
text,
|
|
17
18
|
LeftIcon,
|
|
18
19
|
containerStyle,
|
|
20
|
+
textStyle,
|
|
19
21
|
value,
|
|
20
22
|
onChange,
|
|
21
23
|
}) => {
|
|
@@ -24,7 +26,7 @@ export const SwitchRow: React.FC<SwitchRow> = ({
|
|
|
24
26
|
<View style={styles.container}>
|
|
25
27
|
{LeftIcon}
|
|
26
28
|
|
|
27
|
-
<Text style={styles.text}>{text}</Text>
|
|
29
|
+
<Text style={[styles.text, textStyle]}>{text}</Text>
|
|
28
30
|
</View>
|
|
29
31
|
|
|
30
32
|
<Switch
|
package/src/hooks-util.ts
CHANGED
|
@@ -22,6 +22,9 @@ import {
|
|
|
22
22
|
setSoftInputMode,
|
|
23
23
|
getSoftInputMode,
|
|
24
24
|
WindowController,
|
|
25
|
+
useHMSHLSPlayerCue,
|
|
26
|
+
HMSPollUpdateType,
|
|
27
|
+
HMSPollType,
|
|
25
28
|
// useHMSPeerUpdates,
|
|
26
29
|
} from '@100mslive/react-native-hms';
|
|
27
30
|
import type { Chat as ChatConfig } from '@100mslive/types-prebuilt/elements/chat';
|
|
@@ -71,6 +74,7 @@ import {
|
|
|
71
74
|
} from 'react-redux';
|
|
72
75
|
import type { AppDispatch, RootState } from './redux';
|
|
73
76
|
import {
|
|
77
|
+
addCuedPollId,
|
|
74
78
|
addMessage,
|
|
75
79
|
addNotification,
|
|
76
80
|
addParticipant,
|
|
@@ -2548,6 +2552,43 @@ export const useLandscapeImmersiveMode = () => {
|
|
|
2548
2552
|
}, [isLandscapeOrientation]);
|
|
2549
2553
|
};
|
|
2550
2554
|
|
|
2555
|
+
export const useHLSCuedPolls = () => {
|
|
2556
|
+
const dispatch = useDispatch();
|
|
2557
|
+
const store = useStore<RootState>();
|
|
2558
|
+
const isHLSViewer = useIsHLSViewer();
|
|
2559
|
+
|
|
2560
|
+
useHMSHLSPlayerCue(
|
|
2561
|
+
(cue) => {
|
|
2562
|
+
const payloadStr = cue.payloadval;
|
|
2563
|
+
|
|
2564
|
+
if (
|
|
2565
|
+
isHLSViewer &&
|
|
2566
|
+
typeof payloadStr === 'string' &&
|
|
2567
|
+
payloadStr.startsWith('poll:')
|
|
2568
|
+
) {
|
|
2569
|
+
const pollId = payloadStr.split(':')[1];
|
|
2570
|
+
const poll =
|
|
2571
|
+
pollId && pollId.length > 0
|
|
2572
|
+
? store.getState().polls.polls[pollId]
|
|
2573
|
+
: null;
|
|
2574
|
+
|
|
2575
|
+
if (poll && poll.type === HMSPollType.poll) {
|
|
2576
|
+
console.log('HLS Cued Poll ID: ', pollId);
|
|
2577
|
+
dispatch(addCuedPollId(poll.pollId));
|
|
2578
|
+
dispatch(
|
|
2579
|
+
addNotification({
|
|
2580
|
+
id: `${poll.pollId}--${poll.state}`,
|
|
2581
|
+
type: NotificationTypes.POLLS_AND_QUIZZES,
|
|
2582
|
+
payload: { poll, pollUpdateType: HMSPollUpdateType.started },
|
|
2583
|
+
})
|
|
2584
|
+
);
|
|
2585
|
+
}
|
|
2586
|
+
}
|
|
2587
|
+
},
|
|
2588
|
+
[isHLSViewer]
|
|
2589
|
+
);
|
|
2590
|
+
};
|
|
2591
|
+
|
|
2551
2592
|
export const useSavePropsToStore = (
|
|
2552
2593
|
props: HMSPrebuiltProps,
|
|
2553
2594
|
dispatch: AppDispatch
|