@selfcommunity/react-ui 0.11.0-alpha.91 → 0.11.0-alpha.93
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.
- package/lib/cjs/components/Feed/Feed.js +13 -1
- package/lib/cjs/components/Footer/Footer.js +4 -1
- package/lib/cjs/components/NavigationSettingsIconButton/NavigationSettingsIconButton.js +1 -1
- package/lib/cjs/components/PlatformWidget/PlatformWidget.js +1 -2
- package/lib/esm/components/Feed/Feed.js +13 -1
- package/lib/esm/components/Footer/Footer.js +5 -2
- package/lib/esm/components/NavigationSettingsIconButton/NavigationSettingsIconButton.js +2 -2
- package/lib/esm/components/PlatformWidget/PlatformWidget.js +1 -2
- package/lib/umd/{362.js → 250.js} +2 -2
- package/lib/umd/react-ui.js +1 -1
- package/package.json +6 -6
- /package/lib/umd/{362.js.LICENSE.txt → 250.js.LICENSE.txt} +0 -0
|
@@ -25,6 +25,7 @@ const Skeleton_2 = tslib_1.__importDefault(require("./Skeleton"));
|
|
|
25
25
|
const use_deep_compare_effect_1 = require("use-deep-compare-effect");
|
|
26
26
|
const StickyBox_1 = tslib_1.__importDefault(require("../../shared/StickyBox"));
|
|
27
27
|
const constants_1 = require("./constants");
|
|
28
|
+
const FooterWidget_1 = tslib_1.__importDefault(require("../FooterWidget"));
|
|
28
29
|
const messages = (0, react_intl_1.defineMessages)({
|
|
29
30
|
refresh: {
|
|
30
31
|
id: 'ui.feed.refreshRelease',
|
|
@@ -168,7 +169,18 @@ const Feed = (inProps, ref) => {
|
|
|
168
169
|
position: 0
|
|
169
170
|
}
|
|
170
171
|
]
|
|
171
|
-
: [])
|
|
172
|
+
: []),
|
|
173
|
+
...(oneColLayout
|
|
174
|
+
? []
|
|
175
|
+
: [
|
|
176
|
+
{
|
|
177
|
+
type: 'widget',
|
|
178
|
+
component: FooterWidget_1.default,
|
|
179
|
+
componentProps: {},
|
|
180
|
+
column: 'right',
|
|
181
|
+
position: 1
|
|
182
|
+
}
|
|
183
|
+
])
|
|
172
184
|
]
|
|
173
185
|
.map((w, i) => Object.assign({}, w, { position: w.position * (w.column === 'right' ? 5 : 1), id: `${w.column}_${i}` }))
|
|
174
186
|
.sort(feed_1.widgetSort), [widgets, advEnabled]);
|
|
@@ -6,6 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const system_1 = require("@mui/system");
|
|
7
7
|
const material_1 = require("@mui/material");
|
|
8
8
|
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
9
|
+
const types_1 = require("@selfcommunity/types");
|
|
9
10
|
const utils_1 = require("@selfcommunity/utils");
|
|
10
11
|
const react_core_1 = require("@selfcommunity/react-core");
|
|
11
12
|
const Skeleton_1 = tslib_1.__importDefault(require("./Skeleton"));
|
|
@@ -53,8 +54,10 @@ function Footer(inProps) {
|
|
|
53
54
|
name: constants_1.PREFIX
|
|
54
55
|
});
|
|
55
56
|
const { className, menu = null, startActions = null, endActions = null } = props, rest = tslib_1.__rest(props, ["className", "menu", "startActions", "endActions"]);
|
|
57
|
+
// CONTEXT
|
|
58
|
+
const scUserContext = (0, react_core_1.useSCUser)();
|
|
56
59
|
// HOOKS
|
|
57
|
-
const { _menu, loading } = (0, react_core_1.useFetchMenuFooter)(menu);
|
|
60
|
+
const { _menu, loading } = (0, react_core_1.useFetchMenuFooter)(scUserContext.user ? types_1.SCCustomMenu.BASE : types_1.SCCustomMenu.NOT_LOGGED, menu);
|
|
58
61
|
// PREFERENCES
|
|
59
62
|
const { preferences } = (0, react_core_1.useSCPreferences)();
|
|
60
63
|
const copyright = (0, react_1.useMemo)(() => {
|
|
@@ -87,7 +87,7 @@ function NavigationSettingsIconButton(inProps) {
|
|
|
87
87
|
const theme = (0, material_1.useTheme)();
|
|
88
88
|
const isMobile = (0, material_1.useMediaQuery)(theme.breakpoints.down('md'));
|
|
89
89
|
const scRoutingContext = (0, react_core_1.useSCRouting)();
|
|
90
|
-
const { _menu } = (0, react_core_1.useFetchMenuFooter)(
|
|
90
|
+
const { _menu } = (0, react_core_1.useFetchMenuFooter)(types_1.SCCustomMenu.USER);
|
|
91
91
|
// PREFERENCES
|
|
92
92
|
const scPreferences = (0, react_core_1.useSCPreferences)();
|
|
93
93
|
const preferences = (0, react_1.useMemo)(() => {
|
|
@@ -172,7 +172,6 @@ const Root = (0, material_1.styled)(Widget_1.default, {
|
|
|
172
172
|
* @param inProps
|
|
173
173
|
*/
|
|
174
174
|
function PlatformWidget(inProps) {
|
|
175
|
-
var _a;
|
|
176
175
|
// PROPS
|
|
177
176
|
const props = (0, system_1.useThemeProps)({
|
|
178
177
|
props: inProps,
|
|
@@ -304,7 +303,7 @@ function PlatformWidget(inProps) {
|
|
|
304
303
|
/**
|
|
305
304
|
* Renders root object (if not hidden by autoHide prop)
|
|
306
305
|
*/
|
|
307
|
-
if (!autoHide && (
|
|
306
|
+
if (!autoHide && (isAdmin || isEditor || isModerator)) {
|
|
308
307
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className, { [classes.tutorialOpen]: isTutorialOpen }) }, rest, { children: [content, tutorial] })), (0, jsx_runtime_1.jsx)(material_1.Backdrop, { sx: { color: '#fff', zIndex: (theme) => theme.zIndex.drawer + 1 }, open: isTutorialOpen, onClick: handleCloseTutorial })] }));
|
|
309
308
|
}
|
|
310
309
|
return (0, jsx_runtime_1.jsx)(HiddenPlaceholder_1.default, {});
|
|
@@ -22,6 +22,7 @@ import FeedSkeleton from './Skeleton';
|
|
|
22
22
|
import { useDeepCompareEffectNoCheck } from 'use-deep-compare-effect';
|
|
23
23
|
import StickyBoxComp from '../../shared/StickyBox';
|
|
24
24
|
import { PREFIX } from './constants';
|
|
25
|
+
import FooterWidget from '../FooterWidget';
|
|
25
26
|
const messages = defineMessages({
|
|
26
27
|
refresh: {
|
|
27
28
|
id: 'ui.feed.refreshRelease',
|
|
@@ -165,7 +166,18 @@ const Feed = (inProps, ref) => {
|
|
|
165
166
|
position: 0
|
|
166
167
|
}
|
|
167
168
|
]
|
|
168
|
-
: [])
|
|
169
|
+
: []),
|
|
170
|
+
...(oneColLayout
|
|
171
|
+
? []
|
|
172
|
+
: [
|
|
173
|
+
{
|
|
174
|
+
type: 'widget',
|
|
175
|
+
component: FooterWidget,
|
|
176
|
+
componentProps: {},
|
|
177
|
+
column: 'right',
|
|
178
|
+
position: 1
|
|
179
|
+
}
|
|
180
|
+
])
|
|
169
181
|
]
|
|
170
182
|
.map((w, i) => Object.assign({}, w, { position: w.position * (w.column === 'right' ? 5 : 1), id: `${w.column}_${i}` }))
|
|
171
183
|
.sort(widgetSort), [widgets, advEnabled]);
|
|
@@ -4,8 +4,9 @@ import { useMemo } from 'react';
|
|
|
4
4
|
import { useThemeProps } from '@mui/system';
|
|
5
5
|
import { Box, Button, Typography, styled } from '@mui/material';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
|
+
import { SCCustomMenu } from '@selfcommunity/types';
|
|
7
8
|
import { sortByAttr } from '@selfcommunity/utils';
|
|
8
|
-
import { Link, SCPreferences, useFetchMenuFooter, useSCPreferences } from '@selfcommunity/react-core';
|
|
9
|
+
import { Link, SCPreferences, useFetchMenuFooter, useSCPreferences, useSCUser } from '@selfcommunity/react-core';
|
|
9
10
|
import FooterSkeleton from './Skeleton';
|
|
10
11
|
import { PREFIX, EXPLORE_MENU_ITEM } from './constants';
|
|
11
12
|
const classes = {
|
|
@@ -51,8 +52,10 @@ export default function Footer(inProps) {
|
|
|
51
52
|
name: PREFIX
|
|
52
53
|
});
|
|
53
54
|
const { className, menu = null, startActions = null, endActions = null } = props, rest = __rest(props, ["className", "menu", "startActions", "endActions"]);
|
|
55
|
+
// CONTEXT
|
|
56
|
+
const scUserContext = useSCUser();
|
|
54
57
|
// HOOKS
|
|
55
|
-
const { _menu, loading } = useFetchMenuFooter(menu);
|
|
58
|
+
const { _menu, loading } = useFetchMenuFooter(scUserContext.user ? SCCustomMenu.BASE : SCCustomMenu.NOT_LOGGED, menu);
|
|
56
59
|
// PREFERENCES
|
|
57
60
|
const { preferences } = useSCPreferences();
|
|
58
61
|
const copyright = useMemo(() => {
|
|
@@ -9,7 +9,7 @@ import { FormattedMessage } from 'react-intl';
|
|
|
9
9
|
import { PreferenceService, UserService } from '@selfcommunity/api-services';
|
|
10
10
|
import { SCOPE_SC_UI } from '../../constants/Errors';
|
|
11
11
|
import { Logger, sortByAttr } from '@selfcommunity/utils';
|
|
12
|
-
import { SCPreferenceName } from '@selfcommunity/types';
|
|
12
|
+
import { SCCustomMenu, SCPreferenceName } from '@selfcommunity/types';
|
|
13
13
|
import { EXPLORE_MENU_ITEM } from '../Footer/constants';
|
|
14
14
|
const PREFIX = 'SCNavigationSettingsIconButton';
|
|
15
15
|
const classes = {
|
|
@@ -85,7 +85,7 @@ export default function NavigationSettingsIconButton(inProps) {
|
|
|
85
85
|
const theme = useTheme();
|
|
86
86
|
const isMobile = useMediaQuery(theme.breakpoints.down('md'));
|
|
87
87
|
const scRoutingContext = useSCRouting();
|
|
88
|
-
const { _menu } = useFetchMenuFooter(
|
|
88
|
+
const { _menu } = useFetchMenuFooter(SCCustomMenu.USER);
|
|
89
89
|
// PREFERENCES
|
|
90
90
|
const scPreferences = useSCPreferences();
|
|
91
91
|
const preferences = useMemo(() => {
|
|
@@ -170,7 +170,6 @@ const Root = styled(Widget, {
|
|
|
170
170
|
* @param inProps
|
|
171
171
|
*/
|
|
172
172
|
export default function PlatformWidget(inProps) {
|
|
173
|
-
var _a;
|
|
174
173
|
// PROPS
|
|
175
174
|
const props = useThemeProps({
|
|
176
175
|
props: inProps,
|
|
@@ -302,7 +301,7 @@ export default function PlatformWidget(inProps) {
|
|
|
302
301
|
/**
|
|
303
302
|
* Renders root object (if not hidden by autoHide prop)
|
|
304
303
|
*/
|
|
305
|
-
if (!autoHide && (
|
|
304
|
+
if (!autoHide && (isAdmin || isEditor || isModerator)) {
|
|
306
305
|
return (_jsxs(_Fragment, { children: [_jsxs(Root, Object.assign({ className: classNames(classes.root, className, { [classes.tutorialOpen]: isTutorialOpen }) }, rest, { children: [content, tutorial] })), _jsx(Backdrop, { sx: { color: '#fff', zIndex: (theme) => theme.zIndex.drawer + 1 }, open: isTutorialOpen, onClick: handleCloseTutorial })] }));
|
|
307
306
|
}
|
|
308
307
|
return _jsx(HiddenPlaceholder, {});
|