diff --git a/package.json b/package.json index 3e6fa7fb04..342dae38cc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Spectrum", - "version": "2.1.3", + "version": "2.1.5", "private": true, "devDependencies": { "babel-cli": "^6.24.1", diff --git a/shared/graphql/mutations/community/disableBrandedLogin.js b/shared/graphql/mutations/community/disableBrandedLogin.js index fefce07516..95ad4d70bb 100644 --- a/shared/graphql/mutations/community/disableBrandedLogin.js +++ b/shared/graphql/mutations/community/disableBrandedLogin.js @@ -9,7 +9,7 @@ export type DisableBrandedLoginType = { slug: string, brandedLogin: { isEnabled: boolean, - customMessage: ?string, + message: ?string, }, }, }, @@ -22,7 +22,7 @@ export const disableBrandedLoginMutation = gql` slug brandedLogin { isEnabled - customMessage + message } } } diff --git a/shared/graphql/mutations/community/enableBrandedLogin.js b/shared/graphql/mutations/community/enableBrandedLogin.js index e81eae7a07..52fba68c14 100644 --- a/shared/graphql/mutations/community/enableBrandedLogin.js +++ b/shared/graphql/mutations/community/enableBrandedLogin.js @@ -9,7 +9,7 @@ export type EnableBrandedLoginType = { slug: string, brandedLogin: { isEnabled: boolean, - customMessage: ?string, + message: ?string, }, }, }, @@ -22,7 +22,7 @@ export const enableBrandedLoginMutation = gql` slug brandedLogin { isEnabled - customMessage + message } } } diff --git a/src/views/communityLogin/style.js b/src/views/communityLogin/style.js index 7a9ed6a4ba..15e9217cca 100644 --- a/src/views/communityLogin/style.js +++ b/src/views/communityLogin/style.js @@ -24,7 +24,7 @@ export const Subtitle = styled.h2` margin-bottom: 16px; padding: 0 32px; text-align: center; - white-space: pre; + white-space: pre-wrap; b { font-weight: 700; diff --git a/src/views/communitySettings/components/brandedLogin.js b/src/views/communitySettings/components/brandedLogin.js index 53373f8086..ea59254299 100644 --- a/src/views/communitySettings/components/brandedLogin.js +++ b/src/views/communitySettings/components/brandedLogin.js @@ -35,12 +35,14 @@ type Props = { type State = { messageValue: ?string, messageLengthError: boolean, + isLoading: boolean, }; class BrandedLogin extends React.Component { state = { messageValue: null, messageLengthError: false, + isLoading: false, }; componentDidUpdate(prevProps) { @@ -69,17 +71,21 @@ class BrandedLogin extends React.Component { }); } + this.setState({ + isLoading: true, + }); + return this.props .saveBrandedLoginSettings({ message: messageValue, id: this.props.data.community.id, }) .then(() => { - this.setState({ messageLengthError: false }); + this.setState({ messageLengthError: false, isLoading: false }); return this.props.dispatch(addToastWithTimeout('success', 'Saved!')); }) .catch(err => { - this.setState({ messageLengthError: false }); + this.setState({ messageLengthError: false, isLoading: false }); return this.props.dispatch(addToastWithTimeout('error', err)); }); }; @@ -127,6 +133,7 @@ class BrandedLogin extends React.Component { onSubmit={this.saveCustomMessage} onClick={this.saveCustomMessage} disabled={messageLengthError} + loading={this.state.isLoading} > Save