added suspending admin email to error screen
This commit is contained in:
@@ -1,24 +1,29 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
|
||||
import CenteredContent from 'components/CenteredContent';
|
||||
import PageTitle from 'components/PageTitle';
|
||||
import AuthStore from 'stores/AuthStore';
|
||||
|
||||
const ErrorSuspended = () => (
|
||||
<CenteredContent>
|
||||
<PageTitle title="Your account has been suspended" />
|
||||
<h1>
|
||||
<span role="img" aria-label="Warning sign">
|
||||
⚠️
|
||||
</span>{' '}
|
||||
Your account has been suspended
|
||||
</h1>
|
||||
const ErrorSuspended = observer(({ auth }: { auth: AuthStore }) => {
|
||||
return (
|
||||
<CenteredContent>
|
||||
<PageTitle title="Your account has been suspended" />
|
||||
<h1>
|
||||
<span role="img" aria-label="Warning sign">
|
||||
⚠️
|
||||
</span>{' '}
|
||||
Your account has been suspended
|
||||
</h1>
|
||||
|
||||
<p>
|
||||
A team admin has suspended your account. To re-activate your account,
|
||||
please reach out to them directly.
|
||||
</p>
|
||||
</CenteredContent>
|
||||
);
|
||||
<p>
|
||||
A team admin (<strong>{auth.suspendedContactEmail}</strong>) has
|
||||
suspended your account. To re-activate your account, please reach out to
|
||||
them directly.
|
||||
</p>
|
||||
</CenteredContent>
|
||||
);
|
||||
});
|
||||
|
||||
export default ErrorSuspended;
|
||||
export default inject('auth')(ErrorSuspended);
|
||||
|
||||
@@ -15,6 +15,7 @@ class AuthStore {
|
||||
@observable oauthState: string;
|
||||
@observable isLoading: boolean = false;
|
||||
@observable isSuspended: boolean = false;
|
||||
@observable suspendedContactEmail: ?string;
|
||||
|
||||
/* Computed */
|
||||
|
||||
@@ -46,6 +47,7 @@ class AuthStore {
|
||||
} catch (err) {
|
||||
if (err.data.error === 'user_suspended') {
|
||||
this.isSuspended = true;
|
||||
this.suspendedContactEmail = err.data.adminEmail;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user