diff options
Diffstat (limited to 'src/components/settings/account/AccountDashboard.js')
-rw-r--r-- | src/components/settings/account/AccountDashboard.js | 81 |
1 files changed, 57 insertions, 24 deletions
diff --git a/src/components/settings/account/AccountDashboard.js b/src/components/settings/account/AccountDashboard.js index 4992f0913..06c7074dd 100644 --- a/src/components/settings/account/AccountDashboard.js +++ b/src/components/settings/account/AccountDashboard.js | |||
@@ -44,6 +44,10 @@ const messages = defineMessages({ | |||
44 | id: 'settings.account.accountType.premium', | 44 | id: 'settings.account.accountType.premium', |
45 | defaultMessage: '!!!Premium Supporter Account', | 45 | defaultMessage: '!!!Premium Supporter Account', |
46 | }, | 46 | }, |
47 | accountTypeEnterprise: { | ||
48 | id: 'settings.account.accountType.enterprise', | ||
49 | defaultMessage: '!!!Enterprise Account', | ||
50 | }, | ||
47 | accountEditButton: { | 51 | accountEditButton: { |
48 | id: 'settings.account.account.editButton', | 52 | id: 'settings.account.account.editButton', |
49 | defaultMessage: '!!!Edit Account', | 53 | defaultMessage: '!!!Edit Account', |
@@ -74,8 +78,7 @@ const messages = defineMessages({ | |||
74 | }, | 78 | }, |
75 | }); | 79 | }); |
76 | 80 | ||
77 | @observer | 81 | export default @observer class AccountDashboard extends Component { |
78 | export default class AccountDashboard extends Component { | ||
79 | static propTypes = { | 82 | static propTypes = { |
80 | user: MobxPropTypes.observableObject.isRequired, | 83 | user: MobxPropTypes.observableObject.isRequired, |
81 | orders: MobxPropTypes.arrayOrObservableArray.isRequired, | 84 | orders: MobxPropTypes.arrayOrObservableArray.isRequired, |
@@ -167,17 +170,19 @@ export default class AccountDashboard extends Component { | |||
167 | </h2> | 170 | </h2> |
168 | {user.organization && `${user.organization}, `} | 171 | {user.organization && `${user.organization}, `} |
169 | {user.email}<br /> | 172 | {user.email}<br /> |
170 | {!user.isPremium && ( | 173 | {!user.isEnterprise && !user.isPremium && ( |
171 | <span className="badge badge">{intl.formatMessage(messages.accountTypeBasic)}</span> | 174 | <span className="badge badge">{intl.formatMessage(messages.accountTypeBasic)}</span> |
172 | )} | 175 | )} |
173 | {user.isPremium && ( | 176 | {user.isPremium && ( |
174 | <span className="badge badge--premium">{intl.formatMessage(messages.accountTypePremium)}</span> | 177 | <span className="badge badge--premium">{intl.formatMessage(messages.accountTypePremium)}</span> |
175 | )} | 178 | )} |
179 | {user.isEnterprise && ( | ||
180 | <span className="badge badge--success">{intl.formatMessage(messages.accountTypeEnterprise)}</span> | ||
181 | )} | ||
176 | </div> | 182 | </div> |
177 | <Link to="/settings/user/edit" className="button"> | 183 | <Link to="/settings/user/edit" className="button"> |
178 | {intl.formatMessage(messages.accountEditButton)} | 184 | {intl.formatMessage(messages.accountEditButton)} |
179 | </Link> | 185 | </Link> |
180 | |||
181 | {user.emailValidated} | 186 | {user.emailValidated} |
182 | </div> | 187 | </div> |
183 | </div> | 188 | </div> |
@@ -230,6 +235,33 @@ export default class AccountDashboard extends Component { | |||
230 | ) | 235 | ) |
231 | )} | 236 | )} |
232 | 237 | ||
238 | {user.isEnterprise && ( | ||
239 | <div className="account"> | ||
240 | <div className="account__box"> | ||
241 | <h2>{user.company.name}</h2> | ||
242 | <p> | ||
243 | Technical contact: | ||
244 | <Link | ||
245 | className="link" | ||
246 | target="_blank" | ||
247 | to={`mailto:${user.company.contact.technical}?subject=Franz`} | ||
248 | > | ||
249 | {user.company.contact.technical} | ||
250 | </Link> | ||
251 | <br /> | ||
252 | General contact: | ||
253 | <Link | ||
254 | className="link" | ||
255 | target="_blank" | ||
256 | to={`mailto:${user.company.contact.default}?subject=Franz`} | ||
257 | > | ||
258 | {user.company.contact.default} | ||
259 | </Link> | ||
260 | </p> | ||
261 | </div> | ||
262 | </div> | ||
263 | )} | ||
264 | |||
233 | {user.isMiner && ( | 265 | {user.isMiner && ( |
234 | <div className="account franz-form"> | 266 | <div className="account franz-form"> |
235 | <div className="account__box account__box"> | 267 | <div className="account__box account__box"> |
@@ -244,7 +276,7 @@ export default class AccountDashboard extends Component { | |||
244 | </div> | 276 | </div> |
245 | )} | 277 | )} |
246 | 278 | ||
247 | {!user.isPremium && ( | 279 | {!user.isEnterprise && !user.isPremium && ( |
248 | isLoadingPlans ? ( | 280 | isLoadingPlans ? ( |
249 | <Loader /> | 281 | <Loader /> |
250 | ) : ( | 282 | ) : ( |
@@ -259,28 +291,29 @@ export default class AccountDashboard extends Component { | |||
259 | ) | 291 | ) |
260 | )} | 292 | )} |
261 | 293 | ||
262 | <div className="account franz-form"> | 294 | {!user.isEnterprise && ( |
263 | <div className="account__box"> | 295 | <div className="account franz-form"> |
264 | <h2>{intl.formatMessage(messages.headlineDangerZone)}</h2> | 296 | <div className="account__box"> |
265 | {!isDeleteAccountSuccessful && ( | 297 | <h2>{intl.formatMessage(messages.headlineDangerZone)}</h2> |
266 | <div className="account__subscription"> | 298 | {!isDeleteAccountSuccessful && ( |
267 | <p>{intl.formatMessage(messages.deleteInfo)}</p> | 299 | <div className="account__subscription"> |
268 | <Button | 300 | <p>{intl.formatMessage(messages.deleteInfo)}</p> |
269 | label={intl.formatMessage(messages.deleteAccount)} | 301 | <Button |
270 | buttonType="danger" | 302 | label={intl.formatMessage(messages.deleteAccount)} |
271 | onClick={() => deleteAccount()} | 303 | buttonType="danger" |
272 | loaded={!isLoadingDeleteAccount} | 304 | onClick={() => deleteAccount()} |
273 | /> | 305 | loaded={!isLoadingDeleteAccount} |
274 | </div> | 306 | /> |
275 | )} | 307 | </div> |
276 | {isDeleteAccountSuccessful && ( | 308 | )} |
277 | <p>{intl.formatMessage(messages.deleteEmailSent)}</p> | 309 | {isDeleteAccountSuccessful && ( |
278 | )} | 310 | <p>{intl.formatMessage(messages.deleteEmailSent)}</p> |
311 | )} | ||
312 | </div> | ||
279 | </div> | 313 | </div> |
280 | </div> | 314 | )} |
281 | </div> | 315 | </div> |
282 | )} | 316 | )} |
283 | |||
284 | </div> | 317 | </div> |
285 | <ReactTooltip place="right" type="dark" effect="solid" /> | 318 | <ReactTooltip place="right" type="dark" effect="solid" /> |
286 | </div> | 319 | </div> |