@selfcommunity/react-core 0.6.7-payments.183 → 0.6.7-payments.185

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.
@@ -4,7 +4,7 @@ exports.useSCTheme = exports.withSCTheme = exports.SCThemeContext = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  const react_1 = require("react");
7
- const ThemeProvider_1 = tslib_1.__importDefault(require("@mui/material/styles/ThemeProvider"));
7
+ const material_1 = require("@mui/material");
8
8
  const theme_1 = tslib_1.__importDefault(require("../../../themes/theme"));
9
9
  const SCContextProvider_1 = require("../SCContextProvider");
10
10
  const SCPreferencesProvider_1 = require("../SCPreferencesProvider");
@@ -60,7 +60,7 @@ function SCThemeProvider({ children = null }) {
60
60
  (0, use_deep_compare_effect_1.useDeepCompareEffectNoCheck)(() => {
61
61
  setCustomTheme(theme);
62
62
  }, [scContext.settings.theme]);
63
- return ((0, jsx_runtime_1.jsx)(exports.SCThemeContext.Provider, Object.assign({ value: { theme, setTheme: setCustomTheme } }, { children: (0, jsx_runtime_1.jsx)(ThemeProvider_1.default, Object.assign({ theme: theme }, { children: children })) })));
63
+ return ((0, jsx_runtime_1.jsx)(exports.SCThemeContext.Provider, Object.assign({ value: { theme, setTheme: setCustomTheme } }, { children: (0, jsx_runtime_1.jsx)(material_1.ThemeProvider, Object.assign({ theme: theme }, { children: children })) })));
64
64
  }
65
65
  exports.default = SCThemeProvider;
66
66
  /**
@@ -69,7 +69,7 @@ exports.default = SCThemeProvider;
69
69
  */
70
70
  const withSCTheme = (Component) => (props) => {
71
71
  const scThemeContext = (0, react_1.useContext)(exports.SCThemeContext);
72
- return ((0, jsx_runtime_1.jsx)(ThemeProvider_1.default, Object.assign({ theme: scThemeContext.theme }, { children: (0, jsx_runtime_1.jsx)(Component, Object.assign({ setTheme: scThemeContext.setTheme }, props)) })));
72
+ return ((0, jsx_runtime_1.jsx)(material_1.ThemeProvider, Object.assign({ theme: scThemeContext.theme }, { children: (0, jsx_runtime_1.jsx)(Component, Object.assign({ setTheme: scThemeContext.setTheme }, props)) })));
73
73
  };
74
74
  exports.withSCTheme = withSCTheme;
75
75
  /**
@@ -13,8 +13,6 @@ const Notification_1 = require("../constants/Notification");
13
13
  const Preferences_1 = require("../constants/Preferences");
14
14
  const event_1 = require("../utils/event");
15
15
  const useSCCachingManager_1 = tslib_1.__importDefault(require("./useSCCachingManager"));
16
- const SCRoutingProvider_1 = require("../components/provider/SCRoutingProvider");
17
- const SCRoutes = tslib_1.__importStar(require("../constants/Routes"));
18
16
  /**
19
17
  :::info
20
18
  This custom hook is used to manage the events followed.
@@ -32,7 +30,6 @@ const SCRoutes = tslib_1.__importStar(require("../constants/Routes"));
32
30
  function useSCSubscribedEventsManager(user) {
33
31
  const { cache, updateCache, emptyCache, data, setData, loading, setLoading, setUnLoading, isLoading } = (0, useSCCachingManager_1.default)();
34
32
  const { preferences, features } = (0, SCPreferencesProvider_1.useSCPreferences)();
35
- const scRoutingContext = (0, react_1.useContext)(SCRoutingProvider_1.SCRoutingContext);
36
33
  const authUserId = user ? user.id : null;
37
34
  const eventsEnabled = (0, react_1.useMemo)(() => preferences &&
38
35
  features &&
@@ -69,10 +66,6 @@ function useSCSubscribedEventsManager(user) {
69
66
  switch (Notification_1.SCNotificationMapping[dataMsg.data.activity_type]) {
70
67
  case types_1.SCNotificationTypologyType.USER_INVITED_TO_JOIN_EVENT:
71
68
  _status = types_1.SCEventSubscriptionStatusType.INVITED;
72
- if ((0, utils_1.isClientSideRendering)() &&
73
- window.document.location.href.indexOf(scRoutingContext.url(SCRoutes.EVENT_ROUTE_NAME, dataMsg.data.notification_obj.event)) > -1) {
74
- checkEventSubscriptionStatus(dataMsg.data.notification_obj.event);
75
- }
76
69
  break;
77
70
  /* case SCNotificationTypologyType.USER_REQUESTED_TO_JOIN_EVENT:
78
71
  _status = SCEventSubscriptionStatusType.REQUESTED;
@@ -7,7 +7,7 @@ const react_1 = require("react");
7
7
  const SCContextProvider_1 = require("../components/provider/SCContextProvider");
8
8
  const SCUserProvider_1 = require("../components/provider/SCUserProvider");
9
9
  const utils_1 = require("@selfcommunity/utils");
10
- const Button_1 = tslib_1.__importDefault(require("@mui/material/Button"));
10
+ const material_1 = require("@mui/material");
11
11
  const utils_2 = require("@selfcommunity/utils");
12
12
  const Errors_1 = require("../constants/Errors");
13
13
  const api_services_1 = require("@selfcommunity/api-services");
@@ -61,7 +61,7 @@ function useSCWebPushMessaging() {
61
61
  const showCustomRequestNotificationSnackbar = () => {
62
62
  if (!js_cookie_1.default.get(Notifications_1.NOTIFICATIONS_WEB_PUSH_MESSAGING_DIALOG_COOKIE)) {
63
63
  enqueueSnackbar(intl.formatMessage({ id: 'ui.webPushNotification.requestPermission', defaultMessage: 'ui.webPushNotification.requestPermission' }), {
64
- action: (snackbarId) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Button_1.default, Object.assign({ size: "small", sx: { color: '#FFF' }, onClick: () => requestNotificationPermission(snackbarId) }, { children: intl.formatMessage({ id: 'ui.webPushNotification.allow', defaultMessage: 'ui.webPushNotification.allow' }) })), (0, jsx_runtime_1.jsx)(Button_1.default, Object.assign({ size: "small", sx: { color: '#FFF' }, onClick: () => closeRequestNotificationSnackbar(snackbarId) }, { children: intl.formatMessage({ id: 'ui.webPushNotification.block', defaultMessage: 'ui.webPushNotification.block' }) }))] })),
64
+ action: (snackbarId) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", sx: { color: '#FFF' }, onClick: () => requestNotificationPermission(snackbarId) }, { children: intl.formatMessage({ id: 'ui.webPushNotification.allow', defaultMessage: 'ui.webPushNotification.allow' }) })), (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", sx: { color: '#FFF' }, onClick: () => closeRequestNotificationSnackbar(snackbarId) }, { children: intl.formatMessage({ id: 'ui.webPushNotification.block', defaultMessage: 'ui.webPushNotification.block' }) }))] })),
65
65
  variant: 'default',
66
66
  anchorOrigin: { horizontal: 'center', vertical: 'bottom' },
67
67
  preventDuplicate: true,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const createTheme_1 = tslib_1.__importDefault(require("@mui/material/styles/createTheme"));
4
+ const material_1 = require("@mui/material");
5
5
  const utils_1 = require("@selfcommunity/utils");
6
6
  const validate_color_1 = tslib_1.__importDefault(require("validate-color"));
7
7
  const Preferences_1 = require("../constants/Preferences");
@@ -72,6 +72,6 @@ const getTheme = (options, preferences) => {
72
72
  typography: Object.assign({}, (isValidPreference(preferences, Preferences_1.STYLE_FONT_FAMILY, utils_2.isString) && { fontFamily: preferences[Preferences_1.STYLE_FONT_FAMILY].value })),
73
73
  }
74
74
  : {};
75
- return (0, createTheme_1.default)((0, utils_1.mergeDeep)(Object.assign({ selfcommunity }, defaultOptions), options));
75
+ return (0, material_1.createTheme)((0, utils_1.mergeDeep)(Object.assign({ selfcommunity }, defaultOptions), options));
76
76
  };
77
77
  exports.default = getTheme;
@@ -1,4 +1,4 @@
1
- import { Theme as MuiTheme } from '@mui/material/styles/createTheme';
1
+ import { Theme as MuiTheme } from '@mui/material';
2
2
  /**
3
3
  * Interface SCThemeAvatarVariableType
4
4
  */
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { createContext, useContext, useState } from 'react';
3
- import ThemeProvider from '@mui/material/styles/ThemeProvider';
3
+ import { ThemeProvider } from '@mui/material';
4
4
  import getTheme from '../../../themes/theme';
5
5
  import { useSCContext } from '../SCContextProvider';
6
6
  import { useSCPreferences } from '../SCPreferencesProvider';
@@ -1,8 +1,8 @@
1
1
  import { Endpoints, http } from '@selfcommunity/api-services';
2
2
  import { SCEventSubscriptionStatusType, SCFeatureName, SCNotificationTopicType, SCNotificationTypologyType, } from '@selfcommunity/types';
3
- import { isClientSideRendering, Logger } from '@selfcommunity/utils';
3
+ import { Logger } from '@selfcommunity/utils';
4
4
  import PubSub from 'pubsub-js';
5
- import { useContext, useEffect, useMemo, useRef } from 'react';
5
+ import { useEffect, useMemo, useRef } from 'react';
6
6
  import { useDeepCompareEffectNoCheck } from 'use-deep-compare-effect';
7
7
  import { useSCPreferences } from '../components/provider/SCPreferencesProvider';
8
8
  import { SCOPE_SC_CORE } from '../constants/Errors';
@@ -10,8 +10,6 @@ import { SCNotificationMapping } from '../constants/Notification';
10
10
  import { CONFIGURATIONS_EVENTS_ENABLED } from '../constants/Preferences';
11
11
  import { getEventStatus } from '../utils/event';
12
12
  import useSCCachingManager from './useSCCachingManager';
13
- import { SCRoutingContext } from '../components/provider/SCRoutingProvider';
14
- import * as SCRoutes from '../constants/Routes';
15
13
  /**
16
14
  :::info
17
15
  This custom hook is used to manage the events followed.
@@ -29,7 +27,6 @@ import * as SCRoutes from '../constants/Routes';
29
27
  export default function useSCSubscribedEventsManager(user) {
30
28
  const { cache, updateCache, emptyCache, data, setData, loading, setLoading, setUnLoading, isLoading } = useSCCachingManager();
31
29
  const { preferences, features } = useSCPreferences();
32
- const scRoutingContext = useContext(SCRoutingContext);
33
30
  const authUserId = user ? user.id : null;
34
31
  const eventsEnabled = useMemo(() => preferences &&
35
32
  features &&
@@ -66,10 +63,6 @@ export default function useSCSubscribedEventsManager(user) {
66
63
  switch (SCNotificationMapping[dataMsg.data.activity_type]) {
67
64
  case SCNotificationTypologyType.USER_INVITED_TO_JOIN_EVENT:
68
65
  _status = SCEventSubscriptionStatusType.INVITED;
69
- if (isClientSideRendering() &&
70
- window.document.location.href.indexOf(scRoutingContext.url(SCRoutes.EVENT_ROUTE_NAME, dataMsg.data.notification_obj.event)) > -1) {
71
- checkEventSubscriptionStatus(dataMsg.data.notification_obj.event);
72
- }
73
66
  break;
74
67
  /* case SCNotificationTypologyType.USER_REQUESTED_TO_JOIN_EVENT:
75
68
  _status = SCEventSubscriptionStatusType.REQUESTED;
@@ -3,7 +3,7 @@ import { useContext, useEffect, useRef, useState } from 'react';
3
3
  import { useSCContext } from '../components/provider/SCContextProvider';
4
4
  import { useSCUser } from '../components/provider/SCUserProvider';
5
5
  import { Logger } from '@selfcommunity/utils';
6
- import Button from '@mui/material/Button';
6
+ import { Button } from '@mui/material';
7
7
  import { loadVersionBrowser, urlB64ToUint8Array } from '@selfcommunity/utils';
8
8
  import { SCOPE_SC_CORE } from '../constants/Errors';
9
9
  import { http, Endpoints } from '@selfcommunity/api-services';
@@ -1,4 +1,4 @@
1
- import createTheme from '@mui/material/styles/createTheme';
1
+ import { createTheme } from '@mui/material';
2
2
  import { mergeDeep } from '@selfcommunity/utils';
3
3
  import validateColor from 'validate-color';
4
4
  import { COLORS_COLORBACK, COLORS_COLORPRIMARY, COLORS_COLORSECONDARY, COLORS_COLORFONT, COLORS_COLORFONTSECONDARY, COLORS_NAVBARBACK, STYLE_FONT_FAMILY, } from '../constants/Preferences';
@@ -1,4 +1,4 @@
1
- import { Theme as MuiTheme } from '@mui/material/styles/createTheme';
1
+ import { Theme as MuiTheme } from '@mui/material';
2
2
  /**
3
3
  * Interface SCThemeAvatarVariableType
4
4
  */