From c41bf73d129d2fba3ec23c1b7b463aaf9dc80dc6 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Mon, 8 Apr 2019 15:57:32 +0200 Subject: Add new Team page in settings --- src/components/settings/team/TeamDashboard.js | 125 ++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 src/components/settings/team/TeamDashboard.js (limited to 'src/components/settings/team') diff --git a/src/components/settings/team/TeamDashboard.js b/src/components/settings/team/TeamDashboard.js new file mode 100644 index 000000000..a29a262e9 --- /dev/null +++ b/src/components/settings/team/TeamDashboard.js @@ -0,0 +1,125 @@ +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; +import { observer, PropTypes as MobxPropTypes } from 'mobx-react'; +import { defineMessages, intlShape } from 'react-intl'; +import ReactTooltip from 'react-tooltip'; +import injectSheet from 'react-jss'; + +import Loader from '../../ui/Loader'; +import Button from '../../ui/Button'; +import Infobox from '../../ui/Infobox'; +import PremiumFeatureContainer from '../../ui/PremiumFeatureContainer'; + +const messages = defineMessages({ + headline: { + id: 'settings.team.headline', + defaultMessage: '!!!Team', + }, + contentHeadline: { + id: 'settings.team.contentHeadline', + defaultMessage: '!!!Franz for Teams', + }, + intro: { + id: 'settings.team.intro', + 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.', + }, + copy: { + id: 'settings.team.copy', + 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!', + }, + manageButton: { + id: 'settings.team.manageAction', + defaultMessage: '!!!Manage your Team', + }, + upgradeButton: { + id: 'settings.team.upgradeAction', + defaultMessage: '!!!Upgrade your Account', + }, +}); + +const styles = theme => ({ + cta: { + marginTop: 40, + }, +}); + + +export default @injectSheet(styles) @observer class TeamDashboard extends Component { + static propTypes = { + user: MobxPropTypes.observableObject.isRequired, + isLoading: PropTypes.bool.isRequired, + userInfoRequestFailed: PropTypes.bool.isRequired, + retryUserInfoRequest: PropTypes.func.isRequired, + openTeamManagement: PropTypes.func.isRequired, + upgradeAccount: PropTypes.func.isRequired, + classes: PropTypes.object.isRequired, + }; + + static contextTypes = { + intl: intlShape, + }; + + render() { + const { + user, + isLoading, + userInfoRequestFailed, + retryUserInfoRequest, + openTeamManagement, + upgradeAccount, + classes, + } = this.props; + const { intl } = this.context; + + return ( +
+
+ + {intl.formatMessage(messages.headline)} + +
+
+ {isLoading && ( + + )} + + {!isLoading && userInfoRequestFailed && ( + + {intl.formatMessage(messages.userInfoRequestFailed)} + + )} + + {!userInfoRequestFailed && ( + <> + {!isLoading && ( + <> + + <> +

{intl.formatMessage(messages.contentHeadline)}

+

{intl.formatMessage(messages.intro)}

+

{intl.formatMessage(messages.copy)}

+ {user.isSubscriptionOwner && ( +
+ +
+ ); + } +} -- cgit v1.2.3-70-g09d2