@selfcommunity/react-ui 0.10.4-alpha.4 → 0.10.4-alpha.6

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.
@@ -274,12 +274,12 @@ function Composer(inProps) {
274
274
  dialogRef.current.addEventListener('touchmove', handleTouchmove);
275
275
  (0, body_scroll_lock_1.disableBodyScroll)(dialogRef.current, {
276
276
  allowTouchMove: (el) => {
277
- return (el &&
278
- typeof el === 'object' &&
279
- el.className &&
280
- typeof el.className === 'string' &&
281
- el.className.include &&
282
- el.className.include('SCComposer-content'));
277
+ while (el && el !== document.body) {
278
+ if (el.getAttribute('class') !== null && el.getAttribute('class').includes('SCComposer-content')) {
279
+ return true;
280
+ }
281
+ el = el.parentElement;
282
+ }
283
283
  }
284
284
  });
285
285
  return () => {
@@ -29,7 +29,7 @@ function EventInfoDetails(inProps) {
29
29
  const { event, eventId, hideDateIcon = false, hideRecurringIcon = false, hidePrivacyIcon = false, hideLocationIcon = false, hideCreatedIcon = false, hasDateInfo = true, hasRecurringInfo = false, hasPrivacyInfo = true, hasLocationInfo = true, hasCreatedInfo = false, hasInProgress = false, beforeDateInfo, beforeRecurringInfo, beforePrivacyInfo, beforeLocationInfo, beforeCreatedInfo } = props;
30
30
  // HOOKS
31
31
  const intl = (0, react_intl_1.useIntl)();
32
- const { scEvent } = (0, react_core_1.useSCFetchEvent)({ id: eventId, event });
32
+ const { scEvent } = (0, react_core_1.useSCFetchEvent)({ id: eventId, event, autoSubscribe: false });
33
33
  const privacy = (0, react_1.useMemo)(() => (scEvent && scEvent.privacy === types_1.SCEventPrivacyType.PUBLIC ? 'ui.eventInfoDetails.privacy.public' : 'ui.eventInfoDetails.privacy.private'), [scEvent]);
34
34
  const location = (0, react_1.useMemo)(() => scEvent && scEvent.location === types_1.SCEventLocationType.ONLINE ? 'ui.eventInfoDetails.location.virtual' : 'ui.eventInfoDetails.location.inPerson', [scEvent]);
35
35
  if (!scEvent) {
@@ -272,12 +272,12 @@ export default function Composer(inProps) {
272
272
  dialogRef.current.addEventListener('touchmove', handleTouchmove);
273
273
  disableBodyScroll(dialogRef.current, {
274
274
  allowTouchMove: (el) => {
275
- return (el &&
276
- typeof el === 'object' &&
277
- el.className &&
278
- typeof el.className === 'string' &&
279
- el.className.include &&
280
- el.className.include('SCComposer-content'));
275
+ while (el && el !== document.body) {
276
+ if (el.getAttribute('class') !== null && el.getAttribute('class').includes('SCComposer-content')) {
277
+ return true;
278
+ }
279
+ el = el.parentElement;
280
+ }
281
281
  }
282
282
  });
283
283
  return () => {
@@ -27,7 +27,7 @@ export default function EventInfoDetails(inProps) {
27
27
  const { event, eventId, hideDateIcon = false, hideRecurringIcon = false, hidePrivacyIcon = false, hideLocationIcon = false, hideCreatedIcon = false, hasDateInfo = true, hasRecurringInfo = false, hasPrivacyInfo = true, hasLocationInfo = true, hasCreatedInfo = false, hasInProgress = false, beforeDateInfo, beforeRecurringInfo, beforePrivacyInfo, beforeLocationInfo, beforeCreatedInfo } = props;
28
28
  // HOOKS
29
29
  const intl = useIntl();
30
- const { scEvent } = useSCFetchEvent({ id: eventId, event });
30
+ const { scEvent } = useSCFetchEvent({ id: eventId, event, autoSubscribe: false });
31
31
  const privacy = useMemo(() => (scEvent && scEvent.privacy === SCEventPrivacyType.PUBLIC ? 'ui.eventInfoDetails.privacy.public' : 'ui.eventInfoDetails.privacy.private'), [scEvent]);
32
32
  const location = useMemo(() => scEvent && scEvent.location === SCEventLocationType.ONLINE ? 'ui.eventInfoDetails.location.virtual' : 'ui.eventInfoDetails.location.inPerson', [scEvent]);
33
33
  if (!scEvent) {