aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/services/content/ServiceRestricted.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/services/content/ServiceRestricted.js')
-rw-r--r--src/components/services/content/ServiceRestricted.js38
1 files changed, 31 insertions, 7 deletions
diff --git a/src/components/services/content/ServiceRestricted.js b/src/components/services/content/ServiceRestricted.js
index 9fb7d0961..4b8d926aa 100644
--- a/src/components/services/content/ServiceRestricted.js
+++ b/src/components/services/content/ServiceRestricted.js
@@ -5,16 +5,25 @@ import { defineMessages, intlShape } from 'react-intl';
5 5
6import { serviceLimitStore } from '../../../features/serviceLimit'; 6import { serviceLimitStore } from '../../../features/serviceLimit';
7import Button from '../../ui/Button'; 7import Button from '../../ui/Button';
8import { RESTRICTION_TYPES } from '../../../models/Service';
8 9
9const messages = defineMessages({ 10const messages = defineMessages({
10 headline: { 11 headlineServiceLimit: {
11 id: 'service.restrictedHandler.headline', 12 id: 'service.restrictedHandler.serviceLimit.headline',
12 defaultMessage: '!!!You have reached your service limit.', 13 defaultMessage: '!!!You have reached your service limit.',
13 }, 14 },
14 text: { 15 textServiceLimit: {
15 id: 'service.restrictedHandler.text', 16 id: 'service.restrictedHandler.serviceLimit.text',
16 defaultMessage: '!!!Please upgrade your account to use more than {count} services.', 17 defaultMessage: '!!!Please upgrade your account to use more than {count} services.',
17 }, 18 },
19 headlineCustomUrl: {
20 id: 'service.restrictedHandler.customUrl.headline',
21 defaultMessage: '!!!Franz Professional Plan required',
22 },
23 textCustomUrl: {
24 id: 'service.restrictedHandler.customUrl.text',
25 defaultMessage: '!!!Please upgrade to the Franz Professional plan to use custom urls & self hosted services.',
26 },
18 action: { 27 action: {
19 id: 'service.restrictedHandler.action', 28 id: 'service.restrictedHandler.action',
20 defaultMessage: '!!!Upgrade Account', 29 defaultMessage: '!!!Upgrade Account',
@@ -25,6 +34,7 @@ export default @observer class ServiceRestricted extends Component {
25 static propTypes = { 34 static propTypes = {
26 name: PropTypes.string.isRequired, 35 name: PropTypes.string.isRequired,
27 upgrade: PropTypes.func.isRequired, 36 upgrade: PropTypes.func.isRequired,
37 type: PropTypes.number.isRequired,
28 }; 38 };
29 39
30 static contextTypes = { 40 static contextTypes = {
@@ -36,13 +46,27 @@ export default @observer class ServiceRestricted extends Component {
36 countdownIntervalTimeout = 1000; 46 countdownIntervalTimeout = 1000;
37 47
38 render() { 48 render() {
39 const { name, upgrade } = this.props; 49 const {
50 name,
51 upgrade,
52 type,
53 } = this.props;
40 const { intl } = this.context; 54 const { intl } = this.context;
41 55
42 return ( 56 return (
43 <div className="services__info-layer"> 57 <div className="services__info-layer">
44 <h1>{intl.formatMessage(messages.headline)}</h1> 58 {type === RESTRICTION_TYPES.SERVICE_LIMIT && (
45 <p>{intl.formatMessage(messages.text, { count: serviceLimitStore.serviceLimit })}</p> 59 <>
60 <h1>{intl.formatMessage(messages.headlineServiceLimit)}</h1>
61 <p>{intl.formatMessage(messages.textServiceLimit, { count: serviceLimitStore.serviceLimit })}</p>
62 </>
63 )}
64 {type === RESTRICTION_TYPES.CUSTOM_URL && (
65 <>
66 <h1>{intl.formatMessage(messages.headlineCustomUrl)}</h1>
67 <p>{intl.formatMessage(messages.textCustomUrl)}</p>
68 </>
69 )}
46 <Button 70 <Button
47 label={intl.formatMessage(messages.action, { name })} 71 label={intl.formatMessage(messages.action, { name })}
48 buttonType="inverted" 72 buttonType="inverted"