@selfcommunity/react-ui 0.11.0-alpha.5 → 0.11.0-alpha.51
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/CategoryAutocomplete/CategoryAutocomplete.d.ts +5 -0
- package/lib/cjs/components/CategoryAutocomplete/CategoryAutocomplete.js +3 -3
- package/lib/cjs/components/Composer/Layer/CategoryLayer/CategoryLayer.d.ts +1 -1
- package/lib/cjs/components/Composer/Layer/CategoryLayer/CategoryLayer.js +4 -1
- package/lib/cjs/components/ComposerIconButton/ComposerIconButton.js +9 -1
- package/lib/cjs/components/CreateEventButton/CreateEventButton.d.ts +1 -1
- package/lib/cjs/components/CreateEventButton/CreateEventButton.js +1 -1
- package/lib/cjs/components/CreateLiveStreamButton/CreateLiveStreamButton.d.ts +0 -6
- package/lib/cjs/components/CreateLiveStreamButton/CreateLiveStreamButton.js +2 -9
- package/lib/cjs/components/CreateLiveStreamDialog/CreateLiveStreamDialog.d.ts +10 -4
- package/lib/cjs/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +17 -11
- package/lib/cjs/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.js +10 -2
- package/lib/cjs/components/Editor/Editor.js +9 -9
- package/lib/cjs/components/Editor/nodes/HashtagNode.js +2 -0
- package/lib/cjs/components/Editor/nodes/MentionNode.js +2 -0
- package/lib/cjs/components/Editor/plugins/HorizontalRulePlugin.d.ts +8 -0
- package/lib/cjs/components/Editor/plugins/HorizontalRulePlugin.js +34 -0
- package/lib/cjs/components/Editor/plugins/LexicalRichTextPlugin.d.ts +2 -2
- package/lib/cjs/components/Editor/plugins/LexicalRichTextPlugin.js +2 -3
- package/lib/cjs/components/Event/Event.js +6 -3
- package/lib/cjs/components/EventForm/EventAddress.js +1 -1
- package/lib/cjs/components/EventForm/EventForm.js +17 -8
- package/lib/cjs/components/EventFormDialog/EventFormDialog.d.ts +1 -1
- package/lib/cjs/components/EventFormDialog/EventFormDialog.js +3 -3
- package/lib/cjs/components/EventHeader/EventHeader.js +1 -1
- package/lib/cjs/components/EventMembersWidget/EventMembersWidget.js +11 -11
- package/lib/cjs/components/EventMembersWidget/TabContentComponent.js +8 -8
- package/lib/cjs/components/EventMembersWidget/types.d.ts +4 -5
- package/lib/cjs/components/EventMembersWidget/types.js +7 -7
- package/lib/cjs/components/EventParticipantsButton/EventParticipantsButton.js +1 -1
- package/lib/cjs/components/Events/Events.d.ts +11 -0
- package/lib/cjs/components/Events/Events.js +21 -10
- package/lib/cjs/components/Events/OngoingEventsFilter.d.ts +8 -0
- package/lib/cjs/components/Events/OngoingEventsFilter.js +24 -0
- package/lib/cjs/components/FeedObject/Activities/Activities.js +1 -1
- package/lib/cjs/components/GroupForm/GroupForm.js +2 -2
- package/lib/cjs/components/GroupInvitedWidget/GroupInvitedWidget.js +1 -1
- package/lib/cjs/components/GroupRequestsWidget/GroupRequestsWidget.js +1 -1
- package/lib/cjs/components/LiveStreamForm/LiveStreamForm.js +65 -6
- package/lib/cjs/components/LiveStreamForm/LiveStreamFormSettings.js +8 -3
- package/lib/cjs/components/LiveStreamRoom/LiveStreamRoom.js +8 -6
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ControlBar.js +3 -1
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.d.ts +2 -1
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.js +2 -2
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamSettingsMenu.d.ts +9 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamSettingsMenu.js +106 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/NoParticipants.d.ts +4 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/NoParticipants.js +37 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.d.ts +1 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.js +2 -2
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.d.ts +3 -2
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.js +45 -2
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.js +62 -5
- package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuDrawer.d.ts +3 -1
- package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuDrawer.js +13 -6
- package/lib/cjs/components/NavigationToolbar/NavigationToolbar.d.ts +1 -1
- package/lib/cjs/components/NavigationToolbar/NavigationToolbar.js +2 -2
- package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.d.ts +1 -1
- package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.js +4 -4
- package/lib/cjs/components/Notification/Event/Event.js +20 -2
- package/lib/cjs/components/SearchDialog/SearchDialog.d.ts +4 -1
- package/lib/cjs/components/SearchDialog/SearchDialog.js +2 -2
- package/lib/cjs/constants/LiveStream.d.ts +1 -0
- package/lib/cjs/constants/LiveStream.js +2 -1
- package/lib/cjs/shared/EventActionsMenu/index.js +5 -1
- package/lib/cjs/shared/UpScalingTierBadge/index.js +9 -0
- package/lib/cjs/utils/buttonCounters.d.ts +1 -0
- package/lib/cjs/utils/buttonCounters.js +4 -3
- package/lib/cjs/utils/contribution.js +1 -2
- package/lib/cjs/utils/events.d.ts +1 -0
- package/lib/cjs/utils/events.js +6 -1
- package/lib/esm/components/CategoryAutocomplete/CategoryAutocomplete.d.ts +5 -0
- package/lib/esm/components/CategoryAutocomplete/CategoryAutocomplete.js +3 -3
- package/lib/esm/components/Composer/Layer/CategoryLayer/CategoryLayer.d.ts +1 -1
- package/lib/esm/components/Composer/Layer/CategoryLayer/CategoryLayer.js +4 -1
- package/lib/esm/components/ComposerIconButton/ComposerIconButton.js +10 -2
- package/lib/esm/components/CreateEventButton/CreateEventButton.d.ts +1 -1
- package/lib/esm/components/CreateEventButton/CreateEventButton.js +1 -1
- package/lib/esm/components/CreateLiveStreamButton/CreateLiveStreamButton.d.ts +0 -6
- package/lib/esm/components/CreateLiveStreamButton/CreateLiveStreamButton.js +2 -9
- package/lib/esm/components/CreateLiveStreamDialog/CreateLiveStreamDialog.d.ts +10 -4
- package/lib/esm/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +17 -11
- package/lib/esm/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.js +12 -4
- package/lib/esm/components/Editor/Editor.js +8 -8
- package/lib/esm/components/Editor/nodes/HashtagNode.js +2 -0
- package/lib/esm/components/Editor/nodes/MentionNode.js +2 -0
- package/lib/esm/components/Editor/plugins/HorizontalRulePlugin.d.ts +8 -0
- package/lib/esm/components/Editor/plugins/HorizontalRulePlugin.js +30 -0
- package/lib/esm/components/Editor/plugins/LexicalRichTextPlugin.d.ts +2 -2
- package/lib/esm/components/Editor/plugins/LexicalRichTextPlugin.js +1 -1
- package/lib/esm/components/Event/Event.js +6 -3
- package/lib/esm/components/EventForm/EventAddress.js +1 -1
- package/lib/esm/components/EventForm/EventForm.js +18 -9
- package/lib/esm/components/EventFormDialog/EventFormDialog.d.ts +1 -1
- package/lib/esm/components/EventFormDialog/EventFormDialog.js +3 -3
- package/lib/esm/components/EventHeader/EventHeader.js +1 -1
- package/lib/esm/components/EventMembersWidget/EventMembersWidget.js +12 -12
- package/lib/esm/components/EventMembersWidget/TabContentComponent.js +9 -9
- package/lib/esm/components/EventMembersWidget/types.d.ts +4 -5
- package/lib/esm/components/EventMembersWidget/types.js +6 -6
- package/lib/esm/components/EventParticipantsButton/EventParticipantsButton.js +1 -1
- package/lib/esm/components/Events/Events.d.ts +11 -0
- package/lib/esm/components/Events/Events.js +22 -11
- package/lib/esm/components/Events/OngoingEventsFilter.d.ts +8 -0
- package/lib/esm/components/Events/OngoingEventsFilter.js +21 -0
- package/lib/esm/components/FeedObject/Activities/Activities.js +1 -1
- package/lib/esm/components/GroupForm/GroupForm.js +2 -2
- package/lib/esm/components/GroupInvitedWidget/GroupInvitedWidget.js +1 -1
- package/lib/esm/components/GroupRequestsWidget/GroupRequestsWidget.js +1 -1
- package/lib/esm/components/LiveStreamForm/LiveStreamForm.js +67 -8
- package/lib/esm/components/LiveStreamForm/LiveStreamFormSettings.js +8 -3
- package/lib/esm/components/LiveStreamRoom/LiveStreamRoom.js +8 -6
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ControlBar.js +3 -1
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.d.ts +2 -1
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.js +2 -2
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamSettingsMenu.d.ts +9 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamSettingsMenu.js +103 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/NoParticipants.d.ts +4 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/NoParticipants.js +34 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.d.ts +1 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.js +2 -2
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.d.ts +3 -2
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.js +45 -2
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.js +66 -9
- package/lib/esm/components/NavigationMenuIconButton/NavigationMenuDrawer.d.ts +3 -1
- package/lib/esm/components/NavigationMenuIconButton/NavigationMenuDrawer.js +13 -6
- package/lib/esm/components/NavigationToolbar/NavigationToolbar.d.ts +1 -1
- package/lib/esm/components/NavigationToolbar/NavigationToolbar.js +2 -2
- package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.d.ts +1 -1
- package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.js +4 -4
- package/lib/esm/components/Notification/Event/Event.js +22 -4
- package/lib/esm/components/SearchDialog/SearchDialog.d.ts +4 -1
- package/lib/esm/components/SearchDialog/SearchDialog.js +2 -2
- package/lib/esm/constants/LiveStream.d.ts +1 -0
- package/lib/esm/constants/LiveStream.js +1 -0
- package/lib/esm/shared/EventActionsMenu/index.js +6 -2
- package/lib/esm/shared/UpScalingTierBadge/index.js +9 -0
- package/lib/esm/utils/buttonCounters.d.ts +1 -0
- package/lib/esm/utils/buttonCounters.js +3 -2
- package/lib/esm/utils/contribution.js +1 -2
- package/lib/esm/utils/events.d.ts +1 -0
- package/lib/esm/utils/events.js +4 -0
- package/lib/umd/239.js +2 -0
- package/lib/umd/react-ui.js +1 -1
- package/package.json +14 -13
- package/lib/umd/653.js +0 -2
- /package/lib/umd/{653.js.LICENSE.txt → 239.js.LICENSE.txt} +0 -0
|
@@ -26,7 +26,9 @@ export interface NavigationMenuDrawerProps extends DrawerProps {
|
|
|
26
26
|
* Custom Drawer footer content
|
|
27
27
|
* @default null
|
|
28
28
|
*/
|
|
29
|
-
drawerFooterContent?: React.ReactNode
|
|
29
|
+
drawerFooterContent?: React.ReactNode | ((props: {
|
|
30
|
+
handleCloseMenuDrawer: (event: any, reason: 'backdropClick' | 'escapeKeyDown') => void;
|
|
31
|
+
}) => React.ReactNode);
|
|
30
32
|
/**
|
|
31
33
|
* Props to spread to ScrollContainer component
|
|
32
34
|
* This lib use 'react-custom-scrollbars' component to perform scrollbars
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
3
|
+
import React from 'react';
|
|
4
4
|
import { styled } from '@mui/material/styles';
|
|
5
5
|
import { Box, Divider, Drawer, Icon, IconButton, List } from '@mui/material';
|
|
6
6
|
import classNames from 'classnames';
|
|
@@ -9,7 +9,6 @@ import ScrollContainer from '../../shared/ScrollContainer';
|
|
|
9
9
|
import DefaultDrawerContent from './DefaultDrawerContent';
|
|
10
10
|
import DefaultHeaderContent from './DefaultHeaderContent';
|
|
11
11
|
import CreateLiveStreamButton from '../CreateLiveStreamButton';
|
|
12
|
-
import { useSCUser } from '@selfcommunity/react-core';
|
|
13
12
|
const PREFIX = 'SCNavigationMenuDrawer';
|
|
14
13
|
const classes = {
|
|
15
14
|
root: `${PREFIX}-root`,
|
|
@@ -28,14 +27,22 @@ const Root = styled(Drawer, {
|
|
|
28
27
|
overridesResolver: (props, styles) => styles.root
|
|
29
28
|
})(({ theme }) => ({}));
|
|
30
29
|
export default function NavigationMenuDrawer(inProps) {
|
|
31
|
-
var _a;
|
|
32
30
|
// PROPS
|
|
33
31
|
const props = useThemeProps({
|
|
34
32
|
props: inProps,
|
|
35
33
|
name: PREFIX
|
|
36
34
|
});
|
|
37
35
|
const { className = null, showDrawerHeader = true, drawerHeaderContent = _jsx(DefaultHeaderContent, {}), drawerContent = _jsx(DefaultDrawerContent, {}), showDrawerFooterContent = true, drawerFooterContent = null, ScrollContainerProps = { hideTracksWhenNotNeeded: true }, CreateLiveStreamButtonComponentProps = {}, open, onClose } = props, rest = __rest(props, ["className", "showDrawerHeader", "drawerHeaderContent", "drawerContent", "showDrawerFooterContent", "drawerFooterContent", "ScrollContainerProps", "CreateLiveStreamButtonComponentProps", "open", "onClose"]);
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
const footerContent = (() => {
|
|
37
|
+
if (typeof drawerFooterContent === 'function') {
|
|
38
|
+
return drawerFooterContent({ handleCloseMenuDrawer: onClose });
|
|
39
|
+
}
|
|
40
|
+
if (React.isValidElement(drawerFooterContent)) {
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
42
|
+
// @ts-ignore
|
|
43
|
+
return React.cloneElement(drawerFooterContent, { handleCloseMenuDrawer: onClose });
|
|
44
|
+
}
|
|
45
|
+
return drawerFooterContent;
|
|
46
|
+
})();
|
|
47
|
+
return (_jsxs(Root, Object.assign({ anchor: "left", className: classNames(classes.root, className), open: open, onClose: onClose }, rest, { children: [showDrawerHeader && (_jsxs(_Fragment, { children: [_jsxs(Box, Object.assign({ className: classes.drawerHeader }, { children: [drawerHeaderContent, _jsx(IconButton, Object.assign({ className: classes.drawerHeaderAction, onClick: onClose }, { children: _jsx(Icon, { children: "close" }) }))] })), _jsx(Divider, {})] })), _jsx(ScrollContainer, Object.assign({}, ScrollContainerProps, { children: _jsx(List, Object.assign({ className: classes.drawerContent, onClick: onClose }, { children: drawerContent })) })), showDrawerFooterContent && (_jsx(_Fragment, { children: _jsx(Box, Object.assign({ component: "div", className: classes.drawerFooter }, { children: footerContent || (_jsx(Box, Object.assign({ className: classes.drawerFooterLiveStream }, { children: _jsx(CreateLiveStreamButton, Object.assign({ color: "primary", className: classes.drawerFooterLiveStreamButton, fullWidth: true }, CreateLiveStreamButtonComponentProps)) }))) })) }))] })));
|
|
41
48
|
}
|
|
@@ -96,7 +96,7 @@ export default function NavigationToolbar(inProps) {
|
|
|
96
96
|
props: inProps,
|
|
97
97
|
name: PREFIX
|
|
98
98
|
});
|
|
99
|
-
const { value = '', className = '', disableSearch = false, disableComposer = false,
|
|
99
|
+
const { value = '', className = '', disableSearch = false, disableComposer = false, SearchAutocompleteComponentProps = {}, startActions = null, endActions = null, NavigationSettingsIconButtonComponent = NavigationSettingsIconButton, NavigationMenuIconButtonComponentProps = {}, NavigationMenuIconButtonComponent = NavigationMenuIconButton, children = null, NotificationMenuProps = {}, ComposerIconButtonProps = {}, onOpenNotificationMenu, onCloseNotificationMenu } = props, rest = __rest(props, ["value", "className", "disableSearch", "disableComposer", "SearchAutocompleteComponentProps", "startActions", "endActions", "NavigationSettingsIconButtonComponent", "NavigationMenuIconButtonComponentProps", "NavigationMenuIconButtonComponent", "children", "NotificationMenuProps", "ComposerIconButtonProps", "onOpenNotificationMenu", "onCloseNotificationMenu"]);
|
|
100
100
|
// CONTEXT
|
|
101
101
|
const scUserContext = useSCUser();
|
|
102
102
|
const scRoutingContext = useSCRouting();
|
|
@@ -146,7 +146,7 @@ export default function NavigationToolbar(inProps) {
|
|
|
146
146
|
}), "aria-label": "Groups", to: scRoutingContext.url(SCRoutes.GROUPS_SUBSCRIBED_ROUTE_NAME, {}), component: Link }, { children: _jsx(Icon, { children: "groups" }) }))), eventsEnabled && (scUserContext.user || preferences[SCPreferences.CONFIGURATIONS_CONTENT_AVAILABILITY]) && (_jsx(IconButton, Object.assign({ className: classNames(classes.events, {
|
|
147
147
|
[classes.active]: value.startsWith(scRoutingContext.url(SCRoutes.EVENTS_ROUTE_NAME, {}))
|
|
148
148
|
}), "aria-label": "Events", to: scRoutingContext.url(SCRoutes.EVENTS_ROUTE_NAME, {}), component: Link }, { children: _jsx(Icon, { children: "CalendarIcon" }) })))] })));
|
|
149
|
-
return (_jsxs(Root, Object.assign({ className: classNames(className, classes.root) }, rest, { children: [_jsx(NavigationMenuIconButtonComponent, Object.assign({}, NavigationMenuIconButtonComponentProps)), _jsx(Link, Object.assign({ to: scRoutingContext.url(SCRoutes.HOME_ROUTE_NAME, {}), className: classes.logo }, { children: _jsx("img", { src: preferences[SCPreferences.LOGO_NAVBAR_LOGO], alt: "logo" }) })), !scUserContext.user && !preferences[SCPreferences.ADDONS_CLOSED_COMMUNITY] && (_jsx(Button, Object.assign({ color: "inherit", component: Link, to: scRoutingContext.url(SCRoutes.SIGNUP_ROUTE_NAME, {}), className: classes.register }, { children: _jsx(FormattedMessage, { id: "ui.appBar.navigation.register", defaultMessage: "ui.appBar.navigation.register" }) }))), preferences[SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_ENABLED] && (_jsx(_Fragment, { children: preferences[SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_TEXT] ? (_jsx(Tooltip, Object.assign({ title: preferences[SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_TEXT] }, { children: _jsx(Link, Object.assign({ target: "blank", to: preferences[SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_URL], className: classes.customItem }, { children: _jsx("img", { src: preferences[SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_IMAGE], alt: "custom_item" }) })) }))) : (_jsx(Link, Object.assign({ target: "blank", to: preferences[SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_URL], className: classes.customItem }, { children: _jsx("img", { src: preferences[SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_IMAGE], alt: "custom_item" }) }))) })), _children, (preferences[SCPreferences.CONFIGURATIONS_CONTENT_AVAILABILITY] || scUserContext.user) && !disableSearch ? (_jsx(SearchAutocomplete, Object.assign({ className: classes.search, blurOnSelect: true },
|
|
149
|
+
return (_jsxs(Root, Object.assign({ className: classNames(className, classes.root) }, rest, { children: [_jsx(NavigationMenuIconButtonComponent, Object.assign({}, NavigationMenuIconButtonComponentProps)), _jsx(Link, Object.assign({ to: scRoutingContext.url(SCRoutes.HOME_ROUTE_NAME, {}), className: classes.logo }, { children: _jsx("img", { src: preferences[SCPreferences.LOGO_NAVBAR_LOGO], alt: "logo" }) })), !scUserContext.user && !preferences[SCPreferences.ADDONS_CLOSED_COMMUNITY] && (_jsx(Button, Object.assign({ color: "inherit", component: Link, to: scRoutingContext.url(SCRoutes.SIGNUP_ROUTE_NAME, {}), className: classes.register }, { children: _jsx(FormattedMessage, { id: "ui.appBar.navigation.register", defaultMessage: "ui.appBar.navigation.register" }) }))), preferences[SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_ENABLED] && (_jsx(_Fragment, { children: preferences[SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_TEXT] ? (_jsx(Tooltip, Object.assign({ title: preferences[SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_TEXT] }, { children: _jsx(Link, Object.assign({ target: "blank", to: preferences[SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_URL], className: classes.customItem }, { children: _jsx("img", { src: preferences[SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_IMAGE], alt: "custom_item" }) })) }))) : (_jsx(Link, Object.assign({ target: "blank", to: preferences[SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_URL], className: classes.customItem }, { children: _jsx("img", { src: preferences[SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_IMAGE], alt: "custom_item" }) }))) })), _children, (preferences[SCPreferences.CONFIGURATIONS_CONTENT_AVAILABILITY] || scUserContext.user) && !disableSearch ? (_jsx(SearchAutocomplete, Object.assign({ className: classes.search, blurOnSelect: true }, SearchAutocompleteComponentProps))) : (_jsx(Box, { className: classes.search })), startActions, scUserContext.user ? (_jsxs(_Fragment, { children: [showComposer && _jsx(ComposerIconButton, Object.assign({ className: classes.composer }, ComposerIconButtonProps)), _jsx(Tooltip, Object.assign({ title: scUserContext.user.username }, { children: _jsx(IconButton, Object.assign({ component: Link, to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, scUserContext.user), "aria-label": "Profile", className: classes.profile }, { children: _jsx(Avatar, { alt: scUserContext.user.username, src: scUserContext.user.avatar }) })) })), _jsxs(_Fragment, { children: [_jsx(IconButton, Object.assign({ className: classNames(classes.notification, {
|
|
150
150
|
[classes.active]: value.startsWith(scRoutingContext.url(SCRoutes.USER_NOTIFICATIONS_ROUTE_NAME, {}))
|
|
151
151
|
}), "aria-label": "Notification", onClick: handleOpenNotificationMenu }, { children: _jsx(Badge, Object.assign({ badgeContent: scUserContext.user.unseen_notification_banners_counter + scUserContext.user.unseen_interactions_counter, color: "secondary" }, { children: _jsx(Icon, { children: "notifications_active" }) })) })), Boolean(anchorNotification) && (_jsx(NotificationMenu, Object.assign({ className: classes.notificationsMenu, id: "notification-menu", anchorEl: anchorNotification, open: true, onClose: handleCloseNotificationMenu, onClick: handleCloseNotificationMenu, transformOrigin: { horizontal: 'right', vertical: 'top' }, anchorOrigin: { horizontal: 'right', vertical: 'bottom' } }, NotificationMenuProps)))] }), privateMessagingEnabled && (_jsx(IconButton, Object.assign({ className: classNames(classes.messages, {
|
|
152
152
|
[classes.active]: value.startsWith(scRoutingContext.url(SCRoutes.USER_PRIVATE_MESSAGES_ROUTE_NAME, {}))
|
|
@@ -16,7 +16,7 @@ export interface NavigationToolbarMobileProps extends ToolbarProps {
|
|
|
16
16
|
/**
|
|
17
17
|
* Props spread to SearchAutocomplete component
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
SearchAutocompleteComponentProps?: SearchAutocompleteProps;
|
|
20
20
|
/**
|
|
21
21
|
* Actions to be inserted before composer IconButton
|
|
22
22
|
*/
|
|
@@ -69,7 +69,7 @@ export default function NavigationToolbarMobile(inProps) {
|
|
|
69
69
|
props: inProps,
|
|
70
70
|
name: PREFIX
|
|
71
71
|
});
|
|
72
|
-
const { className = '', disableSearch = false, preserveDesktopLogo = false,
|
|
72
|
+
const { className = '', disableSearch = false, preserveDesktopLogo = false, SearchAutocompleteComponentProps = {}, children = null, startActions = null, endActions = null, NavigationMenuIconButtonComponent = NavigationMenuIconButton, NavigationSettingsIconButtonComponent = NavigationSettingsIconButton, ComposerIconButtonProps = {} } = props, rest = __rest(props, ["className", "disableSearch", "preserveDesktopLogo", "SearchAutocompleteComponentProps", "children", "startActions", "endActions", "NavigationMenuIconButtonComponent", "NavigationSettingsIconButtonComponent", "ComposerIconButtonProps"]);
|
|
73
73
|
// CONTEXT
|
|
74
74
|
const scUserContext = useSCUser();
|
|
75
75
|
const scRoutingContext = useSCRouting();
|
|
@@ -96,10 +96,10 @@ export default function NavigationToolbarMobile(inProps) {
|
|
|
96
96
|
// HANDLERS
|
|
97
97
|
const handleOpenSearch = useCallback(() => {
|
|
98
98
|
setSearchOpen(true);
|
|
99
|
-
}, []);
|
|
99
|
+
}, [setSearchOpen]);
|
|
100
100
|
const handleCloseSearch = useCallback(() => {
|
|
101
101
|
setSearchOpen(false);
|
|
102
|
-
}, []);
|
|
102
|
+
}, [setSearchOpen]);
|
|
103
103
|
// RENDER
|
|
104
104
|
if (scUserContext.loading) {
|
|
105
105
|
return _jsx(NavigationToolbarMobileSkeleton, {});
|
|
@@ -107,7 +107,7 @@ export default function NavigationToolbarMobile(inProps) {
|
|
|
107
107
|
const _children = children || (_jsxs(_Fragment, { children: [_jsx(NavigationMenuIconButtonComponent, {}), _jsx(Link, Object.assign({ to: scRoutingContext.url(SCRoutes.HOME_ROUTE_NAME, {}), className: classNames(className, classes.logo, {
|
|
108
108
|
[classes.logoFlex]: preferences[SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_URL].value
|
|
109
109
|
}) }, { children: !preserveDesktopLogo ? (_jsx("img", { src: preferences[SCPreferences.LOGO_NAVBAR_LOGO_MOBILE].value, alt: "logo" })) : (_jsx("img", { src: preferences[SCPreferences.LOGO_NAVBAR_LOGO].value, alt: "logo" })) })), preferences[SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_ENABLED].value && (_jsx(Link, Object.assign({ target: "blank", to: preferences[SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_URL].value, className: classes.customItem }, { children: _jsx("img", { src: preferences[SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_IMAGE].value, alt: "custom_item" }) })))] }));
|
|
110
|
-
return (_jsxs(Root, Object.assign({ className: classNames(className, classes.root) }, rest, { children: [_children, startActions, (contentAvailable || scUserContext.user) && !disableSearch && (_jsxs(_Fragment, { children: [_jsx(IconButton, Object.assign({ className: classes.search, onClick: handleOpenSearch }, { children: _jsx(Icon, { children: "search" }) })), _jsx(SearchDialog, { className: classes.searchDialog, fullScreen: true, open: searchOpen,
|
|
110
|
+
return (_jsxs(Root, Object.assign({ className: classNames(className, classes.root) }, rest, { children: [_children, startActions, (contentAvailable || scUserContext.user) && !disableSearch && (_jsxs(_Fragment, { children: [_jsx(IconButton, Object.assign({ className: classes.search, onClick: handleOpenSearch }, { children: _jsx(Icon, { children: "search" }) })), _jsx(SearchDialog, { className: classes.searchDialog, fullScreen: true, open: searchOpen, SearchAutocompleteComponentProps: Object.assign(Object.assign({}, SearchAutocompleteComponentProps), { onClear: handleCloseSearch }) })] })), endActions, (!postOnlyStaffEnabled || (UserUtils.isStaff(scUserContext.user) && postOnlyStaffEnabled)) &&
|
|
111
111
|
(scUserContext.user || contentAvailable) &&
|
|
112
112
|
exploreStreamEnabled && _jsx(ComposerIconButton, Object.assign({}, ComposerIconButtonProps)), scUserContext.user && (groupsEnabled || eventsEnabled) && (_jsx(IconButton, Object.assign({ className: classes.notifications, component: Link, to: scRoutingContext.url(SCRoutes.USER_NOTIFICATIONS_ROUTE_NAME, {}) }, { children: _jsx(Badge, Object.assign({ badgeContent: scUserContext.user.unseen_notification_banners_counter + scUserContext.user.unseen_interactions_counter, color: "secondary" }, { children: _jsx(Icon, { children: "notifications_active" }) })) }))), scUserContext.user ? (_jsx(NavigationSettingsIconButtonComponent, { className: classes.settings })) : (_jsx(Button, Object.assign({ className: classes.login, color: "inherit", component: Link, to: scRoutingContext.url(SCRoutes.SIGNIN_ROUTE_NAME, {}) }, { children: _jsx(FormattedMessage, { id: "ui.appBar.navigation.login", defaultMessage: "ui.appBar.navigation.login" }) })))] })));
|
|
113
113
|
}
|
|
@@ -3,8 +3,8 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
3
3
|
import { useState } from 'react';
|
|
4
4
|
import { styled } from '@mui/material/styles';
|
|
5
5
|
import { Avatar, Box, Icon, Stack, Typography } from '@mui/material';
|
|
6
|
-
import { Link, SCRoutes, useSCRouting } from '@selfcommunity/react-core';
|
|
7
|
-
import { SCEventLocationType } from '@selfcommunity/types';
|
|
6
|
+
import { Link, SCRoutes, useSCRouting, useSCUser } from '@selfcommunity/react-core';
|
|
7
|
+
import { SCEventLocationType, SCNotificationTypologyType } from '@selfcommunity/types';
|
|
8
8
|
import { FormattedMessage, useIntl } from 'react-intl';
|
|
9
9
|
import DateTimeAgo from '../../../shared/DateTimeAgo';
|
|
10
10
|
import classNames from 'classnames';
|
|
@@ -15,6 +15,7 @@ import UserDeletedSnackBar from '../../../shared/UserDeletedSnackBar';
|
|
|
15
15
|
import UserAvatar from '../../../shared/UserAvatar';
|
|
16
16
|
import { PREFIX } from '../constants';
|
|
17
17
|
import { default as EventItem } from '../../Event';
|
|
18
|
+
import { EventService } from '@selfcommunity/api-services';
|
|
18
19
|
const classes = {
|
|
19
20
|
root: `${PREFIX}-event-root`,
|
|
20
21
|
avatar: `${PREFIX}-avatar`,
|
|
@@ -38,12 +39,24 @@ export default function EventNotification(props) {
|
|
|
38
39
|
const { notificationObject, id = `n_${props.notificationObject['sid']}`, className, template = SCNotificationObjectTemplateType.DETAIL } = props, rest = __rest(props, ["notificationObject", "id", "className", "template"]);
|
|
39
40
|
// CONTEXT
|
|
40
41
|
const scRoutingContext = useSCRouting();
|
|
42
|
+
const scUserContext = useSCUser();
|
|
43
|
+
const scEventsManager = scUserContext.managers.events;
|
|
41
44
|
// STATE
|
|
42
45
|
const [openAlert, setOpenAlert] = useState(false);
|
|
46
|
+
const [loading, setLoading] = useState(false);
|
|
47
|
+
const [disabled, setDisabled] = useState(!notificationObject.is_new);
|
|
43
48
|
// CONST
|
|
44
49
|
const isSnippetTemplate = template === SCNotificationObjectTemplateType.SNIPPET;
|
|
45
50
|
const isToastTemplate = template === SCNotificationObjectTemplateType.TOAST;
|
|
46
51
|
const intl = useIntl();
|
|
52
|
+
//HANDLERS
|
|
53
|
+
const acceptRequest = (event) => {
|
|
54
|
+
setLoading(true);
|
|
55
|
+
EventService.inviteOrAcceptEventRequest(event.id, { users: [notificationObject.user.id] }).then(() => {
|
|
56
|
+
setLoading(false);
|
|
57
|
+
setDisabled(true);
|
|
58
|
+
});
|
|
59
|
+
};
|
|
47
60
|
// RENDER
|
|
48
61
|
if (isSnippetTemplate || isToastTemplate) {
|
|
49
62
|
return (_jsx(Root, Object.assign({ id: id, className: classNames(classes.root, className, `${PREFIX}-${template}`), template: template, isNew: notificationObject.is_new, disableTypography: true, image: _jsx(Link, Object.assign({}, (!notificationObject.user.deleted && {
|
|
@@ -64,7 +77,7 @@ export default function EventNotification(props) {
|
|
|
64
77
|
month: 'long'
|
|
65
78
|
}),
|
|
66
79
|
hour: intl.formatDate(notificationObject.event.start_date, { hour: 'numeric', minute: 'numeric' })
|
|
67
|
-
} }) })), _jsxs(Typography, Object.assign({ component: "p", variant: "body2" }, { children: [_jsx(FormattedMessage, { id: `ui.notification.event.privacy.${notificationObject.event.privacy}`, defaultMessage: `ui.notification.event.privacy.${notificationObject.event.privacy}` }), ' ', "-", ' ', notificationObject.event.location === SCEventLocationType.PERSON ? (_jsx(FormattedMessage, { id: `ui.notification.event.address.live.label`, defaultMessage: `ui.notification.event.address.live.label` })) : (_jsx(FormattedMessage, { id: `ui.notification.event.address.online.label`, defaultMessage: `ui.notification.event.address.online.label` }))] }))] }), footer: isToastTemplate ? (_jsxs(Stack, Object.assign({ direction: "row", justifyContent: "space-between", alignItems: "center", spacing: 2 }, { children: [_jsx(DateTimeAgo, { date: notificationObject.active_at }), _jsx(Typography, Object.assign({ color: "primary" }, { children: _jsx(Link, Object.assign({ to: scRoutingContext.url(SCRoutes.EVENT_ROUTE_NAME, notificationObject.event) }, { children: _jsx(FormattedMessage, { id: "ui.notification.event.button.see", defaultMessage: "ui.notification.event.button.see" }) })) }))] }))) : (_jsx(DateTimeAgo, { date: notificationObject.active_at, className: classes.snippetTime })) }, rest)));
|
|
80
|
+
} }) })), _jsxs(Typography, Object.assign({ component: "p", variant: "body2" }, { children: [_jsx(FormattedMessage, { id: `ui.notification.event.privacy.${notificationObject.event.privacy}`, defaultMessage: `ui.notification.event.privacy.${notificationObject.event.privacy}` }), ' ', "-", ' ', notificationObject.event.location === SCEventLocationType.PERSON ? (_jsx(FormattedMessage, { id: `ui.notification.event.address.live.label`, defaultMessage: `ui.notification.event.address.live.label` })) : (_jsx(FormattedMessage, { id: `ui.notification.event.address.online.label`, defaultMessage: `ui.notification.event.address.online.label` }))] }))] }), footer: isToastTemplate ? (_jsxs(Stack, Object.assign({ direction: "row", justifyContent: "space-between", alignItems: "center", spacing: 2 }, { children: [_jsx(DateTimeAgo, { date: notificationObject.active_at }), _jsx(Typography, Object.assign({ color: "primary" }, { children: notificationObject.type === SCNotificationTypologyType.USER_REQUESTED_TO_JOIN_EVENT ? (_jsx(LoadingButton, Object.assign({ disabled: disabled, loading: loading || scEventsManager.isLoading(notificationObject.event), color: 'primary', variant: "text", size: "small", onClick: () => acceptRequest(notificationObject.event) }, { children: disabled ? (_jsx(FormattedMessage, { id: "ui.notification.event.button.accepted", defaultMessage: "ui.notification.event.button.accepted" })) : (_jsx(FormattedMessage, { id: "ui.notification.event.button.accept", defaultMessage: "ui.notification.event.button.accept" })) }))) : (_jsx(Link, Object.assign({ to: scRoutingContext.url(SCRoutes.EVENT_ROUTE_NAME, notificationObject.event) }, { children: _jsx(FormattedMessage, { id: "ui.notification.event.button.see", defaultMessage: "ui.notification.event.button.see" }) }))) }))] }))) : (_jsx(DateTimeAgo, { date: notificationObject.active_at, className: classes.snippetTime })) }, rest)));
|
|
68
81
|
}
|
|
69
82
|
return (_jsxs(_Fragment, { children: [_jsx(Root, Object.assign({ id: id, className: classNames(classes.root, className, `${PREFIX}-${template}`), template: template, isNew: notificationObject.is_new, disableTypography: true, image: _jsx(Link, Object.assign({}, (!notificationObject.user.deleted && {
|
|
70
83
|
to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, notificationObject.user)
|
|
@@ -76,5 +89,10 @@ export default function EventNotification(props) {
|
|
|
76
89
|
icon: (...chunks) => _jsx(Icon, { children: chunks }),
|
|
77
90
|
event: notificationObject.event.name,
|
|
78
91
|
link: (...chunks) => _jsx(Link, Object.assign({ to: scRoutingContext.url(SCRoutes.EVENT_ROUTE_NAME, notificationObject.event) }, { children: chunks }))
|
|
79
|
-
} }), _jsx(EventItem, { event: notificationObject.event, actions: _jsx(_Fragment, {}), elevation: 0 })] }), actions: _jsxs(Stack, Object.assign({ direction: "row", justifyContent: "space-between", alignItems: "center", spacing: 2 }, { children: [_jsx(DateTimeAgo, { date: notificationObject.active_at, className: classes.activeAt }), _jsx(LoadingButton, Object.assign({ color: 'primary', variant: "outlined", size: "small", classes: { root: classes.seeButton }
|
|
92
|
+
} }), _jsx(EventItem, { event: notificationObject.event, actions: _jsx(_Fragment, {}), elevation: 0 })] }), actions: _jsxs(Stack, Object.assign({ direction: "row", justifyContent: "space-between", alignItems: "center", spacing: 2 }, { children: [_jsx(DateTimeAgo, { date: notificationObject.active_at, className: classes.activeAt }), _jsx(LoadingButton, Object.assign({ disabled: disabled, loading: loading || scEventsManager.isLoading(notificationObject.event), color: 'primary', variant: "outlined", size: "small", classes: { root: classes.seeButton } }, (notificationObject.type !== SCNotificationTypologyType.USER_REQUESTED_TO_JOIN_EVENT && {
|
|
93
|
+
component: Link,
|
|
94
|
+
to: scRoutingContext.url(SCRoutes.EVENT_ROUTE_NAME, notificationObject.event)
|
|
95
|
+
}), { onClick: notificationObject.type === SCNotificationTypologyType.USER_REQUESTED_TO_JOIN_EVENT
|
|
96
|
+
? () => acceptRequest(notificationObject.event)
|
|
97
|
+
: null }, { children: notificationObject.type === SCNotificationTypologyType.USER_REQUESTED_TO_JOIN_EVENT ? (_jsx(_Fragment, { children: disabled ? (_jsx(FormattedMessage, { id: "ui.notification.event.button.accepted", defaultMessage: "ui.notification.event.button.accepted" })) : (_jsx(FormattedMessage, { id: "ui.notification.event.button.accept", defaultMessage: "ui.notification.event.button.accept" })) })) : (_jsx(FormattedMessage, { id: "ui.notification.event.button.see", defaultMessage: "ui.notification.event.button.see" })) }))] })) }, rest)), openAlert && _jsx(UserDeletedSnackBar, { open: openAlert, handleClose: () => setOpenAlert(false) })] }));
|
|
80
98
|
}
|
|
@@ -6,7 +6,10 @@ export interface SearchDialogProps extends DialogProps {
|
|
|
6
6
|
* @default null
|
|
7
7
|
*/
|
|
8
8
|
className?: string;
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Overrides props for the SearchAutocomplete component.
|
|
11
|
+
*/
|
|
12
|
+
SearchAutocompleteComponentProps: SearchAutocompleteProps;
|
|
10
13
|
/**
|
|
11
14
|
* Other props
|
|
12
15
|
*/
|
|
@@ -28,6 +28,6 @@ export default function Search(inProps) {
|
|
|
28
28
|
props: inProps,
|
|
29
29
|
name: PREFIX
|
|
30
30
|
});
|
|
31
|
-
const { className,
|
|
32
|
-
return (_jsx(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: _jsx(DialogContent, { children: _jsx(SearchAutocomplete, Object.assign({ className: classes.search, blurOnSelect: false, open: true, disablePortal: true },
|
|
31
|
+
const { className, SearchAutocompleteComponentProps = { autoFocus: true } } = props, rest = __rest(props, ["className", "SearchAutocompleteComponentProps"]);
|
|
32
|
+
return (_jsx(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: _jsx(DialogContent, { children: _jsx(SearchAutocomplete, Object.assign({ className: classes.search, blurOnSelect: false, open: true, disablePortal: true }, SearchAutocompleteComponentProps)) }) })));
|
|
33
33
|
}
|
|
@@ -16,7 +16,7 @@ import EventForm from '../../components/EventForm';
|
|
|
16
16
|
import { ADD_EVENT_TO_CALENDAR, CANCEL_EVENT, GET_EVENT_LINK } from '../../constants/EventActionsMenu';
|
|
17
17
|
import { SCGroupEventType, SCTopicType } from '../../constants/PubSub';
|
|
18
18
|
import ConfirmDialog from '../../shared/ConfirmDialog/ConfirmDialog';
|
|
19
|
-
import { checkEventFinished } from '../../utils/events';
|
|
19
|
+
import { checkEventFinished, formatDateForGC } from '../../utils/events';
|
|
20
20
|
const PREFIX = 'SCEventActionsMenu';
|
|
21
21
|
const classes = {
|
|
22
22
|
root: `${PREFIX}-root`,
|
|
@@ -118,8 +118,12 @@ export default function EventActionsMenu(inProps) {
|
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
120
|
const createGoogleCalendarLink = (event) => {
|
|
121
|
+
var _a;
|
|
121
122
|
const baseUrl = 'https://www.google.com/calendar/render?action=TEMPLATE';
|
|
122
|
-
|
|
123
|
+
const startDate = formatDateForGC(event.start_date);
|
|
124
|
+
const endDate = formatDateForGC(event.end_date);
|
|
125
|
+
const details = `${event.description ? event.description + '\n\n' : ''}${event.link ? 'Link: ' + event.link : ''}`;
|
|
126
|
+
return `${baseUrl}&text=${encodeURIComponent(event.name)}&details=${encodeURIComponent(details)}&location=${encodeURIComponent((_a = event.geolocation) !== null && _a !== void 0 ? _a : '')}&dates=${startDate}/${endDate}`;
|
|
123
127
|
};
|
|
124
128
|
/**
|
|
125
129
|
* Handles actions
|
|
@@ -3,6 +3,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { styled } from '@mui/material/styles';
|
|
4
4
|
import { useThemeProps } from '@mui/system';
|
|
5
5
|
import { FormattedMessage } from 'react-intl';
|
|
6
|
+
import { SCPreferences, useSCPreferences } from '@selfcommunity/react-core';
|
|
6
7
|
import { Chip, Tooltip } from '@mui/material';
|
|
7
8
|
import { useMemo } from 'react';
|
|
8
9
|
import { SCCommunitySubscriptionTier } from '@selfcommunity/types';
|
|
@@ -28,6 +29,11 @@ export default function UpScalingTierBadge(inProps) {
|
|
|
28
29
|
name: PREFIX
|
|
29
30
|
});
|
|
30
31
|
const { className, desiredTier = SCCommunitySubscriptionTier.GO } = props, rest = __rest(props, ["className", "desiredTier"]);
|
|
32
|
+
const { preferences } = useSCPreferences();
|
|
33
|
+
const isEnterpriseTier = useMemo(() => preferences &&
|
|
34
|
+
SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER in preferences &&
|
|
35
|
+
preferences[SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER].value &&
|
|
36
|
+
preferences[SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER].value === SCCommunitySubscriptionTier.ENTERPRISE, [preferences]);
|
|
31
37
|
const tooltipMsg = useMemo(() => {
|
|
32
38
|
let _msg = _jsx(FormattedMessage, { id: "ui.upScalingTierBadge.goFeature", defaultMessage: "ui.upScalingTierBadge.goFeature" });
|
|
33
39
|
switch (desiredTier) {
|
|
@@ -56,5 +62,8 @@ export default function UpScalingTierBadge(inProps) {
|
|
|
56
62
|
}
|
|
57
63
|
return _label;
|
|
58
64
|
}, [desiredTier]);
|
|
65
|
+
if (desiredTier === SCCommunitySubscriptionTier.ENTERPRISE && isEnterpriseTier) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
59
68
|
return (_jsx(Root, Object.assign({ classes: { root: classNames(className, classes.root) }, title: tooltipMsg, placement: "top" }, rest, { children: _jsx(Badge, { color: "secondary", size: "small", label: badgeLabel, className: classes.badge }) })));
|
|
60
69
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export const DEFAULT_COUNTERS_LIMIT = 3;
|
|
2
3
|
export function numberFormatter(num) {
|
|
3
|
-
const surplus = num -
|
|
4
|
+
const surplus = num === DEFAULT_COUNTERS_LIMIT ? 1 : num < DEFAULT_COUNTERS_LIMIT ? num : num - DEFAULT_COUNTERS_LIMIT;
|
|
4
5
|
if (surplus > 999999) {
|
|
5
6
|
return _jsxs(_Fragment, { children: ["+", (Math.abs(surplus) / 1000000).toFixed(1), "M"] });
|
|
6
7
|
}
|
|
7
|
-
else if (
|
|
8
|
+
else if (surplus > 999) {
|
|
8
9
|
return _jsxs(_Fragment, { children: ["+", (Math.abs(surplus) / 1000).toFixed(1), "K"] });
|
|
9
10
|
}
|
|
10
11
|
return _jsxs(_Fragment, { children: ["+", surplus] });
|
|
@@ -51,8 +51,7 @@ export function getContributionSnippet(obj) {
|
|
|
51
51
|
* @param handleUrl Func that handle urls
|
|
52
52
|
*/
|
|
53
53
|
export function getContributionHtml(html, handleUrl) {
|
|
54
|
-
|
|
55
|
-
return _html.replace(/<mention.*? id="([0-9]+)"{1}.*?>@([a-z\d_-]+)<\/mention>/gi, (match, id, username) => {
|
|
54
|
+
return html.replace(/<mention.*? id="([0-9]+)"{1}.*?>@([a-z\d_-]+)<\/mention>/gi, (match, id, username) => {
|
|
56
55
|
return `<a href='${handleUrl(SCRoutes.USER_PROFILE_ROUTE_NAME, { id, username })}'>@${username}</a>`;
|
|
57
56
|
});
|
|
58
57
|
}
|