aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/settings/team/TeamDashboard.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/settings/team/TeamDashboard.js')
-rw-r--r--src/components/settings/team/TeamDashboard.js154
1 files changed, 154 insertions, 0 deletions
diff --git a/src/components/settings/team/TeamDashboard.js b/src/components/settings/team/TeamDashboard.js
new file mode 100644
index 000000000..63381c4ed
--- /dev/null
+++ b/src/components/settings/team/TeamDashboard.js
@@ -0,0 +1,154 @@
1import React, { Component } from 'react';
2import PropTypes from 'prop-types';
3import { observer, PropTypes as MobxPropTypes } from 'mobx-react';
4import { defineMessages, intlShape } from 'react-intl';
5import ReactTooltip from 'react-tooltip';
6import injectSheet from 'react-jss';
7
8import Loader from '../../ui/Loader';
9import Button from '../../ui/Button';
10import Infobox from '../../ui/Infobox';
11import PremiumFeatureContainer from '../../ui/PremiumFeatureContainer';
12
13const messages = defineMessages({
14 headline: {
15 id: 'settings.team.headline',
16 defaultMessage: '!!!Team',
17 },
18 contentHeadline: {
19 id: 'settings.team.contentHeadline',
20 defaultMessage: '!!!Franz for Teams',
21 },
22 intro: {
23 id: 'settings.team.intro',
24 defaultMessage: '!!!You and your team use Franz? You can now manage Premium subscriptions for as many colleagues, friends or family members as you want, all from within one account.',
25 },
26 copy: {
27 id: 'settings.team.copy',
28 defaultMessage: '!!!Franz for Teams gives you the option to invite co-workers to your team by sending them email invitations and manage their subscriptions in your account’s preferences. Don’t waste time setting up subscriptions for every team member individually, forget about multiple invoices and different billing cycles - one team to rule them all!',
29 },
30 manageButton: {
31 id: 'settings.team.manageAction',
32 defaultMessage: '!!!Manage your Team on meetfranz.com',
33 },
34 upgradeButton: {
35 id: 'settings.team.upgradeAction',
36 defaultMessage: '!!!Upgrade your Account',
37 },
38});
39
40const styles = {
41 cta: {
42 margin: [40, 'auto'],
43 },
44 container: {
45 display: 'flex',
46 flexDirection: 'column',
47 height: 'auto',
48
49 ['@media(min-width: 800px)']: {
50 flexDirection: 'row',
51 },
52 },
53 content: {
54 height: 'auto',
55 order: 1,
56
57 ['@media(min-width: 800px)']: {
58 order: 0,
59 },
60 },
61 image: {
62 display: 'block',
63 height: 150,
64 order: 0,
65 margin: [0, 'auto', 40, 'auto'],
66
67 ['@media(min-width: 800px)']: {
68 marginLeft: 40,
69 order: 1,
70 },
71 }
72};
73
74
75export default @injectSheet(styles) @observer class TeamDashboard extends Component {
76 static propTypes = {
77 user: MobxPropTypes.observableObject.isRequired,
78 isLoading: PropTypes.bool.isRequired,
79 userInfoRequestFailed: PropTypes.bool.isRequired,
80 retryUserInfoRequest: PropTypes.func.isRequired,
81 openTeamManagement: PropTypes.func.isRequired,
82 classes: PropTypes.object.isRequired,
83 };
84
85 static contextTypes = {
86 intl: intlShape,
87 };
88
89 render() {
90 const {
91 user,
92 isLoading,
93 userInfoRequestFailed,
94 retryUserInfoRequest,
95 openTeamManagement,
96 classes,
97 } = this.props;
98 const { intl } = this.context;
99
100 return (
101 <div className="settings__main">
102 <div className="settings__header">
103 <span className="settings__header-item">
104 {intl.formatMessage(messages.headline)}
105 </span>
106 </div>
107 <div className="settings__body">
108 {isLoading && (
109 <Loader />
110 )}
111
112 {!isLoading && userInfoRequestFailed && (
113 <Infobox
114 icon="alert"
115 type="danger"
116 ctaLabel={intl.formatMessage(messages.tryReloadUserInfoRequest)}
117 ctaLoading={isLoading}
118 ctaOnClick={retryUserInfoRequest}
119 >
120 {intl.formatMessage(messages.userInfoRequestFailed)}
121 </Infobox>
122 )}
123
124 {!userInfoRequestFailed && (
125 <>
126 {!isLoading && (
127 <>
128 <PremiumFeatureContainer>
129 <>
130 <h1>{intl.formatMessage(messages.contentHeadline)}</h1>
131 <div className={classes.container}>
132 <div className={classes.content}>
133 <p>{intl.formatMessage(messages.intro)}</p>
134 <p>{intl.formatMessage(messages.copy)}</p>
135 </div>
136 <img className={classes.image} src="https://cdn.franzinfra.com/announcements/assets/teams.png" alt="Franz for Teams" />
137 </div>
138 <Button
139 label={intl.formatMessage(messages.manageButton)}
140 onClick={openTeamManagement}
141 className={classes.cta}
142 />
143 </>
144 </PremiumFeatureContainer>
145 </>
146 )}
147 </>
148 )}
149 </div>
150 <ReactTooltip place="right" type="dark" effect="solid" />
151 </div>
152 );
153 }
154}