diff options
Diffstat (limited to 'src/components/settings/account/AccountDashboard.js')
-rw-r--r-- | src/components/settings/account/AccountDashboard.js | 86 |
1 files changed, 61 insertions, 25 deletions
diff --git a/src/components/settings/account/AccountDashboard.js b/src/components/settings/account/AccountDashboard.js index 2fcfdfc9a..ede519fd6 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', |
@@ -166,17 +170,21 @@ export default @observer class AccountDashboard extends Component { | |||
166 | </h2> | 170 | </h2> |
167 | {user.organization && `${user.organization}, `} | 171 | {user.organization && `${user.organization}, `} |
168 | {user.email}<br /> | 172 | {user.email}<br /> |
169 | {!user.isPremium && ( | 173 | {!user.isEnterprise && !user.isPremium && ( |
170 | <span className="badge badge">{intl.formatMessage(messages.accountTypeBasic)}</span> | 174 | <span className="badge badge">{intl.formatMessage(messages.accountTypeBasic)}</span> |
171 | )} | 175 | )} |
172 | {user.isPremium && ( | 176 | {user.isPremium && ( |
173 | <span className="badge badge--premium">{intl.formatMessage(messages.accountTypePremium)}</span> | 177 | <span className="badge badge--premium">{intl.formatMessage(messages.accountTypePremium)}</span> |
174 | )} | 178 | )} |
179 | {user.isEnterprise && ( | ||
180 | <span className="badge badge--success">{intl.formatMessage(messages.accountTypeEnterprise)}</span> | ||
181 | )} | ||
175 | </div> | 182 | </div> |
176 | <Link to="/settings/user/edit" className="button"> | 183 | {!user.isSSO && ( |
177 | {intl.formatMessage(messages.accountEditButton)} | 184 | <Link to="/settings/user/edit" className="button"> |
178 | </Link> | 185 | {intl.formatMessage(messages.accountEditButton)} |
179 | 186 | </Link> | |
187 | )} | ||
180 | {user.emailValidated} | 188 | {user.emailValidated} |
181 | </div> | 189 | </div> |
182 | </div> | 190 | </div> |
@@ -229,6 +237,33 @@ export default @observer class AccountDashboard extends Component { | |||
229 | ) | 237 | ) |
230 | )} | 238 | )} |
231 | 239 | ||
240 | {user.isEnterprise && ( | ||
241 | <div className="account"> | ||
242 | <div className="account__box"> | ||
243 | <h2>{user.company.name}</h2> | ||
244 | <p> | ||
245 | Technical contact: | ||
246 | <Link | ||
247 | className="link" | ||
248 | target="_blank" | ||
249 | to={`mailto:${user.company.contact.technical}?subject=Franz`} | ||
250 | > | ||
251 | {user.company.contact.technical} | ||
252 | </Link> | ||
253 | <br /> | ||
254 | General contact: | ||
255 | <Link | ||
256 | className="link" | ||
257 | target="_blank" | ||
258 | to={`mailto:${user.company.contact.default}?subject=Franz`} | ||
259 | > | ||
260 | {user.company.contact.default} | ||
261 | </Link> | ||
262 | </p> | ||
263 | </div> | ||
264 | </div> | ||
265 | )} | ||
266 | |||
232 | {user.isMiner && ( | 267 | {user.isMiner && ( |
233 | <div className="account franz-form"> | 268 | <div className="account franz-form"> |
234 | <div className="account__box account__box"> | 269 | <div className="account__box account__box"> |
@@ -243,7 +278,7 @@ export default @observer class AccountDashboard extends Component { | |||
243 | </div> | 278 | </div> |
244 | )} | 279 | )} |
245 | 280 | ||
246 | {!user.isPremium && ( | 281 | {!user.isEnterprise && !user.isPremium && ( |
247 | isLoadingPlans ? ( | 282 | isLoadingPlans ? ( |
248 | <Loader /> | 283 | <Loader /> |
249 | ) : ( | 284 | ) : ( |
@@ -258,28 +293,29 @@ export default @observer class AccountDashboard extends Component { | |||
258 | ) | 293 | ) |
259 | )} | 294 | )} |
260 | 295 | ||
261 | <div className="account franz-form"> | 296 | {!user.isEnterprise && ( |
262 | <div className="account__box"> | 297 | <div className="account franz-form"> |
263 | <h2>{intl.formatMessage(messages.headlineDangerZone)}</h2> | 298 | <div className="account__box"> |
264 | {!isDeleteAccountSuccessful && ( | 299 | <h2>{intl.formatMessage(messages.headlineDangerZone)}</h2> |
265 | <div className="account__subscription"> | 300 | {!isDeleteAccountSuccessful && ( |
266 | <p>{intl.formatMessage(messages.deleteInfo)}</p> | 301 | <div className="account__subscription"> |
267 | <Button | 302 | <p>{intl.formatMessage(messages.deleteInfo)}</p> |
268 | label={intl.formatMessage(messages.deleteAccount)} | 303 | <Button |
269 | buttonType="danger" | 304 | label={intl.formatMessage(messages.deleteAccount)} |
270 | onClick={() => deleteAccount()} | 305 | buttonType="danger" |
271 | loaded={!isLoadingDeleteAccount} | 306 | onClick={() => deleteAccount()} |
272 | /> | 307 | loaded={!isLoadingDeleteAccount} |
273 | </div> | 308 | /> |
274 | )} | 309 | </div> |
275 | {isDeleteAccountSuccessful && ( | 310 | )} |
276 | <p>{intl.formatMessage(messages.deleteEmailSent)}</p> | 311 | {isDeleteAccountSuccessful && ( |
277 | )} | 312 | <p>{intl.formatMessage(messages.deleteEmailSent)}</p> |
313 | )} | ||
314 | </div> | ||
278 | </div> | 315 | </div> |
279 | </div> | 316 | )} |
280 | </div> | 317 | </div> |
281 | )} | 318 | )} |
282 | |||
283 | </div> | 319 | </div> |
284 | <ReactTooltip place="right" type="dark" effect="solid" /> | 320 | <ReactTooltip place="right" type="dark" effect="solid" /> |
285 | </div> | 321 | </div> |