Skip to content
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.

Commit

Permalink
Merge pull request #2562 from withspectrum/2.1.5
Browse files Browse the repository at this point in the history
2.1.5
  • Loading branch information
brianlovin authored Mar 13, 2018
2 parents aba3d7f + ffb3bd8 commit 71bf8d1
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Spectrum",
"version": "2.1.3",
"version": "2.1.5",
"private": true,
"devDependencies": {
"babel-cli": "^6.24.1",
Expand Down
4 changes: 2 additions & 2 deletions shared/graphql/mutations/community/disableBrandedLogin.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export type DisableBrandedLoginType = {
slug: string,
brandedLogin: {
isEnabled: boolean,
customMessage: ?string,
message: ?string,
},
},
},
Expand All @@ -22,7 +22,7 @@ export const disableBrandedLoginMutation = gql`
slug
brandedLogin {
isEnabled
customMessage
message
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions shared/graphql/mutations/community/enableBrandedLogin.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export type EnableBrandedLoginType = {
slug: string,
brandedLogin: {
isEnabled: boolean,
customMessage: ?string,
message: ?string,
},
},
},
Expand All @@ -22,7 +22,7 @@ export const enableBrandedLoginMutation = gql`
slug
brandedLogin {
isEnabled
customMessage
message
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/communityLogin/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 9 additions & 2 deletions src/views/communitySettings/components/brandedLogin.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ type Props = {
type State = {
messageValue: ?string,
messageLengthError: boolean,
isLoading: boolean,
};

class BrandedLogin extends React.Component<Props, State> {
state = {
messageValue: null,
messageLengthError: false,
isLoading: false,
};

componentDidUpdate(prevProps) {
Expand Down Expand Up @@ -69,17 +71,21 @@ class BrandedLogin extends React.Component<Props, State> {
});
}

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));
});
};
Expand Down Expand Up @@ -127,6 +133,7 @@ class BrandedLogin extends React.Component<Props, State> {
onSubmit={this.saveCustomMessage}
onClick={this.saveCustomMessage}
disabled={messageLengthError}
loading={this.state.isLoading}
>
Save
</Button>
Expand Down

0 comments on commit 71bf8d1

Please sign in to comment.