aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/settings/team/TeamDashboard.js
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2019-04-16 11:48:36 +0200
committerLibravatar GitHub <noreply@github.com>2019-04-16 11:48:36 +0200
commit82195efa887767443bb514edad6d04a6f1a6b62e (patch)
tree8a49a5e84333fab64dee113da0608e45fdb7ddc1 /src/components/settings/team/TeamDashboard.js
parentincrease app opens to show share franz overlay (diff)
parentMerge branch 'develop' into chore/streamline-dashboard (diff)
downloadferdium-app-82195efa887767443bb514edad6d04a6f1a6b62e.tar.gz
ferdium-app-82195efa887767443bb514edad6d04a6f1a6b62e.tar.zst
ferdium-app-82195efa887767443bb514edad6d04a6f1a6b62e.zip
Merge pull request #1393 from meetfranz/chore/streamline-dashboard
Feature/User Websocket
Diffstat (limited to 'src/components/settings/team/TeamDashboard.js')
-rw-r--r--src/components/settings/team/TeamDashboard.js152
1 files changed, 152 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..82c517fcb
--- /dev/null
+++ b/src/components/settings/team/TeamDashboard.js
@@ -0,0 +1,152 @@
1import React, { Component } from 'react';
2import PropTypes from 'prop-types';
3import { observer } 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 isLoading: PropTypes.bool.isRequired,
78 userInfoRequestFailed: PropTypes.bool.isRequired,
79 retryUserInfoRequest: PropTypes.func.isRequired,
80 openTeamManagement: PropTypes.func.isRequired,
81 classes: PropTypes.object.isRequired,
82 };
83
84 static contextTypes = {
85 intl: intlShape,
86 };
87
88 render() {
89 const {
90 isLoading,
91 userInfoRequestFailed,
92 retryUserInfoRequest,
93 openTeamManagement,
94 classes,
95 } = this.props;
96 const { intl } = this.context;
97
98 return (
99 <div className="settings__main">
100 <div className="settings__header">
101 <span className="settings__header-item">
102 {intl.formatMessage(messages.headline)}
103 </span>
104 </div>
105 <div className="settings__body">
106 {isLoading && (
107 <Loader />
108 )}
109
110 {!isLoading && userInfoRequestFailed && (
111 <Infobox
112 icon="alert"
113 type="danger"
114 ctaLabel={intl.formatMessage(messages.tryReloadUserInfoRequest)}
115 ctaLoading={isLoading}
116 ctaOnClick={retryUserInfoRequest}
117 >
118 {intl.formatMessage(messages.userInfoRequestFailed)}
119 </Infobox>
120 )}
121
122 {!userInfoRequestFailed && (
123 <>
124 {!isLoading && (
125 <>
126 <PremiumFeatureContainer>
127 <>
128 <h1>{intl.formatMessage(messages.contentHeadline)}</h1>
129 <div className={classes.container}>
130 <div className={classes.content}>
131 <p>{intl.formatMessage(messages.intro)}</p>
132 <p>{intl.formatMessage(messages.copy)}</p>
133 </div>
134 <img className={classes.image} src="https://cdn.franzinfra.com/announcements/assets/teams.png" alt="Franz for Teams" />
135 </div>
136 <Button
137 label={intl.formatMessage(messages.manageButton)}
138 onClick={openTeamManagement}
139 className={classes.cta}
140 />
141 </>
142 </PremiumFeatureContainer>
143 </>
144 )}
145 </>
146 )}
147 </div>
148 <ReactTooltip place="right" type="dark" effect="solid" />
149 </div>
150 );
151 }
152}