@nualang/nualang-ui-components 0.1.1227 → 0.1.1228

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.
@@ -25,7 +25,8 @@ function CreateClassroom({
25
25
  isUpgradePossible: true
26
26
  },
27
27
  learnLang,
28
- verificationStatus
28
+ verificationStatus,
29
+ isVideoChatEnabled
29
30
  }) {
30
31
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_MultiStepForm.default, {
31
32
  initialValues: {
@@ -50,7 +51,8 @@ function CreateClassroom({
50
51
  forLanguages: forLanguages,
51
52
  fileSizeLimit: fileSizeLimit,
52
53
  subscription: subscription,
53
- verificationStatus: verificationStatus
54
+ verificationStatus: verificationStatus,
55
+ isVideoChatEnabled: isVideoChatEnabled
54
56
  });
55
57
  }
56
58
  CreateClassroom.propTypes = {};
@@ -25,21 +25,17 @@ function ClassroomSettings({
25
25
  classroomId,
26
26
  isUpdateClassroom = false,
27
27
  scrollToDiscuss = false,
28
- setScrollToDiscuss
28
+ setScrollToDiscuss,
29
+ isVideoChatEnabled
29
30
  }) {
30
31
  const {
31
32
  visibility,
32
33
  enrolmentKey,
33
34
  allowedDomains,
34
35
  collaborators,
35
- vchatEnabledInSettings,
36
- vchatEnabled
36
+ vchatEnabledInSettings
37
37
  } = values;
38
38
  const vchatEnabledInSettingsRef = (0, _react.useRef)(null);
39
- const [isWaysideClassroom, setIsWaysideClassroom] = (0, _react.useState)(false);
40
- if (!isWaysideClassroom && classroomId && classroomId.toLowerCase().includes("wayside")) {
41
- setIsWaysideClassroom(true);
42
- }
43
39
  const generateRandomEnrolmentKey = () => {
44
40
  return String(Math.floor(Math.random() * 90000) + 10000);
45
41
  };
@@ -236,7 +232,7 @@ function ClassroomSettings({
236
232
  fullWidth: true
237
233
  })]
238
234
  })]
239
- }), isWaysideClassroom && vchatEnabled !== false && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
235
+ }), isVideoChatEnabled && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
240
236
  item: true,
241
237
  xs: 12,
242
238
  md: 12,
@@ -47,7 +47,8 @@ function UpdateClassroom({
47
47
  scrollToDiscuss,
48
48
  setScrollToDiscuss,
49
49
  isClassroomArchived = false,
50
- verificationStatus
50
+ verificationStatus,
51
+ isVideoChatEnabled
51
52
  }) {
52
53
  const {
53
54
  classes
@@ -217,6 +218,7 @@ function UpdateClassroom({
217
218
  values: values,
218
219
  scrollToDiscuss: scrollToDiscuss,
219
220
  setScrollToDiscuss: setScrollToDiscuss,
221
+ isVideoChatEnabled: isVideoChatEnabled,
220
222
  ...otherProps
221
223
  })
222
224
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Divider, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.CardActions, {
@@ -431,7 +431,9 @@ function Classroom({
431
431
  setSelectedDiscussion,
432
432
  meetingRecsData,
433
433
  hasBadLanguage,
434
- handleArchiveSubmissions
434
+ handleArchiveSubmissions,
435
+ isVideoChatEnabled,
436
+ isVideoChatEnabledInSettings
435
437
  } = vchatProps;
436
438
  const isSmallScreen = (0, _useMediaQuery.default)("(max-width:410px)");
437
439
  const {
@@ -444,9 +446,7 @@ function Classroom({
444
446
  const [isPictureDialogOpen, setIsPictureDialogOpen] = (0, _react.useState)(false);
445
447
  const [overwriteValue, setOverwriteValue] = (0, _react.useState)(null);
446
448
  const [scrollToDiscuss, setScrollToDiscuss] = (0, _react.useState)(false);
447
- const [isWaysideClassroom, setIsWaysideClassroom] = (0, _react.useState)(false);
448
- const [isVideoChatEnabled, setIsVideoChatEnabled] = (0, _react.useState)(false);
449
- const [isVideoChatEnabledInSettings, setIsVideoChatEnabledInSettings] = (0, _react.useState)(false);
449
+ const isWaysideClassroom = classroom?.classroomId?.toLowerCase().includes("wayside");
450
450
  const [isSubscriptionExpired, setIsSubscriptionExpired] = (0, _react.useState)(false);
451
451
  let tabs;
452
452
  (0, _react.useEffect)(() => {
@@ -721,8 +721,6 @@ function Classroom({
721
721
  picture,
722
722
  pictureXs,
723
723
  isCreator,
724
- vchatEnabled,
725
- vchatEnabledInSettings,
726
724
  createdBy,
727
725
  userImage,
728
726
  verificationStatus,
@@ -798,15 +796,6 @@ function Classroom({
798
796
  window.location.hash = "#Settings";
799
797
  setScrollToDiscuss(true);
800
798
  };
801
- if (!isWaysideClassroom && classroomId && classroomId.toLowerCase().includes("wayside")) {
802
- setIsWaysideClassroom(true);
803
- }
804
- if (!isVideoChatEnabled && (vchatEnabled === true || localStorage.getItem("vchat-enabled") === "true" || isCreator && vchatEnabled !== false || isMember && vchatEnabled !== false && vchatEnabledInSettings)) {
805
- setIsVideoChatEnabled(true);
806
- }
807
- if (!isVideoChatEnabledInSettings && (isVideoChatEnabled && (vchatEnabledInSettings === true || vchatEnabled === true && isWaysideClassroom && vchatEnabledInSettings !== false) || localStorage.getItem("vchat-enabled") === "true")) {
808
- setIsVideoChatEnabledInSettings(true);
809
- }
810
799
  tabs = [{
811
800
  label: t("courses"),
812
801
  id: "Courses",
@@ -907,7 +896,7 @@ function Classroom({
907
896
  refreshAssignments: refreshAssignments
908
897
  })
909
898
  }, `tab-content-assignments`)
910
- }] : []), ...(isWaysideClassroom && isVideoChatEnabled && isNualangLiveEnabled && (isMember && isVideoChatEnabledInSettings || isCreator) ? [{
899
+ }] : []), ...(isVideoChatEnabled && isNualangLiveEnabled && (isMember && isVideoChatEnabledInSettings || isCreator) ? [{
911
900
  label: t("discuss"),
912
901
  id: "Discuss",
913
902
  disabled: false,
@@ -1084,7 +1073,8 @@ function Classroom({
1084
1073
  setScrollToDiscuss: setScrollToDiscuss,
1085
1074
  isClassroomArchived: isArchived,
1086
1075
  classroomMembers: classroomMembers,
1087
- verificationStatus: verificationStatus
1076
+ verificationStatus: verificationStatus,
1077
+ isVideoChatEnabled: isVideoChatEnabled
1088
1078
  })
1089
1079
  }, `tab-content-settings`)
1090
1080
  }] : [])];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nualang/nualang-ui-components",
3
- "version": "0.1.1227",
3
+ "version": "0.1.1228",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist",