diff options
author | 2021-07-17 20:32:22 +0530 | |
---|---|---|
committer | 2021-07-20 16:02:15 +0000 | |
commit | 45373f655f68fdd0b320cde175b6108454ad4731 (patch) | |
tree | c1ccb0c73639d754b68a36a1977b74471fe4b566 /src/features/workspaces/components/WorkspacesDashboard.js | |
parent | New Crowdin updates (#1668) (diff) | |
download | ferdium-app-45373f655f68fdd0b320cde175b6108454ad4731.tar.gz ferdium-app-45373f655f68fdd0b320cde175b6108454ad4731.tar.zst ferdium-app-45373f655f68fdd0b320cde175b6108454ad4731.zip |
Removed Franz paid plans features:
- serviceLimit
- planSelection
- trialStatusBar
and other Franz features that were for different tiers of subscription.
Diffstat (limited to 'src/features/workspaces/components/WorkspacesDashboard.js')
-rw-r--r-- | src/features/workspaces/components/WorkspacesDashboard.js | 129 |
1 files changed, 45 insertions, 84 deletions
diff --git a/src/features/workspaces/components/WorkspacesDashboard.js b/src/features/workspaces/components/WorkspacesDashboard.js index cfaacd56e..0c2588c42 100644 --- a/src/features/workspaces/components/WorkspacesDashboard.js +++ b/src/features/workspaces/components/WorkspacesDashboard.js | |||
@@ -1,9 +1,9 @@ | |||
1 | import React, { Component, Fragment } from 'react'; | 1 | import React, { Component } from 'react'; |
2 | import PropTypes from 'prop-types'; | 2 | import PropTypes from 'prop-types'; |
3 | import { observer, PropTypes as MobxPropTypes, inject } from 'mobx-react'; | 3 | import { observer, PropTypes as MobxPropTypes, inject } from 'mobx-react'; |
4 | import { defineMessages, intlShape } from 'react-intl'; | 4 | import { defineMessages, intlShape } from 'react-intl'; |
5 | import injectSheet from 'react-jss'; | 5 | import injectSheet from 'react-jss'; |
6 | import { Infobox, Badge } from '@meetfranz/ui'; | 6 | import { Infobox } from '@meetfranz/ui'; |
7 | 7 | ||
8 | import { mdiCheckboxMarkedCircleOutline } from '@mdi/js'; | 8 | import { mdiCheckboxMarkedCircleOutline } from '@mdi/js'; |
9 | import Loader from '../../../components/ui/Loader'; | 9 | import Loader from '../../../components/ui/Loader'; |
@@ -11,10 +11,7 @@ import WorkspaceItem from './WorkspaceItem'; | |||
11 | import CreateWorkspaceForm from './CreateWorkspaceForm'; | 11 | import CreateWorkspaceForm from './CreateWorkspaceForm'; |
12 | import Request from '../../../stores/lib/Request'; | 12 | import Request from '../../../stores/lib/Request'; |
13 | import Appear from '../../../components/ui/effects/Appear'; | 13 | import Appear from '../../../components/ui/effects/Appear'; |
14 | import { workspaceStore } from '../index'; | ||
15 | import UIStore from '../../../stores/UIStore'; | 14 | import UIStore from '../../../stores/UIStore'; |
16 | import globalMessages from '../../../i18n/globalMessages'; | ||
17 | import UpgradeButton from '../../../components/ui/UpgradeButton'; | ||
18 | 15 | ||
19 | const messages = defineMessages({ | 16 | const messages = defineMessages({ |
20 | headline: { | 17 | headline: { |
@@ -64,12 +61,6 @@ const styles = () => ({ | |||
64 | appear: { | 61 | appear: { |
65 | height: 'auto', | 62 | height: 'auto', |
66 | }, | 63 | }, |
67 | premiumAnnouncement: { | ||
68 | height: 'auto', | ||
69 | }, | ||
70 | premiumAnnouncementContainer: { | ||
71 | display: 'flex', | ||
72 | }, | ||
73 | announcementHeadline: { | 64 | announcementHeadline: { |
74 | marginBottom: 0, | 65 | marginBottom: 0, |
75 | }, | 66 | }, |
@@ -78,12 +69,6 @@ const styles = () => ({ | |||
78 | margin: [-8, 0, 0, 20], | 69 | margin: [-8, 0, 0, 20], |
79 | alignSelf: 'center', | 70 | alignSelf: 'center', |
80 | }, | 71 | }, |
81 | upgradeCTA: { | ||
82 | margin: [40, 'auto'], | ||
83 | }, | ||
84 | proRequired: { | ||
85 | margin: [10, 0, 40], | ||
86 | }, | ||
87 | }); | 72 | }); |
88 | 73 | ||
89 | @inject('stores') @injectSheet(styles) @observer | 74 | @inject('stores') @injectSheet(styles) @observer |
@@ -152,77 +137,53 @@ class WorkspacesDashboard extends Component { | |||
152 | </Appear> | 137 | </Appear> |
153 | )} | 138 | )} |
154 | 139 | ||
155 | {workspaceStore.isPremiumUpgradeRequired && ( | 140 | {/* ===== Create workspace form ===== */} |
156 | <div className={classes.premiumAnnouncement}> | 141 | <div className={classes.createForm}> |
157 | 142 | <CreateWorkspaceForm | |
158 | <h1 className={classes.announcementHeadline}>{intl.formatMessage(messages.workspaceFeatureHeadline)}</h1> | 143 | isSubmitting={createWorkspaceRequest.isExecuting} |
159 | <Badge className={classes.proRequired}>{intl.formatMessage(globalMessages.proRequired)}</Badge> | 144 | onSubmit={onCreateWorkspaceSubmit} |
160 | <div className={classes.premiumAnnouncementContainer}> | 145 | /> |
161 | <div className={classes.premiumAnnouncementContent}> | 146 | </div> |
162 | <p>{intl.formatMessage(messages.workspaceFeatureInfo)}</p> | 147 | {getUserWorkspacesRequest.isExecuting ? ( |
163 | <UpgradeButton | 148 | <Loader /> |
164 | className={classes.upgradeCTA} | 149 | ) : ( |
165 | gaEventInfo={{ category: 'Workspaces', event: 'upgrade' }} | ||
166 | short | ||
167 | requiresPro | ||
168 | /> | ||
169 | </div> | ||
170 | <img src={`https://cdn.franzinfra.com/announcements/assets/workspaces_${this.props.stores.ui.isDarkThemeActive ? 'dark' : 'light'}.png`} className={classes.teaserImage} alt="" /> | ||
171 | </div> | ||
172 | </div> | ||
173 | )} | ||
174 | |||
175 | {!workspaceStore.isPremiumUpgradeRequired && ( | ||
176 | <> | 150 | <> |
177 | {/* ===== Create workspace form ===== */} | 151 | {/* ===== Workspace could not be loaded error ===== */} |
178 | <div className={classes.createForm}> | 152 | {getUserWorkspacesRequest.error ? ( |
179 | <CreateWorkspaceForm | 153 | <Infobox |
180 | isSubmitting={createWorkspaceRequest.isExecuting} | 154 | icon="alert" |
181 | onSubmit={onCreateWorkspaceSubmit} | 155 | type="danger" |
182 | /> | 156 | ctaLabel={intl.formatMessage(messages.tryReloadWorkspaces)} |
183 | </div> | 157 | ctaLoading={getUserWorkspacesRequest.isExecuting} |
184 | {getUserWorkspacesRequest.isExecuting ? ( | 158 | ctaOnClick={getUserWorkspacesRequest.retry} |
185 | <Loader /> | 159 | > |
160 | {intl.formatMessage(messages.workspacesRequestFailed)} | ||
161 | </Infobox> | ||
186 | ) : ( | 162 | ) : ( |
187 | <> | 163 | <> |
188 | {/* ===== Workspace could not be loaded error ===== */} | 164 | {workspaces.length === 0 ? ( |
189 | {getUserWorkspacesRequest.error ? ( | 165 | <div className="align-middle settings__empty-state"> |
190 | <Infobox | 166 | {/* ===== Workspaces empty state ===== */} |
191 | icon="alert" | 167 | <p className="settings__empty-text"> |
192 | type="danger" | 168 | <span className="emoji"> |
193 | ctaLabel={intl.formatMessage(messages.tryReloadWorkspaces)} | 169 | <img src="./assets/images/emoji/sad.png" alt="" /> |
194 | ctaLoading={getUserWorkspacesRequest.isExecuting} | 170 | </span> |
195 | ctaOnClick={getUserWorkspacesRequest.retry} | 171 | {intl.formatMessage(messages.noServicesAdded)} |
196 | > | 172 | </p> |
197 | {intl.formatMessage(messages.workspacesRequestFailed)} | 173 | </div> |
198 | </Infobox> | ||
199 | ) : ( | 174 | ) : ( |
200 | <> | 175 | <table className={classes.table}> |
201 | {workspaces.length === 0 ? ( | 176 | {/* ===== Workspaces list ===== */} |
202 | <div className="align-middle settings__empty-state"> | 177 | <tbody> |
203 | {/* ===== Workspaces empty state ===== */} | 178 | {workspaces.map(workspace => ( |
204 | <p className="settings__empty-text"> | 179 | <WorkspaceItem |
205 | <span className="emoji"> | 180 | key={workspace.id} |
206 | <img src="./assets/images/emoji/sad.png" alt="" /> | 181 | workspace={workspace} |
207 | </span> | 182 | onItemClick={w => onWorkspaceClick(w)} |
208 | {intl.formatMessage(messages.noServicesAdded)} | 183 | /> |
209 | </p> | 184 | ))} |
210 | </div> | 185 | </tbody> |
211 | ) : ( | 186 | </table> |
212 | <table className={classes.table}> | ||
213 | {/* ===== Workspaces list ===== */} | ||
214 | <tbody> | ||
215 | {workspaces.map(workspace => ( | ||
216 | <WorkspaceItem | ||
217 | key={workspace.id} | ||
218 | workspace={workspace} | ||
219 | onItemClick={w => onWorkspaceClick(w)} | ||
220 | /> | ||
221 | ))} | ||
222 | </tbody> | ||
223 | </table> | ||
224 | )} | ||
225 | </> | ||
226 | )} | 187 | )} |
227 | </> | 188 | </> |
228 | )} | 189 | )} |