@100mslive/react-native-room-kit 1.1.0 → 1.1.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/README.md +1 -1
- package/lib/commonjs/HMSRoomSetup.js +47 -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/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/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 +41 -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 +209 -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/GridView.js +4 -8
- package/lib/commonjs/components/GridView.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 +233 -0
- package/lib/commonjs/components/PollAndQuizQuestionResponseCard.js.map +1 -0
- package/lib/commonjs/components/PollAndQuizQuestionResponseCards.js +53 -0
- package/lib/commonjs/components/PollAndQuizQuestionResponseCards.js.map +1 -0
- package/lib/commonjs/components/PollAndQuizVoting.js +135 -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 +424 -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 +203 -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/QuizEndOptionsView.js +63 -0
- package/lib/commonjs/components/QuizEndOptionsView.js.map +1 -0
- package/lib/commonjs/components/RadioInput.js +49 -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/components/TilesContainer.js +3 -4
- package/lib/commonjs/components/TilesContainer.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 +40 -1
- package/lib/commonjs/redux/actionTypes.js.map +1 -1
- package/lib/commonjs/redux/actions/index.js +153 -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 +278 -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 +52 -2
- 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 +50 -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/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/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 +33 -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 +200 -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/GridView.js +5 -9
- package/lib/module/components/GridView.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 +224 -0
- package/lib/module/components/PollAndQuizQuestionResponseCard.js.map +1 -0
- package/lib/module/components/PollAndQuizQuestionResponseCards.js +44 -0
- package/lib/module/components/PollAndQuizQuestionResponseCards.js.map +1 -0
- package/lib/module/components/PollAndQuizVoting.js +126 -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 +415 -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 +194 -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/QuizEndOptionsView.js +54 -0
- package/lib/module/components/QuizEndOptionsView.js.map +1 -0
- package/lib/module/components/RadioInput.js +41 -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/components/TilesContainer.js +5 -6
- package/lib/module/components/TilesContainer.js.map +1 -1
- package/lib/module/hooks-util.js +26 -4
- package/lib/module/hooks-util.js.map +1 -1
- package/lib/module/redux/actionTypes.js +41 -0
- package/lib/module/redux/actionTypes.js.map +1 -1
- package/lib/module/redux/actions/index.js +127 -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 +272 -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 +45 -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/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 +9 -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/GridView.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/PollAndQuizQuestionResponseCards.d.ts +9 -0
- package/lib/typescript/components/PollAndQuizQuestionResponseCards.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 +15 -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/QuizEndOptionsView.d.ts +10 -0
- package/lib/typescript/components/QuizEndOptionsView.d.ts.map +1 -0
- package/lib/typescript/components/RadioInput.d.ts +10 -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 +176 -0
- package/lib/typescript/redux/actionTypes.d.ts.map +1 -1
- package/lib/typescript/redux/actions/index.d.ts +38 -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 +7 -1
- 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 +62 -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/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/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 +54 -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 +249 -0
- package/src/components/Footer.tsx +7 -1
- package/src/components/GridView.tsx +4 -14
- 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 +414 -0
- package/src/components/PollAndQuizQuestionResponseCards.tsx +62 -0
- package/src/components/PollAndQuizVoting.tsx +161 -0
- package/src/components/PollAndQuizzStateLabel.tsx +83 -0
- package/src/components/PollQDeleteConfirmationSheetView.tsx +82 -0
- package/src/components/PollQuestion.tsx +668 -0
- package/src/components/PollQuestionDeleteConfirmation.tsx +110 -0
- package/src/components/PollQuestions.tsx +277 -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/QuizEndOptionsView.tsx +71 -0
- package/src/components/RadioInput.tsx +56 -0
- package/src/components/RadioInputRow.tsx +73 -0
- package/src/components/RoomSettingsModalContent.tsx +23 -0
- package/src/components/SwitchRow.tsx +4 -2
- package/src/components/TilesContainer.tsx +4 -4
- package/src/hooks-util.ts +40 -1
- package/src/redux/actionTypes.ts +241 -0
- package/src/redux/actions/index.ts +240 -1
- package/src/redux/reducers/index.ts +2 -0
- package/src/redux/reducers/polls.ts +378 -0
- package/src/types.ts +2 -0
- package/src/utils/functions.ts +98 -0
- package/src/utils/types.ts +1 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { View, Text, StyleSheet, TouchableOpacity } from 'react-native';
|
|
3
|
+
import { useDispatch } from 'react-redux';
|
|
4
|
+
|
|
5
|
+
import { useHMSRoomStyleSheet } from '../hooks-util';
|
|
6
|
+
import { AlertTriangleIcon, CloseIcon } from '../Icons';
|
|
7
|
+
import { HMSDangerButton } from './HMSDangerButton';
|
|
8
|
+
import { deletePollQuestion } from '../redux/actions';
|
|
9
|
+
|
|
10
|
+
export interface PollQuestionDeleteConfirmationProps {
|
|
11
|
+
dismissModal(): void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const PollQuestionDeleteConfirmation: React.FC<
|
|
15
|
+
PollQuestionDeleteConfirmationProps
|
|
16
|
+
> = ({ dismissModal }) => {
|
|
17
|
+
const dispatch = useDispatch();
|
|
18
|
+
|
|
19
|
+
const hmsRoomStyles = useHMSRoomStyleSheet((theme, typography) => ({
|
|
20
|
+
headerText: {
|
|
21
|
+
color: theme.palette.alert_error_default,
|
|
22
|
+
fontFamily: `${typography.font_family}-SemiBold`,
|
|
23
|
+
},
|
|
24
|
+
subtitle: {
|
|
25
|
+
color: theme.palette.on_surface_medium,
|
|
26
|
+
fontFamily: `${typography.font_family}-Regular`,
|
|
27
|
+
},
|
|
28
|
+
}));
|
|
29
|
+
|
|
30
|
+
const disabledButton = false;
|
|
31
|
+
|
|
32
|
+
const handleClosePress = () => dismissModal();
|
|
33
|
+
|
|
34
|
+
const handlePollQuestionDelete = () => {
|
|
35
|
+
dispatch(deletePollQuestion());
|
|
36
|
+
dismissModal();
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<View style={styles.container}>
|
|
41
|
+
<View style={styles.header}>
|
|
42
|
+
<View style={styles.headerControls}>
|
|
43
|
+
<AlertTriangleIcon style={styles.backIcon} />
|
|
44
|
+
|
|
45
|
+
<Text style={[styles.headerText, hmsRoomStyles.headerText]}>
|
|
46
|
+
Delete Question
|
|
47
|
+
</Text>
|
|
48
|
+
</View>
|
|
49
|
+
|
|
50
|
+
<TouchableOpacity
|
|
51
|
+
onPress={handleClosePress}
|
|
52
|
+
hitSlop={styles.closeIconHitSlop}
|
|
53
|
+
>
|
|
54
|
+
<CloseIcon />
|
|
55
|
+
</TouchableOpacity>
|
|
56
|
+
</View>
|
|
57
|
+
|
|
58
|
+
<Text style={[styles.subtitle, hmsRoomStyles.subtitle]}>
|
|
59
|
+
Are you sure you want to delete this question?{'\n'}You can't undo this
|
|
60
|
+
action.
|
|
61
|
+
</Text>
|
|
62
|
+
|
|
63
|
+
<HMSDangerButton
|
|
64
|
+
loading={false}
|
|
65
|
+
onPress={handlePollQuestionDelete}
|
|
66
|
+
title="Delete"
|
|
67
|
+
disabled={disabledButton}
|
|
68
|
+
style={styles.deleteButton}
|
|
69
|
+
/>
|
|
70
|
+
</View>
|
|
71
|
+
);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const styles = StyleSheet.create({
|
|
75
|
+
container: {
|
|
76
|
+
padding: 24,
|
|
77
|
+
paddingBottom: 32,
|
|
78
|
+
},
|
|
79
|
+
header: {
|
|
80
|
+
flexDirection: 'row',
|
|
81
|
+
alignItems: 'center',
|
|
82
|
+
justifyContent: 'space-between',
|
|
83
|
+
},
|
|
84
|
+
headerControls: {
|
|
85
|
+
flexDirection: 'row',
|
|
86
|
+
alignItems: 'center',
|
|
87
|
+
},
|
|
88
|
+
backIcon: {
|
|
89
|
+
marginRight: 8,
|
|
90
|
+
},
|
|
91
|
+
headerText: {
|
|
92
|
+
fontSize: 20,
|
|
93
|
+
lineHeight: 24,
|
|
94
|
+
letterSpacing: 0.15,
|
|
95
|
+
},
|
|
96
|
+
closeIconHitSlop: {
|
|
97
|
+
bottom: 16,
|
|
98
|
+
left: 16,
|
|
99
|
+
right: 16,
|
|
100
|
+
top: 16,
|
|
101
|
+
},
|
|
102
|
+
subtitle: {
|
|
103
|
+
fontSize: 14,
|
|
104
|
+
lineHeight: 20,
|
|
105
|
+
marginTop: 8,
|
|
106
|
+
},
|
|
107
|
+
deleteButton: {
|
|
108
|
+
marginTop: 16,
|
|
109
|
+
},
|
|
110
|
+
});
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
View,
|
|
4
|
+
Text,
|
|
5
|
+
StyleSheet,
|
|
6
|
+
TouchableOpacity,
|
|
7
|
+
ScrollView,
|
|
8
|
+
} from 'react-native';
|
|
9
|
+
import { HMSPollQuestionType, HMSPollType } from '@100mslive/react-native-hms';
|
|
10
|
+
|
|
11
|
+
import { AddIcon } from '../Icons';
|
|
12
|
+
import { useHMSInstance, useHMSRoomStyleSheet } from '../hooks-util';
|
|
13
|
+
import { HMSPrimaryButton } from './HMSPrimaryButton';
|
|
14
|
+
import { PollQuestion } from './PollQuestion';
|
|
15
|
+
import { batch, useDispatch, useSelector, useStore } from 'react-redux';
|
|
16
|
+
import type { RootState } from '../redux';
|
|
17
|
+
import {
|
|
18
|
+
addPollQuestion,
|
|
19
|
+
addPollQuestionOption,
|
|
20
|
+
cleaPollFormState,
|
|
21
|
+
deletePollQuestionOption,
|
|
22
|
+
editPollQuestionOption,
|
|
23
|
+
setLaunchingPoll,
|
|
24
|
+
setPollQDeleteConfirmationVisible,
|
|
25
|
+
setPollQuestionCorrectOption,
|
|
26
|
+
setPollQuestionPointWeightage,
|
|
27
|
+
setPollQuestionResponseEditable,
|
|
28
|
+
setPollQuestionSaved,
|
|
29
|
+
setPollQuestionSkippable,
|
|
30
|
+
setPollQuestionTitle,
|
|
31
|
+
setPollQuestionType,
|
|
32
|
+
setSelectedPollQuestionIndex,
|
|
33
|
+
} from '../redux/actions';
|
|
34
|
+
import type { PollQuestionUI } from '../redux/actionTypes';
|
|
35
|
+
|
|
36
|
+
export interface PollQuestionsProps {
|
|
37
|
+
dismissModal(): void;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const PollQuestions: React.FC<PollQuestionsProps> = ({}) => {
|
|
41
|
+
const dispatch = useDispatch();
|
|
42
|
+
const hmsInstance = useHMSInstance();
|
|
43
|
+
const reduxStore = useStore<RootState>();
|
|
44
|
+
const localPeerRole = useSelector(
|
|
45
|
+
(state: RootState) => state.hmsStates.localPeer?.role
|
|
46
|
+
);
|
|
47
|
+
const launchingPoll = useSelector(
|
|
48
|
+
(state: RootState) => state.polls.launchingPoll
|
|
49
|
+
);
|
|
50
|
+
const pollType = useSelector(
|
|
51
|
+
(state: RootState) => state.polls.pollConfig.type
|
|
52
|
+
);
|
|
53
|
+
const questions = useSelector((state: RootState) => state.polls.questions);
|
|
54
|
+
|
|
55
|
+
const hmsRoomStyles = useHMSRoomStyleSheet((theme, typography) => ({
|
|
56
|
+
regularMediumText: {
|
|
57
|
+
color: theme.palette.on_surface_medium,
|
|
58
|
+
fontFamily: `${typography.font_family}-Regular`,
|
|
59
|
+
},
|
|
60
|
+
}));
|
|
61
|
+
|
|
62
|
+
const disableLaunchPoll =
|
|
63
|
+
questions.length <= 0 || questions.some((question) => !question.saved);
|
|
64
|
+
|
|
65
|
+
const launchPoll = async () => {
|
|
66
|
+
try {
|
|
67
|
+
const pollsData = reduxStore.getState().polls;
|
|
68
|
+
if (!pollsData.pollName || disableLaunchPoll) {
|
|
69
|
+
console.log('Incorrect data!');
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
dispatch(setLaunchingPoll(true));
|
|
73
|
+
|
|
74
|
+
const result = await hmsInstance.interactivityCenter.startPoll({
|
|
75
|
+
title: pollsData.pollName,
|
|
76
|
+
type: pollType,
|
|
77
|
+
rolesThatCanViewResponses:
|
|
78
|
+
pollType === HMSPollType.poll &&
|
|
79
|
+
pollsData.pollConfig.voteCountHidden &&
|
|
80
|
+
localPeerRole
|
|
81
|
+
? [localPeerRole]
|
|
82
|
+
: undefined,
|
|
83
|
+
// mode: HMSPollUserTrackingMode.customerUserID, // mode: null, // `pollsData.pollConfig.resultsAnonymous` Make results anonymous set user tracking mode to none
|
|
84
|
+
questions: pollsData.questions.map((question) => {
|
|
85
|
+
const weight = parseInt(question.pointWeightage);
|
|
86
|
+
return {
|
|
87
|
+
skippable: question.skippable,
|
|
88
|
+
once: !question.responseEditable,
|
|
89
|
+
text: question.title,
|
|
90
|
+
type: question.type,
|
|
91
|
+
weight:
|
|
92
|
+
pollType === HMSPollType.quiz && !isNaN(weight)
|
|
93
|
+
? weight
|
|
94
|
+
: undefined,
|
|
95
|
+
options: question.options?.map((option) =>
|
|
96
|
+
pollType === HMSPollType.quiz
|
|
97
|
+
? { text: option[1], isCorrectAnswer: option[0] }
|
|
98
|
+
: { text: option[1] }
|
|
99
|
+
),
|
|
100
|
+
};
|
|
101
|
+
}),
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
console.log('quickStartPoll result > ', result);
|
|
105
|
+
dispatch(cleaPollFormState());
|
|
106
|
+
} catch (error) {
|
|
107
|
+
dispatch(setLaunchingPoll(false));
|
|
108
|
+
console.log('quickStartPoll error > ', error);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const addQuestion = () => {
|
|
113
|
+
dispatch(addPollQuestion());
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const deleteQuestion = React.useCallback((index: number) => {
|
|
117
|
+
batch(() => {
|
|
118
|
+
dispatch(setSelectedPollQuestionIndex(index));
|
|
119
|
+
dispatch(setPollQDeleteConfirmationVisible(true));
|
|
120
|
+
});
|
|
121
|
+
}, []);
|
|
122
|
+
|
|
123
|
+
const onQuestionFieldChange = React.useCallback(
|
|
124
|
+
<K extends keyof Omit<PollQuestionUI, 'options'>>(
|
|
125
|
+
questionIndex: number,
|
|
126
|
+
questionField: K,
|
|
127
|
+
value: Omit<PollQuestionUI, 'options'>[K]
|
|
128
|
+
) => {
|
|
129
|
+
switch (questionField) {
|
|
130
|
+
case 'responseEditable':
|
|
131
|
+
dispatch(
|
|
132
|
+
setPollQuestionResponseEditable(questionIndex, value as boolean)
|
|
133
|
+
);
|
|
134
|
+
break;
|
|
135
|
+
case 'saved':
|
|
136
|
+
dispatch(setPollQuestionSaved(questionIndex, value as boolean));
|
|
137
|
+
break;
|
|
138
|
+
case 'skippable':
|
|
139
|
+
dispatch(setPollQuestionSkippable(questionIndex, value as boolean));
|
|
140
|
+
break;
|
|
141
|
+
case 'title':
|
|
142
|
+
dispatch(setPollQuestionTitle(questionIndex, value as string));
|
|
143
|
+
break;
|
|
144
|
+
case 'type':
|
|
145
|
+
dispatch(
|
|
146
|
+
setPollQuestionType(questionIndex, value as HMSPollQuestionType)
|
|
147
|
+
);
|
|
148
|
+
break;
|
|
149
|
+
case 'pointWeightage':
|
|
150
|
+
const cleanNumber = (value as string).replace(/[^0-9]/g, '');
|
|
151
|
+
dispatch(setPollQuestionPointWeightage(questionIndex, cleanNumber));
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
[]
|
|
156
|
+
);
|
|
157
|
+
|
|
158
|
+
const handleAddPollQuestionOption = React.useCallback(
|
|
159
|
+
(questionIndex: number) => {
|
|
160
|
+
dispatch(addPollQuestionOption(questionIndex));
|
|
161
|
+
},
|
|
162
|
+
[]
|
|
163
|
+
);
|
|
164
|
+
|
|
165
|
+
const handleDeletePollQuestionOption = React.useCallback(
|
|
166
|
+
(questionIndex: number, optionIndex: number) => {
|
|
167
|
+
dispatch(deletePollQuestionOption(questionIndex, optionIndex));
|
|
168
|
+
},
|
|
169
|
+
[]
|
|
170
|
+
);
|
|
171
|
+
|
|
172
|
+
const handleEditPollQuestionOption = React.useCallback(
|
|
173
|
+
(questionIndex: number, optionIndex: number, option: string) => {
|
|
174
|
+
dispatch(editPollQuestionOption(questionIndex, optionIndex, option));
|
|
175
|
+
},
|
|
176
|
+
[]
|
|
177
|
+
);
|
|
178
|
+
|
|
179
|
+
const handleSetPollQuestionCorrectOption = React.useCallback(
|
|
180
|
+
(questionIndex: number, optionIndex: number, corectOption: boolean) => {
|
|
181
|
+
dispatch(
|
|
182
|
+
setPollQuestionCorrectOption(questionIndex, optionIndex, corectOption)
|
|
183
|
+
);
|
|
184
|
+
},
|
|
185
|
+
[]
|
|
186
|
+
);
|
|
187
|
+
|
|
188
|
+
return (
|
|
189
|
+
<ScrollView
|
|
190
|
+
style={styles.contentContainer}
|
|
191
|
+
contentContainerStyle={{ paddingTop: 24 }}
|
|
192
|
+
>
|
|
193
|
+
{questions.map((pollQuestion, idx, arr) => {
|
|
194
|
+
const isFirst = idx === 0;
|
|
195
|
+
return (
|
|
196
|
+
<React.Fragment key={idx}>
|
|
197
|
+
{isFirst ? null : <View style={{ height: 16 }} />}
|
|
198
|
+
|
|
199
|
+
<PollQuestion
|
|
200
|
+
totalQuestions={arr.length}
|
|
201
|
+
currentQuestionIndex={idx}
|
|
202
|
+
pollQuestion={pollQuestion}
|
|
203
|
+
onAddPollQuestionOption={handleAddPollQuestionOption}
|
|
204
|
+
onDeletePollQuestionOption={handleDeletePollQuestionOption}
|
|
205
|
+
onEditPollQuestionOption={handleEditPollQuestionOption}
|
|
206
|
+
onSetPollQuestionCorrectOption={
|
|
207
|
+
handleSetPollQuestionCorrectOption
|
|
208
|
+
}
|
|
209
|
+
onQuestionFieldChange={onQuestionFieldChange}
|
|
210
|
+
onDelete={deleteQuestion}
|
|
211
|
+
/>
|
|
212
|
+
</React.Fragment>
|
|
213
|
+
);
|
|
214
|
+
})}
|
|
215
|
+
|
|
216
|
+
<View style={[styles.addOptionWrapper, { marginTop: 16 }]}>
|
|
217
|
+
<TouchableOpacity
|
|
218
|
+
onPress={addQuestion}
|
|
219
|
+
disabled={launchingPoll}
|
|
220
|
+
style={[
|
|
221
|
+
styles.addOptionContainer,
|
|
222
|
+
launchingPoll ? { opacity: 0.4 } : null,
|
|
223
|
+
]}
|
|
224
|
+
>
|
|
225
|
+
<View style={styles.addOptionIconWrapper}>
|
|
226
|
+
<AddIcon type="circle" />
|
|
227
|
+
</View>
|
|
228
|
+
<Text style={[styles.smallText, hmsRoomStyles.regularMediumText]}>
|
|
229
|
+
Add another question
|
|
230
|
+
</Text>
|
|
231
|
+
</TouchableOpacity>
|
|
232
|
+
</View>
|
|
233
|
+
|
|
234
|
+
<HMSPrimaryButton
|
|
235
|
+
disabled={disableLaunchPoll || launchingPoll}
|
|
236
|
+
title={`Launch ${pollType === HMSPollType.quiz ? 'Quiz' : 'Poll'}`}
|
|
237
|
+
loading={launchingPoll}
|
|
238
|
+
onPress={launchPoll}
|
|
239
|
+
style={{ marginTop: 16, marginBottom: 56, alignSelf: 'flex-end' }}
|
|
240
|
+
/>
|
|
241
|
+
</ScrollView>
|
|
242
|
+
);
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
const styles = StyleSheet.create({
|
|
246
|
+
smallText: {
|
|
247
|
+
fontSize: 14,
|
|
248
|
+
lineHeight: 20,
|
|
249
|
+
},
|
|
250
|
+
contentContainer: {
|
|
251
|
+
paddingHorizontal: 24,
|
|
252
|
+
},
|
|
253
|
+
typeSelectionLabel: {
|
|
254
|
+
fontSize: 12,
|
|
255
|
+
lineHeight: 16,
|
|
256
|
+
},
|
|
257
|
+
pollNameLabel: {
|
|
258
|
+
fontSize: 14,
|
|
259
|
+
lineHeight: 20,
|
|
260
|
+
marginBottom: 8,
|
|
261
|
+
},
|
|
262
|
+
textInput: {
|
|
263
|
+
flex: undefined,
|
|
264
|
+
},
|
|
265
|
+
|
|
266
|
+
addOptionWrapper: {
|
|
267
|
+
alignSelf: 'flex-start',
|
|
268
|
+
},
|
|
269
|
+
addOptionContainer: {
|
|
270
|
+
flexDirection: 'row',
|
|
271
|
+
alignItems: 'center',
|
|
272
|
+
},
|
|
273
|
+
addOptionIconWrapper: {
|
|
274
|
+
marginRight: 8,
|
|
275
|
+
padding: 8,
|
|
276
|
+
},
|
|
277
|
+
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { HMSPollQuestionOption } from '@100mslive/react-native-hms';
|
|
3
|
+
import { StyleSheet, Text, View } from 'react-native';
|
|
4
|
+
|
|
5
|
+
import { useHMSRoomStyleSheet } from '../hooks-util';
|
|
6
|
+
|
|
7
|
+
interface PollResponseProgressViewProps {
|
|
8
|
+
option: HMSPollQuestionOption;
|
|
9
|
+
totalVotes: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const PollResponseProgressView: React.FC<
|
|
13
|
+
PollResponseProgressViewProps
|
|
14
|
+
> = ({ option, totalVotes }) => {
|
|
15
|
+
const hmsRoomStyles = useHMSRoomStyleSheet((theme, typography) => ({
|
|
16
|
+
surfaceHighRegularText: {
|
|
17
|
+
color: theme.palette.on_surface_high,
|
|
18
|
+
fontFamily: `${typography.font_family}-Regular`,
|
|
19
|
+
},
|
|
20
|
+
progressContainer: {
|
|
21
|
+
backgroundColor: theme.palette.surface_bright,
|
|
22
|
+
},
|
|
23
|
+
progress: {
|
|
24
|
+
backgroundColor: theme.palette.primary_default,
|
|
25
|
+
},
|
|
26
|
+
}));
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<View style={styles.container}>
|
|
30
|
+
<View
|
|
31
|
+
style={{
|
|
32
|
+
flexDirection: 'row',
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
justifyContent: 'space-between',
|
|
35
|
+
}}
|
|
36
|
+
>
|
|
37
|
+
<Text style={[styles.smallText, hmsRoomStyles.surfaceHighRegularText]}>
|
|
38
|
+
{option.text}
|
|
39
|
+
</Text>
|
|
40
|
+
|
|
41
|
+
<Text style={[styles.smallText, hmsRoomStyles.surfaceHighRegularText]}>
|
|
42
|
+
{option.voteCount} {option.voteCount > 1 ? 'votes' : 'vote'}
|
|
43
|
+
</Text>
|
|
44
|
+
</View>
|
|
45
|
+
|
|
46
|
+
<View style={[hmsRoomStyles.progressContainer, styles.progressContainer]}>
|
|
47
|
+
<View
|
|
48
|
+
style={[
|
|
49
|
+
hmsRoomStyles.progress,
|
|
50
|
+
styles.progress,
|
|
51
|
+
{ width: `${(option.voteCount / totalVotes) * 100}%` },
|
|
52
|
+
]}
|
|
53
|
+
/>
|
|
54
|
+
</View>
|
|
55
|
+
</View>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const styles = StyleSheet.create({
|
|
60
|
+
container: {
|
|
61
|
+
marginBottom: 16,
|
|
62
|
+
},
|
|
63
|
+
smallText: {
|
|
64
|
+
fontSize: 14,
|
|
65
|
+
lineHeight: 20,
|
|
66
|
+
marginBottom: 8,
|
|
67
|
+
},
|
|
68
|
+
progressContainer: {
|
|
69
|
+
flex: 1,
|
|
70
|
+
height: 8,
|
|
71
|
+
borderRadius: 4,
|
|
72
|
+
overflow: 'hidden',
|
|
73
|
+
},
|
|
74
|
+
progress: {
|
|
75
|
+
height: '100%',
|
|
76
|
+
},
|
|
77
|
+
});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Platform, StyleSheet } from 'react-native';
|
|
3
|
+
import { useSelector } from 'react-redux';
|
|
4
|
+
|
|
5
|
+
import { BottomSheet } from './BottomSheet';
|
|
6
|
+
import {
|
|
7
|
+
useHMSRoomStyleSheet,
|
|
8
|
+
useIsHLSViewer,
|
|
9
|
+
useModalType,
|
|
10
|
+
} from '../hooks-util';
|
|
11
|
+
import { useHeaderHeight } from './Header';
|
|
12
|
+
import { useIsLandscapeOrientation } from '../utils/dimension';
|
|
13
|
+
import { PollsAndQuizzesModalContent } from './PollsAndQuizzesModalContent';
|
|
14
|
+
import { ModalTypes } from '../utils/types';
|
|
15
|
+
import type { RootState } from '../redux';
|
|
16
|
+
import { CreatePollStages } from '../redux/actionTypes';
|
|
17
|
+
import { visiblePollsSelector } from '../utils/functions';
|
|
18
|
+
|
|
19
|
+
export const PollsAndQuizBottomSheet = () => {
|
|
20
|
+
const headerHeight = useHeaderHeight();
|
|
21
|
+
const isLandscapeOrientation = useIsLandscapeOrientation();
|
|
22
|
+
const {
|
|
23
|
+
modalVisibleType: modalVisible,
|
|
24
|
+
handleModalVisibleType: setModalVisible,
|
|
25
|
+
} = useModalType();
|
|
26
|
+
|
|
27
|
+
const isPollQuestionStage = useSelector(
|
|
28
|
+
(state: RootState) =>
|
|
29
|
+
state.polls.stage === CreatePollStages.POLL_QUESTION_CONFIG
|
|
30
|
+
);
|
|
31
|
+
const isHLSViewer = useIsHLSViewer();
|
|
32
|
+
const havePolls = useSelector(
|
|
33
|
+
(state: RootState) =>
|
|
34
|
+
visiblePollsSelector(
|
|
35
|
+
Object.values(state.polls.polls),
|
|
36
|
+
isHLSViewer,
|
|
37
|
+
state.polls.cuedPollIds
|
|
38
|
+
).length > 0
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
const hmsRoomStyles = useHMSRoomStyleSheet((theme) => ({
|
|
42
|
+
contentContainer: {
|
|
43
|
+
backgroundColor: theme.palette.surface_dim,
|
|
44
|
+
},
|
|
45
|
+
}));
|
|
46
|
+
|
|
47
|
+
const dismissModal = () => setModalVisible(ModalTypes.DEFAULT);
|
|
48
|
+
|
|
49
|
+
const fullHeight = isPollQuestionStage || havePolls;
|
|
50
|
+
const containerStyles = fullHeight
|
|
51
|
+
? [
|
|
52
|
+
styles.bottomSheet,
|
|
53
|
+
{
|
|
54
|
+
marginTop: isLandscapeOrientation
|
|
55
|
+
? 0
|
|
56
|
+
: headerHeight + (Platform.OS === 'android' ? 24 : 0),
|
|
57
|
+
},
|
|
58
|
+
hmsRoomStyles.contentContainer,
|
|
59
|
+
]
|
|
60
|
+
: [hmsRoomStyles.contentContainer];
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<BottomSheet
|
|
64
|
+
// fullWidth={true}
|
|
65
|
+
dismissModal={dismissModal}
|
|
66
|
+
isVisible={modalVisible === ModalTypes.POLLS_AND_QUIZZES}
|
|
67
|
+
avoidKeyboard={true}
|
|
68
|
+
containerStyle={containerStyles}
|
|
69
|
+
bottomOffsetSpace={fullHeight ? 0 : undefined}
|
|
70
|
+
>
|
|
71
|
+
<PollsAndQuizzesModalContent
|
|
72
|
+
fullHeight={fullHeight}
|
|
73
|
+
dismissModal={dismissModal}
|
|
74
|
+
/>
|
|
75
|
+
</BottomSheet>
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const styles = StyleSheet.create({
|
|
80
|
+
bottomSheet: {
|
|
81
|
+
flex: 1,
|
|
82
|
+
},
|
|
83
|
+
});
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { View, Text, StyleSheet } from 'react-native';
|
|
3
|
+
import { batch, useDispatch } from 'react-redux';
|
|
4
|
+
import type { HMSPoll } from '@100mslive/react-native-hms';
|
|
5
|
+
|
|
6
|
+
import { useHMSRoomStyleSheet } from '../hooks-util';
|
|
7
|
+
import { HMSPrimaryButton } from './HMSPrimaryButton';
|
|
8
|
+
import { setPollStage, setSelectedPollId } from '../redux/actions';
|
|
9
|
+
import { CreatePollStages } from '../redux/actionTypes';
|
|
10
|
+
import { PollAndQuizzStateLabel } from './PollAndQuizzStateLabel';
|
|
11
|
+
|
|
12
|
+
export interface PollsAndQuizzesCardProps {
|
|
13
|
+
poll: HMSPoll;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const PollsAndQuizzesCard: React.FC<PollsAndQuizzesCardProps> = ({
|
|
17
|
+
poll,
|
|
18
|
+
}) => {
|
|
19
|
+
const dispatch = useDispatch();
|
|
20
|
+
|
|
21
|
+
const hmsRoomStyles = useHMSRoomStyleSheet((theme, typography) => ({
|
|
22
|
+
surfaceHighSemiBoldText: {
|
|
23
|
+
color: theme.palette.on_surface_high,
|
|
24
|
+
fontFamily: `${typography.font_family}-SemiBold`,
|
|
25
|
+
},
|
|
26
|
+
container: {
|
|
27
|
+
backgroundColor: theme.palette.surface_default,
|
|
28
|
+
},
|
|
29
|
+
liveStateLabelWrapper: {
|
|
30
|
+
backgroundColor: theme.palette.alert_error_default,
|
|
31
|
+
},
|
|
32
|
+
stateLabelWrapper: {
|
|
33
|
+
backgroundColor: theme.palette.surface_brighter,
|
|
34
|
+
},
|
|
35
|
+
}));
|
|
36
|
+
|
|
37
|
+
const viewPoll = () => {
|
|
38
|
+
batch(() => {
|
|
39
|
+
dispatch(setPollStage(CreatePollStages.POLL_VOTING));
|
|
40
|
+
dispatch(setSelectedPollId(poll.pollId));
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<View style={[hmsRoomStyles.container, styles.container]}>
|
|
46
|
+
<View style={styles.row}>
|
|
47
|
+
<Text
|
|
48
|
+
numberOfLines={4}
|
|
49
|
+
style={[styles.pollTitle, hmsRoomStyles.surfaceHighSemiBoldText]}
|
|
50
|
+
>
|
|
51
|
+
{poll.title}
|
|
52
|
+
</Text>
|
|
53
|
+
|
|
54
|
+
{typeof poll.state === 'number' ? (
|
|
55
|
+
<PollAndQuizzStateLabel state={poll.state} />
|
|
56
|
+
) : null}
|
|
57
|
+
</View>
|
|
58
|
+
|
|
59
|
+
<View style={styles.spacer} />
|
|
60
|
+
|
|
61
|
+
<View style={styles.rightRow}>
|
|
62
|
+
{/* {poll.state === HMSPollState.stopped ? (
|
|
63
|
+
<HMSSecondaryButton
|
|
64
|
+
loading={false}
|
|
65
|
+
onPress={() => null}
|
|
66
|
+
style={{ marginRight: 8 }}
|
|
67
|
+
title="View Results"
|
|
68
|
+
/>
|
|
69
|
+
) : null} */}
|
|
70
|
+
|
|
71
|
+
<HMSPrimaryButton loading={false} onPress={viewPoll} title="View" />
|
|
72
|
+
</View>
|
|
73
|
+
</View>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const styles = StyleSheet.create({
|
|
78
|
+
container: {
|
|
79
|
+
padding: 16,
|
|
80
|
+
borderRadius: 8,
|
|
81
|
+
marginBottom: 24,
|
|
82
|
+
},
|
|
83
|
+
spacer: {
|
|
84
|
+
height: 16,
|
|
85
|
+
},
|
|
86
|
+
row: {
|
|
87
|
+
flexDirection: 'row',
|
|
88
|
+
alignItems: 'center',
|
|
89
|
+
justifyContent: 'space-between',
|
|
90
|
+
},
|
|
91
|
+
rightRow: {
|
|
92
|
+
flexDirection: 'row',
|
|
93
|
+
justifyContent: 'flex-end',
|
|
94
|
+
},
|
|
95
|
+
pollTitle: {
|
|
96
|
+
flexShrink: 1,
|
|
97
|
+
fontSize: 16,
|
|
98
|
+
lineHeight: 24,
|
|
99
|
+
letterSpacing: 0.15,
|
|
100
|
+
},
|
|
101
|
+
stateLabelWrapper: {
|
|
102
|
+
paddingVertical: 4,
|
|
103
|
+
paddingHorizontal: 8,
|
|
104
|
+
borderRadius: 4,
|
|
105
|
+
},
|
|
106
|
+
stateLabel: {
|
|
107
|
+
fontSize: 10,
|
|
108
|
+
lineHeight: 16,
|
|
109
|
+
letterSpacing: 1.5,
|
|
110
|
+
},
|
|
111
|
+
});
|