From 86f9ab693dcad951271f727046214b03d91ebd69 Mon Sep 17 00:00:00 2001 From: muhamedsalih-tw <104364298+muhamedsalih-tw@users.noreply.github.com> Date: Sun, 20 Nov 2022 17:35:21 +0530 Subject: Transform Todo feature, ServiceBarTargetUrl, ServiceIcon, TeamDashboard, Slider, Loader & WorkspaceSwitchningIndicator into ts (#782) --- src/components/settings/team/TeamDashboard.tsx | 204 +++++++++++++++++++++++++ 1 file changed, 204 insertions(+) create mode 100644 src/components/settings/team/TeamDashboard.tsx (limited to 'src/components/settings/team/TeamDashboard.tsx') diff --git a/src/components/settings/team/TeamDashboard.tsx b/src/components/settings/team/TeamDashboard.tsx new file mode 100644 index 000000000..3ef55fac6 --- /dev/null +++ b/src/components/settings/team/TeamDashboard.tsx @@ -0,0 +1,204 @@ +import { Component, ReactElement } from 'react'; +import { observer } from 'mobx-react'; +import { defineMessages, injectIntl, WrappedComponentProps } from 'react-intl'; +import ReactTooltip from 'react-tooltip'; +import withStyles, { WithStylesProps } from 'react-jss'; +import classnames from 'classnames'; +import Loader from '../../ui/Loader'; +import Button from '../../ui/button'; +import Infobox from '../../ui/Infobox'; +import { H1 } from '../../ui/headline'; +import { LIVE_FRANZ_API } from '../../../config'; + +const messages = defineMessages({ + headline: { + id: 'settings.team.headline', + defaultMessage: 'Team', + }, + contentHeadline: { + id: 'settings.team.contentHeadline', + defaultMessage: 'Franz Team Management', + }, + intro: { + id: 'settings.team.intro', + defaultMessage: + 'You are currently using Franz Servers, which is why you have access to Team Management.', + }, + copy: { + id: 'settings.team.copy', + defaultMessage: + "Franz's Team Management allows you to manage Franz Subscriptions for multiple users. Please keep in mind that having a Franz Premium subscription will give you no advantages in using Ferdium: The only reason you still have access to Team Management is so you can manage your legacy Franz Teams and so that you don't loose any functionality in managing your account.", + }, + manageButton: { + id: 'settings.team.manageAction', + defaultMessage: 'Manage your Team on meetfranz.com', + }, + teamsUnavailable: { + id: 'settings.team.teamsUnavailable', + defaultMessage: 'Teams are unavailable', + }, + teamsUnavailableInfo: { + id: 'settings.team.teamsUnavailableInfo', + defaultMessage: + 'Teams are currently only available when using the Franz Server and after paying for Franz Professional. Please change your server to https://api.franzinfra.com to use teams.', + }, + tryReloadUserInfoRequest: { + id: 'settings.team.tryReloadUserInfoRequest', + defaultMessage: 'Try reloading', + }, + userInfoRequestFailed: { + id: 'settings.team.userInfoRequestFailed', + defaultMessage: 'User Info request failed', + }, +}); + +const styles = { + cta: { + margin: [40, 'auto'], + height: 'auto', + }, + container: { + display: 'flex', + flexDirection: 'column', + height: 'auto', + + '@media(min-width: 800px)': { + flexDirection: 'row', + }, + }, + content: { + height: 'auto', + order: 1, + + '@media(min-width: 800px)': { + order: 0, + }, + }, + image: { + display: 'block', + height: 150, + order: 0, + margin: [0, 'auto', 40, 'auto'], + + '@media(min-width: 800px)': { + marginLeft: 40, + order: 1, + }, + }, + headline: { + marginBottom: 0, + }, + headlineWithSpacing: { + marginBottom: 'inherit', + }, + buttonContainer: { + display: 'flex', + height: 'auto', + }, +}; + +interface IProps extends WithStylesProps, WrappedComponentProps { + isLoading: boolean; + userInfoRequestFailed: boolean; + retryUserInfoRequest: () => void; + openTeamManagement: () => void; + server: string; +} + +@observer +class TeamDashboard extends Component { + render(): ReactElement { + const { + isLoading, + userInfoRequestFailed, + retryUserInfoRequest, + openTeamManagement, + classes, + server, + intl, + } = this.props; + + return server === LIVE_FRANZ_API ? ( +
+
+ + {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)}

+
+ Ferdium for Teams +
+
+
+ + )} +
+ +
+ ) : ( +
+
+ + {intl.formatMessage(messages.headline)} + +
+
+

+ {intl.formatMessage(messages.teamsUnavailable)} +

+

+ {intl.formatMessage(messages.teamsUnavailableInfo)} +

+
+
+ ); + } +} + +export default injectIntl( + withStyles(styles, { injectTheme: true })(TeamDashboard), +); -- cgit v1.2.3-70-g09d2