@selfcommunity/react-ui 0.9.0-alpha.8 → 0.9.0
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/assets/onBoarding/android.d.ts +1 -1
- package/lib/cjs/assets/onBoarding/android.js +1 -1
- package/lib/cjs/components/Event/Event.js +1 -1
- package/lib/cjs/components/EventHeader/EventHeader.js +5 -40
- package/lib/cjs/components/EventMembersWidget/TabContentComponent.js +1 -1
- package/lib/cjs/components/EventSubscribeButton/EventSubscribeButton.d.ts +2 -2
- package/lib/cjs/components/EventSubscribeButton/EventSubscribeButton.js +14 -16
- package/lib/cjs/components/Events/Events.js +3 -4
- package/lib/cjs/components/NavigationSettingsIconButton/NavigationSettingsIconButton.js +35 -2
- package/lib/cjs/components/NavigationToolbar/NavigationToolbar.js +1 -1
- package/lib/cjs/components/OnBoardingWidget/ActionsButton.d.ts +7 -0
- package/lib/cjs/components/OnBoardingWidget/ActionsButton.js +84 -0
- package/lib/cjs/components/OnBoardingWidget/OnBoardingWidget.js +44 -19
- package/lib/cjs/components/OnBoardingWidget/Steps/App/App.js +2 -1
- package/lib/cjs/components/UserProfileEdit/Section/PublicInfo.js +2 -1
- package/lib/cjs/shared/EventActionsMenu/index.js +11 -15
- package/lib/cjs/utils/events.d.ts +2 -0
- package/lib/cjs/utils/events.js +10 -0
- package/lib/esm/assets/onBoarding/android.d.ts +1 -1
- package/lib/esm/assets/onBoarding/android.js +1 -1
- package/lib/esm/components/Event/Event.js +1 -1
- package/lib/esm/components/EventHeader/EventHeader.js +6 -41
- package/lib/esm/components/EventMembersWidget/TabContentComponent.js +1 -1
- package/lib/esm/components/EventSubscribeButton/EventSubscribeButton.d.ts +2 -2
- package/lib/esm/components/EventSubscribeButton/EventSubscribeButton.js +16 -18
- package/lib/esm/components/Events/Events.js +3 -4
- package/lib/esm/components/NavigationSettingsIconButton/NavigationSettingsIconButton.js +38 -5
- package/lib/esm/components/NavigationToolbar/NavigationToolbar.js +1 -1
- package/lib/esm/components/OnBoardingWidget/ActionsButton.d.ts +7 -0
- package/lib/esm/components/OnBoardingWidget/ActionsButton.js +81 -0
- package/lib/esm/components/OnBoardingWidget/OnBoardingWidget.js +46 -21
- package/lib/esm/components/OnBoardingWidget/Steps/App/App.js +2 -1
- package/lib/esm/components/UserProfileEdit/Section/PublicInfo.js +2 -1
- package/lib/esm/shared/EventActionsMenu/index.js +11 -15
- package/lib/esm/utils/events.d.ts +2 -0
- package/lib/esm/utils/events.js +6 -0
- package/lib/umd/react-ui.js +1 -1
- package/package.json +7 -7
|
@@ -18,6 +18,7 @@ const classes = {
|
|
|
18
18
|
summary: `${PREFIX}-app-summary`,
|
|
19
19
|
step: `${PREFIX}-app-step`,
|
|
20
20
|
image: `${PREFIX}-app-image`,
|
|
21
|
+
imageAndroid: `${PREFIX}-app-image-android`,
|
|
21
22
|
action: `${PREFIX}-app-action`,
|
|
22
23
|
button: `${PREFIX}-app-button`
|
|
23
24
|
};
|
|
@@ -53,7 +54,7 @@ export default function App(inProps) {
|
|
|
53
54
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
54
55
|
// @ts-ignore
|
|
55
56
|
b: (...chunks) => _jsx("strong", { children: chunks })
|
|
56
|
-
} }) })), _jsx(CardMedia, { className: classes.
|
|
57
|
+
} }) })), _jsx(CardMedia, { className: classes.imageAndroid, component: "img", src: AndroidPlaceholder })] })), tab === 1 && (_jsxs(_Fragment, { children: [_jsx(Typography, Object.assign({ className: classes.summary }, { children: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.step.app.ios", defaultMessage: "ui.onBoardingWidget.step.app.ios" }) })), _jsx(Typography, Object.assign({ className: classes.step }, { children: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.step.app.ios.a", defaultMessage: "ui.onBoardingWidget.step.app.ios.a", values: {
|
|
57
58
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
58
59
|
// @ts-ignore
|
|
59
60
|
icon: (...chunks) => _jsx(Icon, Object.assign({ fontSize: "medium" }, { children: chunks })),
|
|
@@ -152,6 +152,7 @@ export default function PublicInfo(props) {
|
|
|
152
152
|
}
|
|
153
153
|
};
|
|
154
154
|
let content = null;
|
|
155
|
+
console.log(metadataDefinitions);
|
|
155
156
|
switch (field) {
|
|
156
157
|
case SCUserProfileFields.USERNAME:
|
|
157
158
|
component.element = UsernameTextField;
|
|
@@ -220,7 +221,7 @@ export default function PublicInfo(props) {
|
|
|
220
221
|
return null;
|
|
221
222
|
default:
|
|
222
223
|
if (metadataDefinitions && metadataDefinitions[field]) {
|
|
223
|
-
return (_jsx(MetadataField, Object.assign({ id: field, className: classes.field, name: field, fullWidth: true, label: label, value: user[field] || '', onChange: handleChange(field), disabled: isSaving, error: Boolean(_error), helperText: _error && _jsx(FormattedMessage, { id: `ui.userInfo.metadata.error.${_error}`, defaultMessage: `ui.userInfo.metadata.error.${_error}` }), metadata: metadataDefinitions[field] }, props), field));
|
|
224
|
+
return (_jsx(MetadataField, Object.assign({ id: field, className: classes.field, name: field, fullWidth: true, label: label, value: user[field] || '', onChange: handleChange(field), disabled: isSaving || (user[field] && 'editable' in metadataDefinitions[field] && !metadataDefinitions[field].editable), error: Boolean(_error), helperText: _error && _jsx(FormattedMessage, { id: `ui.userInfo.metadata.error.${_error}`, defaultMessage: `ui.userInfo.metadata.error.${_error}` }), metadata: metadataDefinitions[field] }, props), field));
|
|
224
225
|
}
|
|
225
226
|
break;
|
|
226
227
|
}
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { useMemo, useState } from 'react';
|
|
4
|
-
import { styled } from '@mui/material/styles';
|
|
5
3
|
import { Divider, IconButton, List, ListItemIcon, Menu, MenuItem, SwipeableDrawer, useMediaQuery, useTheme } from '@mui/material';
|
|
6
|
-
import { FormattedMessage } from 'react-intl';
|
|
7
4
|
import Icon from '@mui/material/Icon';
|
|
8
|
-
import
|
|
5
|
+
import { styled } from '@mui/material/styles';
|
|
9
6
|
import { useThemeProps } from '@mui/system';
|
|
10
|
-
import { SCRoutes, useSCFetchEvent, useSCRouting, useSCUser } from '@selfcommunity/react-core';
|
|
11
|
-
import ConfirmDialog from '../../shared/ConfirmDialog/ConfirmDialog';
|
|
12
7
|
import { EventService } from '@selfcommunity/api-services';
|
|
13
|
-
import {
|
|
8
|
+
import { SCRoutes, useSCFetchEvent, useSCRouting, useSCUser } from '@selfcommunity/react-core';
|
|
14
9
|
import { copyTextToClipboard } from '@selfcommunity/utils';
|
|
10
|
+
import classNames from 'classnames';
|
|
15
11
|
import { enqueueSnackbar } from 'notistack';
|
|
16
12
|
import PubSub from 'pubsub-js';
|
|
17
|
-
import {
|
|
13
|
+
import { useMemo, useState } from 'react';
|
|
14
|
+
import { FormattedMessage } from 'react-intl';
|
|
18
15
|
import EventForm from '../../components/EventForm';
|
|
16
|
+
import { ADD_EVENT_TO_CALENDAR, CANCEL_EVENT, GET_EVENT_LINK } from '../../constants/EventActionsMenu';
|
|
17
|
+
import { SCGroupEventType, SCTopicType } from '../../constants/PubSub';
|
|
18
|
+
import ConfirmDialog from '../../shared/ConfirmDialog/ConfirmDialog';
|
|
19
|
+
import { checkEventFinished } from '../../utils/events';
|
|
19
20
|
const PREFIX = 'SCEventActionsMenu';
|
|
20
21
|
const classes = {
|
|
21
22
|
root: `${PREFIX}-root`,
|
|
@@ -82,12 +83,7 @@ export default function EventActionsMenu(inProps) {
|
|
|
82
83
|
const scUserContext = useSCUser();
|
|
83
84
|
const { scEvent, setSCEvent } = useSCFetchEvent({ id: eventId, event });
|
|
84
85
|
const isEventAdmin = useMemo(() => { var _a; return scUserContext.user && ((_a = scEvent === null || scEvent === void 0 ? void 0 : scEvent.managed_by) === null || _a === void 0 ? void 0 : _a.id) === scUserContext.user.id; }, [scUserContext.user, (_a = scEvent === null || scEvent === void 0 ? void 0 : scEvent.managed_by) === null || _a === void 0 ? void 0 : _a.id]);
|
|
85
|
-
const isEventFinished = useMemo(() =>
|
|
86
|
-
if (scEvent && !scEvent.running) {
|
|
87
|
-
return new Date().getTime() > new Date(scEvent.end_date || scEvent.start_date).getTime();
|
|
88
|
-
}
|
|
89
|
-
return false;
|
|
90
|
-
}, [scEvent]);
|
|
86
|
+
const isEventFinished = useMemo(() => checkEventFinished(scEvent), [scEvent]);
|
|
91
87
|
// HANDLERS
|
|
92
88
|
const handleOpen = (event) => {
|
|
93
89
|
setAnchorEl(event.currentTarget);
|
|
@@ -153,7 +149,7 @@ export default function EventActionsMenu(inProps) {
|
|
|
153
149
|
const renderList = () => {
|
|
154
150
|
return [
|
|
155
151
|
_jsxs(MenuItem, Object.assign({ className: classes.item, onClick: () => handleAction(GET_EVENT_LINK) }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, { children: "link" }) }), _jsx(FormattedMessage, { id: "ui.shared.eventActionsMenu.item.link", defaultMessage: "ui.shared.eventActionsMenu.item.link" })] }), "link"),
|
|
156
|
-
_jsxs(MenuItem, Object.assign({ className: classes.item, onClick: () => handleAction(ADD_EVENT_TO_CALENDAR) }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, { children: "CalendarIcon" }) }), _jsx(FormattedMessage, { id: "ui.shared.eventActionsMenu.item.calendar", defaultMessage: "ui.shared.eventActionsMenu.item.calendar" })] }), "calendar"),
|
|
152
|
+
!isEventFinished && (_jsxs(MenuItem, Object.assign({ className: classes.item, onClick: () => handleAction(ADD_EVENT_TO_CALENDAR) }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, { children: "CalendarIcon" }) }), _jsx(FormattedMessage, { id: "ui.shared.eventActionsMenu.item.calendar", defaultMessage: "ui.shared.eventActionsMenu.item.calendar" })] }), "calendar")),
|
|
157
153
|
isEventAdmin &&
|
|
158
154
|
!isEventFinished && [
|
|
159
155
|
_jsx(Divider, {}, "divider"),
|