@selfcommunity/react-templates 0.4.8-payments.217 → 0.4.8-payments.219

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.
@@ -185,13 +185,16 @@ function UserProfile(inProps) {
185
185
  const isMe = (0, react_1.useMemo)(() => scUserContext.user && (scUser === null || scUser === void 0 ? void 0 : scUser.id) === scUserContext.user.id, [scUserContext.user, scUser]);
186
186
  const followEnabled = (0, react_1.useMemo)(() => react_core_1.SCPreferences.CONFIGURATIONS_FOLLOW_ENABLED in scPreferencesContext.preferences &&
187
187
  scPreferencesContext.preferences[react_core_1.SCPreferences.CONFIGURATIONS_FOLLOW_ENABLED].value, [scPreferencesContext.preferences]);
188
- const privateMessagingEnabled = (0, react_1.useMemo)(() => features.includes(types_1.SCFeatureName.PRIVATE_MESSAGING), [features]);
188
+ const connectionEnabled = react_core_1.SCPreferences.CONFIGURATIONS_CONNECTION_ENABLED in scPreferencesContext.preferences &&
189
+ scPreferencesContext.preferences[react_core_1.SCPreferences.CONFIGURATIONS_CONNECTION_ENABLED].value;
190
+ const privateMessagingEnabled = (0, react_1.useMemo)(() => react_core_1.SCPreferences.ADDONS_PRIVATE_MESSAGES_ENABLED in scPreferencesContext.preferences &&
191
+ scPreferencesContext.preferences[react_core_1.SCPreferences.ADDONS_PRIVATE_MESSAGES_ENABLED].value, [scPreferencesContext.preferences]);
189
192
  const _widgets = (0, react_1.useMemo)(() => {
190
193
  var _a, _b;
191
194
  if (widgets !== null) {
192
195
  return widgets;
193
196
  }
194
- if (!scUser) {
197
+ if (!scUser || (!followEnabled && !connectionEnabled)) {
195
198
  return [];
196
199
  }
197
200
  let _widgets = [];
@@ -182,13 +182,16 @@ export default function UserProfile(inProps) {
182
182
  const isMe = useMemo(() => scUserContext.user && (scUser === null || scUser === void 0 ? void 0 : scUser.id) === scUserContext.user.id, [scUserContext.user, scUser]);
183
183
  const followEnabled = useMemo(() => SCPreferences.CONFIGURATIONS_FOLLOW_ENABLED in scPreferencesContext.preferences &&
184
184
  scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_FOLLOW_ENABLED].value, [scPreferencesContext.preferences]);
185
- const privateMessagingEnabled = useMemo(() => features.includes(SCFeatureName.PRIVATE_MESSAGING), [features]);
185
+ const connectionEnabled = SCPreferences.CONFIGURATIONS_CONNECTION_ENABLED in scPreferencesContext.preferences &&
186
+ scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_CONNECTION_ENABLED].value;
187
+ const privateMessagingEnabled = useMemo(() => SCPreferences.ADDONS_PRIVATE_MESSAGES_ENABLED in scPreferencesContext.preferences &&
188
+ scPreferencesContext.preferences[SCPreferences.ADDONS_PRIVATE_MESSAGES_ENABLED].value, [scPreferencesContext.preferences]);
186
189
  const _widgets = useMemo(() => {
187
190
  var _a, _b;
188
191
  if (widgets !== null) {
189
192
  return widgets;
190
193
  }
191
- if (!scUser) {
194
+ if (!scUser || (!followEnabled && !connectionEnabled)) {
192
195
  return [];
193
196
  }
194
197
  let _widgets = [];