@selfcommunity/react-ui 0.7.52 → 0.7.53-alpha.1

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.
@@ -190,6 +190,7 @@ function PlatformWidget(inProps) {
190
190
  const isAdmin = (0, react_1.useMemo)(() => react_core_1.UserUtils.isAdmin(scUserContext.user), [scUserContext.user]);
191
191
  const isEditor = (0, react_1.useMemo)(() => react_core_1.UserUtils.isEditor(scUserContext.user), [scUserContext.user]);
192
192
  const isModerator = (0, react_1.useMemo)(() => react_core_1.UserUtils.isModerator(scUserContext.user), [scUserContext.user]);
193
+ const isCommunityOwner = (0, react_1.useMemo)(() => { var _a; return ((_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.id) === 1; }, [scUserContext.user]);
193
194
  const isStage = scContext.settings.portal.includes('stage');
194
195
  const actions = [
195
196
  ...startActions,
@@ -213,7 +214,7 @@ function PlatformWidget(inProps) {
213
214
  }
214
215
  ]
215
216
  : []),
216
- ...(isAdmin && !hideHubAction
217
+ ...(isAdmin && isCommunityOwner && !hideHubAction
217
218
  ? [
218
219
  {
219
220
  render: (react_1.default.createElement(material_1.Button, { variant: "outlined", size: "small", component: react_core_1.Link, to: isStage ? constants_1.HUB_STAGE : constants_1.HUB_PROD, target: "_blank" },
@@ -223,7 +224,7 @@ function PlatformWidget(inProps) {
223
224
  }
224
225
  ]
225
226
  : []),
226
- ...(!hideContactUsAction
227
+ ...(isCommunityOwner && !hideContactUsAction
227
228
  ? [
228
229
  {
229
230
  render: (react_1.default.createElement(material_1.Button, { variant: "outlined", size: "small", component: react_core_1.Link, to: isStage ? constants_1.CONTACT_STAGE : constants_1.CONTACT_PROD, target: "_blank" },
@@ -188,6 +188,7 @@ export default function PlatformWidget(inProps) {
188
188
  const isAdmin = useMemo(() => UserUtils.isAdmin(scUserContext.user), [scUserContext.user]);
189
189
  const isEditor = useMemo(() => UserUtils.isEditor(scUserContext.user), [scUserContext.user]);
190
190
  const isModerator = useMemo(() => UserUtils.isModerator(scUserContext.user), [scUserContext.user]);
191
+ const isCommunityOwner = useMemo(() => { var _a; return ((_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.id) === 1; }, [scUserContext.user]);
191
192
  const isStage = scContext.settings.portal.includes('stage');
192
193
  const actions = [
193
194
  ...startActions,
@@ -211,7 +212,7 @@ export default function PlatformWidget(inProps) {
211
212
  }
212
213
  ]
213
214
  : []),
214
- ...(isAdmin && !hideHubAction
215
+ ...(isAdmin && isCommunityOwner && !hideHubAction
215
216
  ? [
216
217
  {
217
218
  render: (React.createElement(Button, { variant: "outlined", size: "small", component: Link, to: isStage ? HUB_STAGE : HUB_PROD, target: "_blank" },
@@ -221,7 +222,7 @@ export default function PlatformWidget(inProps) {
221
222
  }
222
223
  ]
223
224
  : []),
224
- ...(!hideContactUsAction
225
+ ...(isCommunityOwner && !hideContactUsAction
225
226
  ? [
226
227
  {
227
228
  render: (React.createElement(Button, { variant: "outlined", size: "small", component: Link, to: isStage ? CONTACT_STAGE : CONTACT_PROD, target: "_blank" },