@selfcommunity/react-ui 0.10.5-payments.143 → 0.10.5-payments.144
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/BuyButton/BuyButton.js +5 -2
- package/lib/cjs/components/Checkout/Checkout.js +2 -44
- package/lib/cjs/components/CheckoutReturnDialog/CheckoutReturnDialog.js +10 -6
- package/lib/esm/components/BuyButton/BuyButton.js +5 -2
- package/lib/esm/components/Checkout/Checkout.js +3 -45
- package/lib/esm/components/CheckoutReturnDialog/CheckoutReturnDialog.js +10 -6
- package/lib/umd/react-ui.js +1 -1
- package/package.json +8 -8
|
@@ -131,10 +131,13 @@ function BuyButton(inProps) {
|
|
|
131
131
|
}
|
|
132
132
|
};
|
|
133
133
|
(0, react_1.useEffect)(() => {
|
|
134
|
-
if ((contentId || content) && contentType) {
|
|
134
|
+
if ((contentId || content) && contentType && scUserContext.user) {
|
|
135
135
|
getStatus();
|
|
136
136
|
}
|
|
137
|
-
|
|
137
|
+
else if (scUserContext.user === null) {
|
|
138
|
+
setPurchased(false);
|
|
139
|
+
}
|
|
140
|
+
}, [contentId, content, contentType, scUserContext.user]);
|
|
138
141
|
if (!contentId && !content) {
|
|
139
142
|
return null;
|
|
140
143
|
}
|
|
@@ -33,48 +33,7 @@ const classes = {
|
|
|
33
33
|
const Root = (0, styles_1.styled)(material_1.Box, {
|
|
34
34
|
slot: 'Root',
|
|
35
35
|
name: constants_1.PREFIX
|
|
36
|
-
})(({ theme }) => ({
|
|
37
|
-
position: 'relative',
|
|
38
|
-
backgroundColor: theme.palette.background.paper,
|
|
39
|
-
display: 'flex',
|
|
40
|
-
flexDirection: 'column',
|
|
41
|
-
justifyContent: 'space-between',
|
|
42
|
-
alignItems: 'center',
|
|
43
|
-
[`& .${classes.content}`]: {
|
|
44
|
-
width: '100%',
|
|
45
|
-
maxWidth: 860,
|
|
46
|
-
display: 'grid',
|
|
47
|
-
gridTemplateColumns: '1fr 1fr',
|
|
48
|
-
gap: 0,
|
|
49
|
-
[theme.breakpoints.down(1034)]: {
|
|
50
|
-
display: 'flex',
|
|
51
|
-
flexDirection: 'column',
|
|
52
|
-
justifyContent: 'space-between',
|
|
53
|
-
alignItems: 'center'
|
|
54
|
-
},
|
|
55
|
-
[`& .${classes.contentObject}`]: {
|
|
56
|
-
display: 'flex',
|
|
57
|
-
flexDirection: 'column',
|
|
58
|
-
justifyContent: 'center',
|
|
59
|
-
alignItems: 'flex-start'
|
|
60
|
-
},
|
|
61
|
-
[`& .${classes.contentDesc}`]: {
|
|
62
|
-
[theme.breakpoints.down(1034)]: {
|
|
63
|
-
display: 'none'
|
|
64
|
-
},
|
|
65
|
-
maxWidth: 600,
|
|
66
|
-
padding: theme.spacing(4)
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
[`& .${classes.checkout}`]: {
|
|
70
|
-
width: '100%',
|
|
71
|
-
bottom: theme.spacing(2)
|
|
72
|
-
},
|
|
73
|
-
[`& .${classes.object}`]: {
|
|
74
|
-
marginTop: theme.spacing(2),
|
|
75
|
-
minWidth: 395
|
|
76
|
-
}
|
|
77
|
-
}));
|
|
36
|
+
})(({ theme }) => ({}));
|
|
78
37
|
function Checkout(inProps) {
|
|
79
38
|
// PROPS
|
|
80
39
|
const props = (0, system_1.useThemeProps)({
|
|
@@ -101,7 +60,6 @@ function Checkout(inProps) {
|
|
|
101
60
|
const isContentObject = (0, react_1.useMemo)(() => contentType && contentId !== undefined, [contentType, contentId]);
|
|
102
61
|
const fetchClientSecret = (0, react_1.useCallback)(() => {
|
|
103
62
|
// Create a Checkout Session
|
|
104
|
-
// TODO: During session create check customer_email or customer to force email prefilled and disabled changes
|
|
105
63
|
if (!loading) {
|
|
106
64
|
console.log('fetching client secret...');
|
|
107
65
|
setInitialized(true);
|
|
@@ -155,6 +113,6 @@ function Checkout(inProps) {
|
|
|
155
113
|
}
|
|
156
114
|
return _c;
|
|
157
115
|
};
|
|
158
|
-
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: [isContentObject && ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.content }, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.contentObject }, { children: renderContentObject() })), (0, jsx_runtime_1.
|
|
116
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: [isContentObject && ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.content }, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.contentObject }, { children: renderContentObject() })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.contentDesc }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5", mb: 1 }, { children: (0, jsx_runtime_1.jsx)("b", { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.checkout.contentDesc.title", defaultMessage: "ui.checkout.contentDesc.title" }) }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2", color: "textSecondary" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.checkout.contentDesc.subTitle", defaultMessage: "ui.checkout.contentDesc.subTitle" }) }))] }))] }))), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ id: "checkout", className: classes.checkout }, { children: (0, jsx_runtime_1.jsx)(react_stripe_js_1.EmbeddedCheckoutProvider, Object.assign({ stripe: stripePromise, options: { clientSecret } }, { children: (0, jsx_runtime_1.jsx)(react_stripe_js_1.EmbeddedCheckout, {}) })) }))] })));
|
|
159
117
|
}
|
|
160
118
|
exports.default = Checkout;
|
|
@@ -20,10 +20,11 @@ const Errors_1 = require("../../constants/Errors");
|
|
|
20
20
|
const Category_1 = tslib_1.__importDefault(require("../Category"));
|
|
21
21
|
const Course_1 = tslib_1.__importDefault(require("../Course"));
|
|
22
22
|
const Group_1 = tslib_1.__importDefault(require("../Group"));
|
|
23
|
-
const PREFIX = '
|
|
23
|
+
const PREFIX = 'SCCheckoutReturnDialog';
|
|
24
24
|
const classes = {
|
|
25
25
|
root: `${PREFIX}-root`,
|
|
26
26
|
img: `${PREFIX}-img`,
|
|
27
|
+
contentObject: `${PREFIX}-content-object`,
|
|
27
28
|
object: `${PREFIX}-object`,
|
|
28
29
|
btn: `${PREFIX}-btn`
|
|
29
30
|
};
|
|
@@ -73,20 +74,23 @@ function CheckoutReturnDialog(inProps) {
|
|
|
73
74
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: !loading && (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.checkoutSuccessDialog.title", defaultMessage: "ui.checkoutSuccessDialog.title" }) });
|
|
74
75
|
};
|
|
75
76
|
const renderContent = () => {
|
|
76
|
-
let
|
|
77
|
+
let footer;
|
|
77
78
|
if (contentType === types_1.SCContentType.EVENT) {
|
|
78
|
-
|
|
79
|
+
footer = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.contentObject }, { children: (0, jsx_runtime_1.jsx)(Event_1.default, { eventId: contentId, template: event_1.SCEventTemplateType.PREVIEW, actions: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}), variant: "outlined", className: classes.object }) })), (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "medium", variant: 'contained', to: scRoutingContext.url(react_core_1.SCRoutes.EVENT_ROUTE_NAME, { id: contentId }), component: react_core_1.Link, className: classes.btn }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.checkoutSuccessDialog.event.button", defaultMessage: "ui.checkoutSuccessDialog.event.button" }) }))] }));
|
|
79
80
|
}
|
|
80
81
|
else if (contentType === types_1.SCContentType.CATEGORY) {
|
|
81
|
-
|
|
82
|
+
footer = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.contentObject }, { children: (0, jsx_runtime_1.jsx)(Category_1.default, { categoryId: contentId, actions: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}), variant: "outlined", className: classes.object }) })), (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "medium", variant: 'contained', to: scRoutingContext.url(react_core_1.SCRoutes.CATEGORY_ROUTE_NAME, { id: contentId }), component: react_core_1.Link, className: classes.btn }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.checkoutSuccessDialog.category.button", defaultMessage: "ui.checkoutSuccessDialog.category.button" }) }))] }));
|
|
82
83
|
}
|
|
83
84
|
else if (contentType === types_1.SCContentType.COURSE) {
|
|
84
|
-
|
|
85
|
+
footer = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.contentObject }, { children: (0, jsx_runtime_1.jsx)(Course_1.default, { courseId: contentId, template: course_1.SCCourseTemplateType.PREVIEW, actions: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}), hideEventParticipants: true, hideEventPlanner: true, variant: "outlined", className: classes.object }) })), (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "medium", variant: 'contained', to: scRoutingContext.url(react_core_1.SCRoutes.COURSE_ROUTE_NAME, { id: contentId }), component: react_core_1.Link, className: classes.btn }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.checkoutSuccessDialog.course.button", defaultMessage: "ui.checkoutSuccessDialog.course.button" }) }))] }));
|
|
86
|
+
}
|
|
87
|
+
else if (contentType === types_1.SCContentType.GROUP) {
|
|
88
|
+
footer = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.contentObject }, { children: (0, jsx_runtime_1.jsx)(Group_1.default, { courseId: contentId, actions: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}), hideEventParticipants: true, hideEventPlanner: true, variant: "outlined", className: classes.object }) })), (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "medium", variant: 'contained', to: scRoutingContext.url(react_core_1.SCRoutes.GROUP_ROUTE_NAME, { id: contentId }), component: react_core_1.Link, className: classes.btn }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.checkoutSuccessDialog.category.button", defaultMessage: "ui.checkoutSuccessDialog.category.button" }) }))] }));
|
|
85
89
|
}
|
|
86
90
|
return ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ spacing: 2, justifyContent: "center", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)("img", { src: clapping_1.CLAPPING, className: classes.img, alt: intl.formatMessage({
|
|
87
91
|
id: 'ui.checkoutSuccessDialog.buy',
|
|
88
92
|
defaultMessage: 'ui.checkoutSuccessDialog.buy'
|
|
89
|
-
}), width: 100, height: 100 }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2", color: "textSecondary" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.checkoutSuccessDialog.buy", defaultMessage: "ui.checkoutSuccessDialog.buy" }) })),
|
|
93
|
+
}), width: 100, height: 100 }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2", color: "textSecondary" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.checkoutSuccessDialog.buy", defaultMessage: "ui.checkoutSuccessDialog.buy" }) })), footer] })));
|
|
90
94
|
};
|
|
91
95
|
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ maxWidth: 'sm', fullWidth: true, scroll: 'paper', open: true }, (disableInitialTransition ? { TransitionComponent: NoTransition } : { TransitionComponent: Transition }), { className: (0, classnames_1.default)(classes.root, className), TransitionComponent: Transition }, rest, { children: [(0, jsx_runtime_1.jsx)(material_1.DialogTitle, { children: renderTitle() }), (0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: loading ? (0, jsx_runtime_1.jsx)(material_1.CircularProgress, {}) : renderContent() })] })));
|
|
92
96
|
}
|
|
@@ -129,10 +129,13 @@ export default function BuyButton(inProps) {
|
|
|
129
129
|
}
|
|
130
130
|
};
|
|
131
131
|
useEffect(() => {
|
|
132
|
-
if ((contentId || content) && contentType) {
|
|
132
|
+
if ((contentId || content) && contentType && scUserContext.user) {
|
|
133
133
|
getStatus();
|
|
134
134
|
}
|
|
135
|
-
|
|
135
|
+
else if (scUserContext.user === null) {
|
|
136
|
+
setPurchased(false);
|
|
137
|
+
}
|
|
138
|
+
}, [contentId, content, contentType, scUserContext.user]);
|
|
136
139
|
if (!contentId && !content) {
|
|
137
140
|
return null;
|
|
138
141
|
}
|
|
@@ -11,7 +11,7 @@ import { PaymentApiClient } from '@selfcommunity/api-services';
|
|
|
11
11
|
import CheckoutSkeleton from './Skeleton';
|
|
12
12
|
import { PREFIX } from './constants';
|
|
13
13
|
import { SCContentType } from '@selfcommunity/types';
|
|
14
|
-
import { useIntl } from 'react-intl';
|
|
14
|
+
import { FormattedMessage, useIntl } from 'react-intl';
|
|
15
15
|
import { getDefaultLocale } from '../../utils/payment';
|
|
16
16
|
import { SCPreferences, useSCPreferences, useSCUser } from '@selfcommunity/react-core';
|
|
17
17
|
import Event from '../Event';
|
|
@@ -31,48 +31,7 @@ const classes = {
|
|
|
31
31
|
const Root = styled(Box, {
|
|
32
32
|
slot: 'Root',
|
|
33
33
|
name: PREFIX
|
|
34
|
-
})(({ theme }) => ({
|
|
35
|
-
position: 'relative',
|
|
36
|
-
backgroundColor: theme.palette.background.paper,
|
|
37
|
-
display: 'flex',
|
|
38
|
-
flexDirection: 'column',
|
|
39
|
-
justifyContent: 'space-between',
|
|
40
|
-
alignItems: 'center',
|
|
41
|
-
[`& .${classes.content}`]: {
|
|
42
|
-
width: '100%',
|
|
43
|
-
maxWidth: 860,
|
|
44
|
-
display: 'grid',
|
|
45
|
-
gridTemplateColumns: '1fr 1fr',
|
|
46
|
-
gap: 0,
|
|
47
|
-
[theme.breakpoints.down(1034)]: {
|
|
48
|
-
display: 'flex',
|
|
49
|
-
flexDirection: 'column',
|
|
50
|
-
justifyContent: 'space-between',
|
|
51
|
-
alignItems: 'center'
|
|
52
|
-
},
|
|
53
|
-
[`& .${classes.contentObject}`]: {
|
|
54
|
-
display: 'flex',
|
|
55
|
-
flexDirection: 'column',
|
|
56
|
-
justifyContent: 'center',
|
|
57
|
-
alignItems: 'flex-start'
|
|
58
|
-
},
|
|
59
|
-
[`& .${classes.contentDesc}`]: {
|
|
60
|
-
[theme.breakpoints.down(1034)]: {
|
|
61
|
-
display: 'none'
|
|
62
|
-
},
|
|
63
|
-
maxWidth: 600,
|
|
64
|
-
padding: theme.spacing(4)
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
[`& .${classes.checkout}`]: {
|
|
68
|
-
width: '100%',
|
|
69
|
-
bottom: theme.spacing(2)
|
|
70
|
-
},
|
|
71
|
-
[`& .${classes.object}`]: {
|
|
72
|
-
marginTop: theme.spacing(2),
|
|
73
|
-
minWidth: 395
|
|
74
|
-
}
|
|
75
|
-
}));
|
|
34
|
+
})(({ theme }) => ({}));
|
|
76
35
|
export default function Checkout(inProps) {
|
|
77
36
|
// PROPS
|
|
78
37
|
const props = useThemeProps({
|
|
@@ -99,7 +58,6 @@ export default function Checkout(inProps) {
|
|
|
99
58
|
const isContentObject = useMemo(() => contentType && contentId !== undefined, [contentType, contentId]);
|
|
100
59
|
const fetchClientSecret = useCallback(() => {
|
|
101
60
|
// Create a Checkout Session
|
|
102
|
-
// TODO: During session create check customer_email or customer to force email prefilled and disabled changes
|
|
103
61
|
if (!loading) {
|
|
104
62
|
console.log('fetching client secret...');
|
|
105
63
|
setInitialized(true);
|
|
@@ -153,5 +111,5 @@ export default function Checkout(inProps) {
|
|
|
153
111
|
}
|
|
154
112
|
return _c;
|
|
155
113
|
};
|
|
156
|
-
return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: [isContentObject && (_jsxs(Box, Object.assign({ className: classes.content }, { children: [_jsx(Box, Object.assign({ className: classes.contentObject }, { children: renderContentObject() })),
|
|
114
|
+
return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: [isContentObject && (_jsxs(Box, Object.assign({ className: classes.content }, { children: [_jsx(Box, Object.assign({ className: classes.contentObject }, { children: renderContentObject() })), _jsxs(Box, Object.assign({ className: classes.contentDesc }, { children: [_jsx(Typography, Object.assign({ variant: "h5", mb: 1 }, { children: _jsx("b", { children: _jsx(FormattedMessage, { id: "ui.checkout.contentDesc.title", defaultMessage: "ui.checkout.contentDesc.title" }) }) })), _jsx(Typography, Object.assign({ variant: "body2", color: "textSecondary" }, { children: _jsx(FormattedMessage, { id: "ui.checkout.contentDesc.subTitle", defaultMessage: "ui.checkout.contentDesc.subTitle" }) }))] }))] }))), _jsx(Box, Object.assign({ id: "checkout", className: classes.checkout }, { children: _jsx(EmbeddedCheckoutProvider, Object.assign({ stripe: stripePromise, options: { clientSecret } }, { children: _jsx(EmbeddedCheckout, {}) })) }))] })));
|
|
157
115
|
}
|
|
@@ -18,10 +18,11 @@ import { SCOPE_SC_UI } from '../../constants/Errors';
|
|
|
18
18
|
import Category from '../Category';
|
|
19
19
|
import Course from '../Course';
|
|
20
20
|
import Group from '../Group';
|
|
21
|
-
const PREFIX = '
|
|
21
|
+
const PREFIX = 'SCCheckoutReturnDialog';
|
|
22
22
|
const classes = {
|
|
23
23
|
root: `${PREFIX}-root`,
|
|
24
24
|
img: `${PREFIX}-img`,
|
|
25
|
+
contentObject: `${PREFIX}-content-object`,
|
|
25
26
|
object: `${PREFIX}-object`,
|
|
26
27
|
btn: `${PREFIX}-btn`
|
|
27
28
|
};
|
|
@@ -71,20 +72,23 @@ export default function CheckoutReturnDialog(inProps) {
|
|
|
71
72
|
return _jsx(_Fragment, { children: !loading && _jsx(FormattedMessage, { id: "ui.checkoutSuccessDialog.title", defaultMessage: "ui.checkoutSuccessDialog.title" }) });
|
|
72
73
|
};
|
|
73
74
|
const renderContent = () => {
|
|
74
|
-
let
|
|
75
|
+
let footer;
|
|
75
76
|
if (contentType === SCContentType.EVENT) {
|
|
76
|
-
|
|
77
|
+
footer = (_jsxs(_Fragment, { children: [_jsx(Box, Object.assign({ className: classes.contentObject }, { children: _jsx(Event, { eventId: contentId, template: SCEventTemplateType.PREVIEW, actions: _jsx(_Fragment, {}), variant: "outlined", className: classes.object }) })), _jsx(Button, Object.assign({ size: "medium", variant: 'contained', to: scRoutingContext.url(SCRoutes.EVENT_ROUTE_NAME, { id: contentId }), component: Link, className: classes.btn }, { children: _jsx(FormattedMessage, { id: "ui.checkoutSuccessDialog.event.button", defaultMessage: "ui.checkoutSuccessDialog.event.button" }) }))] }));
|
|
77
78
|
}
|
|
78
79
|
else if (contentType === SCContentType.CATEGORY) {
|
|
79
|
-
|
|
80
|
+
footer = (_jsxs(_Fragment, { children: [_jsx(Box, Object.assign({ className: classes.contentObject }, { children: _jsx(Category, { categoryId: contentId, actions: _jsx(_Fragment, {}), variant: "outlined", className: classes.object }) })), _jsx(Button, Object.assign({ size: "medium", variant: 'contained', to: scRoutingContext.url(SCRoutes.CATEGORY_ROUTE_NAME, { id: contentId }), component: Link, className: classes.btn }, { children: _jsx(FormattedMessage, { id: "ui.checkoutSuccessDialog.category.button", defaultMessage: "ui.checkoutSuccessDialog.category.button" }) }))] }));
|
|
80
81
|
}
|
|
81
82
|
else if (contentType === SCContentType.COURSE) {
|
|
82
|
-
|
|
83
|
+
footer = (_jsxs(_Fragment, { children: [_jsx(Box, Object.assign({ className: classes.contentObject }, { children: _jsx(Course, { courseId: contentId, template: SCCourseTemplateType.PREVIEW, actions: _jsx(_Fragment, {}), hideEventParticipants: true, hideEventPlanner: true, variant: "outlined", className: classes.object }) })), _jsx(Button, Object.assign({ size: "medium", variant: 'contained', to: scRoutingContext.url(SCRoutes.COURSE_ROUTE_NAME, { id: contentId }), component: Link, className: classes.btn }, { children: _jsx(FormattedMessage, { id: "ui.checkoutSuccessDialog.course.button", defaultMessage: "ui.checkoutSuccessDialog.course.button" }) }))] }));
|
|
84
|
+
}
|
|
85
|
+
else if (contentType === SCContentType.GROUP) {
|
|
86
|
+
footer = (_jsxs(_Fragment, { children: [_jsx(Box, Object.assign({ className: classes.contentObject }, { children: _jsx(Group, { courseId: contentId, actions: _jsx(_Fragment, {}), hideEventParticipants: true, hideEventPlanner: true, variant: "outlined", className: classes.object }) })), _jsx(Button, Object.assign({ size: "medium", variant: 'contained', to: scRoutingContext.url(SCRoutes.GROUP_ROUTE_NAME, { id: contentId }), component: Link, className: classes.btn }, { children: _jsx(FormattedMessage, { id: "ui.checkoutSuccessDialog.category.button", defaultMessage: "ui.checkoutSuccessDialog.category.button" }) }))] }));
|
|
83
87
|
}
|
|
84
88
|
return (_jsxs(Stack, Object.assign({ spacing: 2, justifyContent: "center", alignItems: "center" }, { children: [_jsx("img", { src: CLAPPING, className: classes.img, alt: intl.formatMessage({
|
|
85
89
|
id: 'ui.checkoutSuccessDialog.buy',
|
|
86
90
|
defaultMessage: 'ui.checkoutSuccessDialog.buy'
|
|
87
|
-
}), width: 100, height: 100 }), _jsx(Typography, Object.assign({ variant: "body2", color: "textSecondary" }, { children: _jsx(FormattedMessage, { id: "ui.checkoutSuccessDialog.buy", defaultMessage: "ui.checkoutSuccessDialog.buy" }) })),
|
|
91
|
+
}), width: 100, height: 100 }), _jsx(Typography, Object.assign({ variant: "body2", color: "textSecondary" }, { children: _jsx(FormattedMessage, { id: "ui.checkoutSuccessDialog.buy", defaultMessage: "ui.checkoutSuccessDialog.buy" }) })), footer] })));
|
|
88
92
|
};
|
|
89
93
|
return (_jsxs(Root, Object.assign({ maxWidth: 'sm', fullWidth: true, scroll: 'paper', open: true }, (disableInitialTransition ? { TransitionComponent: NoTransition } : { TransitionComponent: Transition }), { className: classNames(classes.root, className), TransitionComponent: Transition }, rest, { children: [_jsx(DialogTitle, { children: renderTitle() }), _jsx(DialogContent, { children: loading ? _jsx(CircularProgress, {}) : renderContent() })] })));
|
|
90
94
|
}
|