@selfcommunity/react-ui 0.7.50-events.85 → 0.7.50-events.87

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.
Files changed (53) hide show
  1. package/lib/cjs/components/EventHeader/EventHeader.d.ts +1 -1
  2. package/lib/cjs/components/EventHeader/EventHeader.js +24 -16
  3. package/lib/cjs/components/EventInfoWidget/EventInfoWidget.js +1 -1
  4. package/lib/cjs/components/EventInviteButton/EventInviteButton.js +1 -1
  5. package/lib/cjs/components/OnBoardingWidget/OnBoardingWidget.js +1 -2
  6. package/lib/cjs/components/OnBoardingWidget/Steps/App/App.js +2 -4
  7. package/lib/cjs/components/OnBoardingWidget/Steps/Category/Category.js +15 -14
  8. package/lib/cjs/components/OnBoardingWidget/Steps/Content/Content.js +5 -2
  9. package/lib/cjs/constants/Event.d.ts +1 -1
  10. package/lib/cjs/constants/Event.js +1 -1
  11. package/lib/cjs/shared/EventInfoDetails/index.d.ts +3 -0
  12. package/lib/cjs/shared/EventInfoDetails/index.js +17 -18
  13. package/lib/cjs/shared/ProgressBar/index.d.ts +5 -0
  14. package/lib/cjs/shared/ProgressBar/index.js +2 -2
  15. package/lib/esm/components/EventHeader/EventHeader.d.ts +1 -1
  16. package/lib/esm/components/EventHeader/EventHeader.js +24 -16
  17. package/lib/esm/components/EventInfoWidget/EventInfoWidget.js +1 -1
  18. package/lib/esm/components/EventInviteButton/EventInviteButton.js +1 -1
  19. package/lib/esm/components/OnBoardingWidget/OnBoardingWidget.js +1 -2
  20. package/lib/esm/components/OnBoardingWidget/Steps/App/App.js +2 -4
  21. package/lib/esm/components/OnBoardingWidget/Steps/Category/Category.js +16 -15
  22. package/lib/esm/components/OnBoardingWidget/Steps/Content/Content.js +5 -2
  23. package/lib/esm/constants/Event.d.ts +1 -1
  24. package/lib/esm/constants/Event.js +1 -1
  25. package/lib/esm/shared/EventInfoDetails/index.d.ts +3 -0
  26. package/lib/esm/shared/EventInfoDetails/index.js +18 -19
  27. package/lib/esm/shared/ProgressBar/index.d.ts +5 -0
  28. package/lib/esm/shared/ProgressBar/index.js +2 -2
  29. package/lib/umd/99.js +2 -0
  30. package/lib/umd/react-ui.js +1 -1
  31. package/package.json +8 -7
  32. package/lib/cjs/assets/onBoarding/Android.d.ts +0 -1
  33. package/lib/cjs/assets/onBoarding/Android.js +0 -7
  34. package/lib/cjs/assets/onBoarding/CategoryA.d.ts +0 -1
  35. package/lib/cjs/assets/onBoarding/CategoryA.js +0 -7
  36. package/lib/cjs/assets/onBoarding/CategoryB.d.ts +0 -1
  37. package/lib/cjs/assets/onBoarding/CategoryB.js +0 -7
  38. package/lib/cjs/assets/onBoarding/Header.d.ts +0 -1
  39. package/lib/cjs/assets/onBoarding/Header.js +0 -7
  40. package/lib/cjs/assets/onBoarding/Ios.d.ts +0 -1
  41. package/lib/cjs/assets/onBoarding/Ios.js +0 -7
  42. package/lib/esm/assets/onBoarding/Android.d.ts +0 -1
  43. package/lib/esm/assets/onBoarding/Android.js +0 -4
  44. package/lib/esm/assets/onBoarding/CategoryA.d.ts +0 -1
  45. package/lib/esm/assets/onBoarding/CategoryA.js +0 -4
  46. package/lib/esm/assets/onBoarding/CategoryB.d.ts +0 -1
  47. package/lib/esm/assets/onBoarding/CategoryB.js +0 -4
  48. package/lib/esm/assets/onBoarding/Header.d.ts +0 -1
  49. package/lib/esm/assets/onBoarding/Header.js +0 -4
  50. package/lib/esm/assets/onBoarding/Ios.d.ts +0 -1
  51. package/lib/esm/assets/onBoarding/Ios.js +0 -4
  52. package/lib/umd/920.js +0 -2
  53. /package/lib/umd/{920.js.LICENSE.txt → 99.js.LICENSE.txt} +0 -0
@@ -7,8 +7,6 @@ import classNames from 'classnames';
7
7
  import { PREFIX } from '../../constants';
8
8
  import { Button, CardMedia, Icon, Tab, Tabs, Typography } from '@mui/material';
9
9
  import { FormattedMessage } from 'react-intl';
10
- import Ios from '../../../../assets/onBoarding/Ios';
11
- import Android from '../../../../assets/onBoarding/Android';
12
10
  import { SCOnBoardingStepStatusType } from '@selfcommunity/types';
13
11
  const classes = {
14
12
  root: `${PREFIX}-app-root`,
@@ -53,7 +51,7 @@ export default function App(inProps) {
53
51
  // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
54
52
  // @ts-ignore
55
53
  b: (...chunks) => _jsx("strong", { children: chunks })
56
- } }) })), _jsx(CardMedia, Object.assign({ className: classes.image, component: "div" }, { children: _jsx(Ios, {}) }))] })), tab === 1 && (_jsxs(_Fragment, { children: [_jsx(Typography, Object.assign({ className: classes.summary }, { children: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.step.app.android", defaultMessage: "ui.onBoardingWidget.step.app.android" }) })), _jsx(Typography, Object.assign({ className: classes.step }, { children: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.step.app.android.a", defaultMessage: "ui.onBoardingWidget.step.app.android.a", values: {
54
+ } }) })), _jsx(CardMedia, { className: classes.image, component: "img", src: "/onBoarding/ios.png" })] })), tab === 1 && (_jsxs(_Fragment, { children: [_jsx(Typography, Object.assign({ className: classes.summary }, { children: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.step.app.android", defaultMessage: "ui.onBoardingWidget.step.app.android" }) })), _jsx(Typography, Object.assign({ className: classes.step }, { children: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.step.app.android.a", defaultMessage: "ui.onBoardingWidget.step.app.android.a", values: {
57
55
  // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
58
56
  // @ts-ignore
59
57
  icon: (...chunks) => _jsx(Icon, Object.assign({ fontSize: "medium" }, { children: chunks })),
@@ -67,5 +65,5 @@ export default function App(inProps) {
67
65
  // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
68
66
  // @ts-ignore
69
67
  b: (...chunks) => _jsx("strong", { children: chunks })
70
- } }) })), _jsx(CardMedia, Object.assign({ className: classes.image, component: "div" }, { children: _jsx(Android, {}) }))] })), _jsx(Button, Object.assign({ className: classes.button, size: "small", variant: "outlined", color: "secondary", onClick: onCompleteAction, disabled: (step === null || step === void 0 ? void 0 : step.status) === SCOnBoardingStepStatusType.COMPLETED || (step === null || step === void 0 ? void 0 : step.status) === SCOnBoardingStepStatusType.IN_PROGRESS }, { children: "Ok!" }))] }))] })));
68
+ } }) })), _jsx(CardMedia, { className: classes.image, component: "img", src: "/onBoarding/android.png" })] })), _jsx(Button, Object.assign({ className: classes.button, size: "small", variant: "outlined", color: "secondary", onClick: onCompleteAction, disabled: (step === null || step === void 0 ? void 0 : step.status) === SCOnBoardingStepStatusType.COMPLETED || (step === null || step === void 0 ? void 0 : step.status) === SCOnBoardingStepStatusType.IN_PROGRESS }, { children: "Ok!" }))] }))] })));
71
69
  }
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { styled } from '@mui/material/styles';
3
3
  import { Alert, Button, CardMedia, Icon, Typography } from '@mui/material';
4
4
  import Box from '@mui/material/Box';
@@ -7,10 +7,9 @@ import classNames from 'classnames';
7
7
  import { useEffect, useState } from 'react';
8
8
  import { FormattedMessage } from 'react-intl';
9
9
  import { PREFIX } from '../../constants';
10
- import CategoryA from '../../../../assets/onBoarding/CategoryA';
11
- import CategoryB from '../../../../assets/onBoarding/CategoryB';
12
10
  import ProgressBar from '../../../../shared/ProgressBar';
13
11
  import { SCOnBoardingStepStatusType } from '@selfcommunity/types';
12
+ import { Player } from '@lottiefiles/react-lottie-player';
14
13
  const classes = {
15
14
  root: `${PREFIX}-category-root`,
16
15
  title: `${PREFIX}-category-title`,
@@ -18,7 +17,9 @@ const classes = {
18
17
  image: `${PREFIX}-category-image`,
19
18
  action: `${PREFIX}-category-action`,
20
19
  button: `${PREFIX}-category-button`,
21
- success: `${PREFIX}-success`
20
+ success: `${PREFIX}-success`,
21
+ progress: `${PREFIX}-category-progress`,
22
+ animationProgress: `${PREFIX}-category-animation-progress`
22
23
  };
23
24
  function CircledLetter({ letter, statement }) {
24
25
  return (_jsxs(Box, Object.assign({ component: "span", sx: { display: 'flex', alignItems: 'center', gap: 1, mb: 1.5 } }, { children: [_jsx(Box, Object.assign({ component: "span", sx: {
@@ -65,15 +66,15 @@ export default function Category(inProps) {
65
66
  return () => clearInterval(intervalId);
66
67
  }
67
68
  }, [step.status, step.completion_percentage]);
68
- return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className) }, { children: [_jsx(Typography, Object.assign({ variant: "h4", className: classes.title }, { children: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.categories", defaultMessage: "ui.onBoardingWidget.categories" }) })), _jsx(Typography, Object.assign({ className: classes.summary }, { children: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.step.category.summary", defaultMessage: "ui.onBoardingWidget.step.category.summary" }) })), _jsx(Typography, { children: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.step.category.generation.steps", defaultMessage: "ui.onBoardingWidget.step.category.generation.steps", values: {
69
- // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
70
- // @ts-ignore
71
- iconA: (...chunks) => _jsx(CircledLetter, { letter: "a", statement: chunks }),
72
- // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
73
- // @ts-ignore
74
- iconB: (...chunks) => _jsx(CircledLetter, { letter: "b", statement: chunks }),
75
- // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
76
- // @ts-ignore
77
- iconC: (...chunks) => _jsx(CircledLetter, { letter: "c", statement: chunks })
78
- } }) }), _jsx(CardMedia, Object.assign({ className: classes.image, component: "div" }, { children: _jsx(CategoryA, {}) })), _jsx(CardMedia, Object.assign({ className: classes.image, component: "div" }, { children: _jsx(CategoryB, {}) })), _jsx(Box, Object.assign({ component: "span", className: classes.action }, { children: (step === null || step === void 0 ? void 0 : step.status) === SCOnBoardingStepStatusType.COMPLETED ? (_jsx(Alert, Object.assign({ severity: "success" }, { children: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.step.categories.success", defaultMessage: "ui.onBoardingWidget.step.categories.success" }) }))) : (step === null || step === void 0 ? void 0 : step.status) === SCOnBoardingStepStatusType.IN_PROGRESS ? (_jsx(ProgressBar, { value: progress, loadingMessage: _jsx(Typography, Object.assign({ variant: "h4" }, { children: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.step.categories.loading", defaultMessage: "ui.onBoardingWidget.step.categories.loading" }) })) })) : (_jsx(Button, Object.assign({ size: "small", variant: "contained", color: "secondary", onClick: handleCategoriesCreation, endIcon: _jsx(Icon, { children: hover ? 'ai_stars' : 'magic_wand' }), onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false) }, { children: _jsx(FormattedMessage, { defaultMessage: "ui.onBoardingWidget.step.category.button", id: "ui.onBoardingWidget.step.category.button" }) }))) }))] })));
69
+ return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className) }, { children: [_jsx(Typography, Object.assign({ variant: "h4", className: classes.title }, { children: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.categories", defaultMessage: "ui.onBoardingWidget.categories" }) })), _jsx(Typography, Object.assign({ className: classes.summary }, { children: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.step.category.summary", defaultMessage: "ui.onBoardingWidget.step.category.summary" }) })), (step === null || step === void 0 ? void 0 : step.status) !== SCOnBoardingStepStatusType.IN_PROGRESS && (_jsxs(_Fragment, { children: [_jsx(Typography, { children: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.step.category.generation.steps", defaultMessage: "ui.onBoardingWidget.step.category.generation.steps", values: {
70
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
71
+ // @ts-ignore
72
+ iconA: (...chunks) => _jsx(CircledLetter, { letter: "a", statement: chunks }),
73
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
74
+ // @ts-ignore
75
+ iconB: (...chunks) => _jsx(CircledLetter, { letter: "b", statement: chunks }),
76
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
77
+ // @ts-ignore
78
+ iconC: (...chunks) => _jsx(CircledLetter, { letter: "c", statement: chunks })
79
+ } }) }), _jsx(CardMedia, { className: classes.image, component: "img", src: "/onBoarding/categoryA.svg" }), _jsx(CardMedia, { className: classes.image, component: "img", src: "/onBoarding/categoryB.svg" })] })), _jsx(Box, Object.assign({ component: "span", className: classes.action }, { children: (step === null || step === void 0 ? void 0 : step.status) === SCOnBoardingStepStatusType.COMPLETED ? (_jsx(Alert, Object.assign({ severity: "success" }, { children: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.step.categories.success", defaultMessage: "ui.onBoardingWidget.step.categories.success" }) }))) : (step === null || step === void 0 ? void 0 : step.status) === SCOnBoardingStepStatusType.IN_PROGRESS ? (_jsxs(Box, Object.assign({ className: classes.progress }, { children: [_jsx(Player, { autoplay: true, loop: true, src: "/onBoarding/progress/category_progress.json", className: classes.animationProgress, controls: false }), _jsx(ProgressBar, { value: progress, hideBar: true, loadingMessage: _jsx(Typography, Object.assign({ variant: "h4" }, { children: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.step.categories.loading", defaultMessage: "ui.onBoardingWidget.step.categories.loading" }) })) })] }))) : (_jsx(Button, Object.assign({ size: "small", variant: "contained", color: "secondary", onClick: handleCategoriesCreation, endIcon: _jsx(Icon, { children: hover ? 'ai_stars' : 'magic_wand' }), onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false) }, { children: _jsx(FormattedMessage, { defaultMessage: "ui.onBoardingWidget.step.category.button", id: "ui.onBoardingWidget.step.category.button" }) }))) }))] })));
79
80
  }
@@ -9,11 +9,14 @@ import { PREFIX } from '../../constants';
9
9
  import { FormattedMessage } from 'react-intl';
10
10
  import { SCOnBoardingStepStatusType } from '@selfcommunity/types';
11
11
  import ProgressBar from '../../../../shared/ProgressBar';
12
+ import { Player } from '@lottiefiles/react-lottie-player';
12
13
  const classes = {
13
14
  root: `${PREFIX}-content-root`,
14
15
  title: `${PREFIX}-content-title`,
15
16
  summary: `${PREFIX}-content-summary`,
16
- action: `${PREFIX}-content-action`
17
+ action: `${PREFIX}-content-action`,
18
+ progress: `${PREFIX}-content-progress`,
19
+ animationProgress: `${PREFIX}-content-animation-progress`
17
20
  };
18
21
  const Root = styled(Box, {
19
22
  name: PREFIX,
@@ -45,5 +48,5 @@ export default function Content(inProps) {
45
48
  return () => clearInterval(intervalId);
46
49
  }
47
50
  }, [step.status, step.completion_percentage]);
48
- return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className) }, { children: [_jsx(Typography, Object.assign({ variant: "h4", className: classes.title }, { children: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.contents", defaultMessage: "ui.onBoardingWidget.contents" }) })), _jsx(Typography, Object.assign({ className: classes.summary }, { children: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.step.content.summary", defaultMessage: "ui.onBoardingWidget.step.content.summary" }) })), _jsx(Box, Object.assign({ component: "span", className: classes.action }, { children: (step === null || step === void 0 ? void 0 : step.status) === SCOnBoardingStepStatusType.COMPLETED ? (_jsx(Alert, Object.assign({ severity: "success" }, { children: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.step.contents.success", defaultMessage: "ui.onBoardingWidget.step.contents.success" }) }))) : (step === null || step === void 0 ? void 0 : step.status) === SCOnBoardingStepStatusType.IN_PROGRESS ? (_jsx(ProgressBar, { value: progress, loadingMessage: _jsx(Typography, Object.assign({ variant: "h4" }, { children: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.step.contents.loading", defaultMessage: "ui.onBoardingWidget.step.contents.loading" }) })) })) : (_jsx(Button, Object.assign({ size: "small", variant: "contained", color: "secondary", onClick: handleContentCreation, endIcon: _jsx(Icon, { children: hover ? 'ai_stars' : 'magic_wand' }), onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false) }, { children: _jsx(FormattedMessage, { defaultMessage: "ui.onBoardingWidget.step.content.button", id: "ui.onBoardingWidget.step.content.button" }) }))) }))] })));
51
+ return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className) }, { children: [_jsx(Typography, Object.assign({ variant: "h4", className: classes.title }, { children: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.contents", defaultMessage: "ui.onBoardingWidget.contents" }) })), _jsx(Typography, Object.assign({ className: classes.summary }, { children: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.step.content.summary", defaultMessage: "ui.onBoardingWidget.step.content.summary" }) })), _jsx(Box, Object.assign({ component: "span", className: classes.action }, { children: (step === null || step === void 0 ? void 0 : step.status) === SCOnBoardingStepStatusType.COMPLETED ? (_jsx(Alert, Object.assign({ severity: "success" }, { children: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.step.contents.success", defaultMessage: "ui.onBoardingWidget.step.contents.success" }) }))) : (step === null || step === void 0 ? void 0 : step.status) === SCOnBoardingStepStatusType.IN_PROGRESS ? (_jsxs(Box, Object.assign({ className: classes.progress }, { children: [_jsx(Player, { autoplay: true, loop: true, src: "/onBoarding/progress/content_progress.json", className: classes.animationProgress, controls: false }), _jsx(ProgressBar, { value: progress, hideBar: true, loadingMessage: _jsx(Typography, Object.assign({ variant: "h4" }, { children: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.step.contents.loading", defaultMessage: "ui.onBoardingWidget.step.contents.loading" }) })) })] }))) : (_jsx(Button, Object.assign({ size: "small", variant: "contained", color: "secondary", onClick: handleContentCreation, endIcon: _jsx(Icon, { children: hover ? 'ai_stars' : 'magic_wand' }), onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false) }, { children: _jsx(FormattedMessage, { defaultMessage: "ui.onBoardingWidget.step.content.button", id: "ui.onBoardingWidget.step.content.button" }) }))) }))] })));
49
52
  }
@@ -1,2 +1,2 @@
1
1
  export declare const EVENT_TITLE_MAX_LENGTH = 50;
2
- export declare const EVENT_DESCRIPTION_MAX_LENGTH = 150;
2
+ export declare const EVENT_DESCRIPTION_MAX_LENGTH = 500;
@@ -1,2 +1,2 @@
1
1
  export const EVENT_TITLE_MAX_LENGTH = 50;
2
- export const EVENT_DESCRIPTION_MAX_LENGTH = 150;
2
+ export const EVENT_DESCRIPTION_MAX_LENGTH = 500;
@@ -3,14 +3,17 @@ import React from 'react';
3
3
  export interface EventInfoDetailsProps {
4
4
  event: SCEventType;
5
5
  hideDateIcon?: boolean;
6
+ hideRecurringIcon?: boolean;
6
7
  hidePrivacyIcon?: boolean;
7
8
  hideLocationIcon?: boolean;
8
9
  hideCreatedIcon?: boolean;
9
10
  hasDateInfo?: boolean;
11
+ hasRecurringInfo?: boolean;
10
12
  hasPrivacyInfo?: boolean;
11
13
  hasLocationInfo?: boolean;
12
14
  hasCreatedInfo?: boolean;
13
15
  beforeDateInfo?: React.ReactNode | null;
16
+ beforeRecurringInfo?: React.ReactNode | null;
14
17
  beforePrivacyInfo?: React.ReactNode | null;
15
18
  beforeLocationInfo?: React.ReactNode | null;
16
19
  beforeCreatedInfo?: React.ReactNode | null;
@@ -1,14 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Icon, Stack, styled, Typography, useThemeProps } from '@mui/material';
3
3
  import { Link } from '@selfcommunity/react-core';
4
- import { SCEventLocationType, SCEventPrivacyType } from '@selfcommunity/types';
5
- import { format } from 'date-fns';
6
- import { enUS, it } from 'date-fns/locale';
4
+ import { SCEventLocationType, SCEventPrivacyType, SCEventRecurrenceType } from '@selfcommunity/types';
7
5
  import { FormattedMessage, useIntl } from 'react-intl';
8
- const LOCALE_MAP = {
9
- en: enUS,
10
- it
11
- };
12
6
  const PREFIX = 'SCEventInfoDetails';
13
7
  const classes = {
14
8
  root: `${PREFIX}-root`,
@@ -28,20 +22,25 @@ export default function EventInfoDetails(inProps) {
28
22
  props: inProps,
29
23
  name: PREFIX
30
24
  });
31
- const { event, hideDateIcon = false, hidePrivacyIcon = false, hideLocationIcon = false, hideCreatedIcon = false, hasDateInfo = true, hasPrivacyInfo = true, hasLocationInfo = true, hasCreatedInfo = false, beforeDateInfo, beforePrivacyInfo, beforeLocationInfo, beforeCreatedInfo } = props;
25
+ const { event, hideDateIcon = false, hideRecurringIcon = false, hidePrivacyIcon = false, hideLocationIcon = false, hideCreatedIcon = false, hasDateInfo = true, hasRecurringInfo = false, hasPrivacyInfo = true, hasLocationInfo = true, hasCreatedInfo = false, beforeDateInfo, beforeRecurringInfo, beforePrivacyInfo, beforeLocationInfo, beforeCreatedInfo } = props;
32
26
  // HOOKS
33
27
  const intl = useIntl();
34
28
  const privacy = event.privacy === SCEventPrivacyType.PUBLIC ? 'ui.eventInfoDetails.privacy.public' : 'ui.eventInfoDetails.privacy.private';
35
29
  const location = event.location === SCEventLocationType.ONLINE ? 'ui.eventInfoDetails.location.virtual' : 'ui.eventInfoDetails.location.inPerson';
36
- const formatDateEventDate = (date) => {
37
- return format(new Date(date), "EEEE d MMMM' - Ore 'H:mm", {
38
- locale: LOCALE_MAP[intl.locale]
39
- }).replace(/([a-z/ì]+) (\d{2}) ([a-z]+) - Ore (\d{2}):(\d{2})/, (_, weekDay, day, month, hour, minute) => `${weekDay.charAt(0).toUpperCase() + weekDay.slice(1)} ${day} ${month.charAt(0).toUpperCase() + month.slice(1)} - Ore ${hour}:${minute}`);
40
- };
41
- const formatDateCreateDate = (date) => {
42
- return format(new Date(date), "'Creato il 'd MMMM y", {
43
- locale: LOCALE_MAP[intl.locale]
44
- }).replace(/Creato il (\d{1})+ ([a-z]+) (\d{4})/, (_, day, month, year) => `Creato il ${day} ${month.charAt(0).toUpperCase() + month.slice(1)} ${year}`);
45
- };
46
- return (_jsxs(Root, Object.assign({ className: classes.root }, { children: [beforeDateInfo, hasDateInfo && (_jsxs(Stack, Object.assign({ className: classes.iconTextWrapper }, { children: [!hideDateIcon && _jsx(Icon, Object.assign({ fontSize: "small" }, { children: "CalendarIcon" })), _jsx(Typography, Object.assign({ variant: "body1" }, { children: formatDateEventDate(event.start_date) }))] }))), beforePrivacyInfo, hasPrivacyInfo && (_jsxs(Stack, Object.assign({ className: classes.iconTextWrapper }, { children: [!hidePrivacyIcon && _jsx(Icon, Object.assign({ fontSize: "small" }, { children: event.privacy === SCEventPrivacyType.PUBLIC ? 'public' : 'private' })), _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: privacy, defaultMessage: privacy }) })), "-", _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: location, defaultMessage: location }) }))] }))), beforeLocationInfo, hasLocationInfo && (_jsxs(Stack, Object.assign({ className: classes.iconTextWrapper }, { children: [!hideLocationIcon && (_jsx(Icon, Object.assign({ fontSize: "small" }, { children: event.location === SCEventLocationType.ONLINE ? 'play_circle_outline' : 'add_location_alt' }))), event.location === SCEventLocationType.ONLINE ? (_jsx(Link, Object.assign({ to: event.link, target: "_blank", className: classes.link }, { children: _jsx(Typography, Object.assign({ variant: "body1", className: classes.url }, { children: event.link })) }))) : (_jsx(Typography, Object.assign({ variant: "body1", className: classes.url }, { children: event.geolocation })))] }))), beforeCreatedInfo, hasCreatedInfo && (_jsxs(Stack, Object.assign({ className: classes.creationWrapper }, { children: [!hideCreatedIcon && _jsx(Icon, Object.assign({ fontSize: "small" }, { children: "create" })), _jsx(Typography, Object.assign({ variant: "body1" }, { children: formatDateCreateDate(event.created_at) }))] })))] })));
30
+ return (_jsxs(Root, Object.assign({ className: classes.root }, { children: [beforeDateInfo, hasDateInfo && (_jsxs(Stack, Object.assign({ className: classes.iconTextWrapper }, { children: [!hideDateIcon && _jsx(Icon, Object.assign({ fontSize: "small" }, { children: "CalendarIcon" })), _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: "ui.eventInfoDetails.date.startEndTime", defaultMessage: "ui.eventInfoDetails.date.startEndTime", values: {
31
+ date: intl.formatDate(event.running ? event.running_start_date : event.next_start_date, {
32
+ weekday: 'long',
33
+ day: 'numeric',
34
+ year: 'numeric',
35
+ month: 'long'
36
+ }),
37
+ start: intl.formatDate(event.running ? event.running_start_date : event.next_start_date, { hour: 'numeric', minute: 'numeric' })
38
+ } }) }))] }))), beforeRecurringInfo, hasRecurringInfo && event.recurring !== SCEventRecurrenceType.NEVER && (_jsxs(Stack, Object.assign({ className: classes.iconTextWrapper }, { children: [!hideRecurringIcon && _jsx(Icon, Object.assign({ fontSize: "small" }, { children: "frequency" })), _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: `ui.eventInfoDetails.frequency.${event.recurring}.placeholder`, defaultMessage: `ui.eventInfoDetails.frequency.${event.recurring}.placeholder` }) }))] }))), beforePrivacyInfo, hasPrivacyInfo && (_jsxs(Stack, Object.assign({ className: classes.iconTextWrapper }, { children: [!hidePrivacyIcon && _jsx(Icon, Object.assign({ fontSize: "small" }, { children: event.privacy === SCEventPrivacyType.PUBLIC ? 'public' : 'private' })), _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: privacy, defaultMessage: privacy }) })), "-", _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: location, defaultMessage: location }) }))] }))), beforeLocationInfo, hasLocationInfo && (_jsxs(Stack, Object.assign({ className: classes.iconTextWrapper }, { children: [!hideLocationIcon && (_jsx(Icon, Object.assign({ fontSize: "small" }, { children: event.location === SCEventLocationType.ONLINE ? 'play_circle_outline' : 'add_location_alt' }))), event.location === SCEventLocationType.ONLINE ? (_jsx(Link, Object.assign({ to: event.link, target: "_blank", className: classes.link }, { children: _jsx(Typography, Object.assign({ variant: "body1", className: classes.url }, { children: event.link })) }))) : (_jsx(Typography, Object.assign({ variant: "body1", className: classes.url }, { children: event.geolocation })))] }))), beforeCreatedInfo, hasCreatedInfo && (_jsxs(Stack, Object.assign({ className: classes.creationWrapper }, { children: [!hideCreatedIcon && _jsx(Icon, Object.assign({ fontSize: "small" }, { children: "create" })), _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: "ui.eventInfoDetails.date.create", defaultMessage: "ui.eventInfoDetails.date.create", values: {
39
+ date: intl.formatDate(event.created_at, {
40
+ weekday: 'long',
41
+ day: 'numeric',
42
+ year: 'numeric',
43
+ month: 'long'
44
+ })
45
+ } }) }))] })))] })));
47
46
  }
@@ -15,6 +15,11 @@ export interface ProgressBarProps extends LinearProgressProps {
15
15
  * @default null
16
16
  */
17
17
  loadingMessage?: React.ReactNode;
18
+ /**
19
+ * Hides the bar, rendering just the massage and percentage
20
+ * @default false
21
+ */
22
+ hideBar?: boolean;
18
23
  /**
19
24
  * Any other properties
20
25
  */
@@ -17,6 +17,6 @@ const Root = styled(Box, {
17
17
  overridesResolver: (props, styles) => styles.root
18
18
  })(() => ({}));
19
19
  export default function ProgressBar(props) {
20
- const { className, value, loadingMessage = null } = props, rest = __rest(props, ["className", "value", "loadingMessage"]);
21
- return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className) }, { children: [_jsx(Box, Object.assign({ className: classes.message }, { children: loadingMessage })), _jsx(LinearProgress, Object.assign({ variant: "determinate", color: "success", className: classes.bar, value: value }, rest)), _jsx(Box, Object.assign({ className: classes.progress }, { children: _jsx(Typography, Object.assign({ variant: "body2", color: "text.secondary" }, { children: `${Math.round(value)}%` })) }))] })));
20
+ const { className, value, loadingMessage = null, hideBar = false } = props, rest = __rest(props, ["className", "value", "loadingMessage", "hideBar"]);
21
+ return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className) }, { children: [_jsx(Box, Object.assign({ className: classes.message }, { children: loadingMessage })), !hideBar && _jsx(LinearProgress, Object.assign({ variant: "determinate", color: "success", className: classes.bar, value: value }, rest)), _jsx(Box, Object.assign({ className: classes.progress }, { children: _jsx(Typography, Object.assign({ variant: "body2", color: "text.secondary" }, { children: `${Math.round(value)}%` })) }))] })));
22
22
  }