mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Improving help text margins Updating changes for get link and create post files Fixing icon for select team screen Fixing styles for select team button Adding improvements to posts UI Adding improvement to post layout Updating changes for post controls Updating z-index for sidebar--right Updating help text position Fixing code for posts Fixing css for post view Pushing improvements for posts view Updating changes for post view Updating post layout Fixing system time css Updating header for system posts Updating post css Removing opacity and changing color for system messages Simplifying root post and system post behaviour Removing images from compact view Updating help text for display Updating embed preview text for advanced option PLT-3490 - Fixing RHS issue on Edge
62 lines
1.5 KiB
JavaScript
62 lines
1.5 KiB
JavaScript
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
|
|
// See License.txt for license information.
|
|
|
|
import React from 'react';
|
|
|
|
import {FormattedMessage} from 'react-intl';
|
|
|
|
export default class SaveButton extends React.Component {
|
|
static get propTypes() {
|
|
return {
|
|
saving: React.PropTypes.bool.isRequired,
|
|
disabled: React.PropTypes.bool
|
|
};
|
|
}
|
|
|
|
static get defaultProps() {
|
|
return {
|
|
disabled: false
|
|
};
|
|
}
|
|
|
|
render() {
|
|
const {saving, disabled, ...props} = this.props; // eslint-disable-line no-use-before-define
|
|
|
|
let contents;
|
|
if (saving) {
|
|
contents = (
|
|
<span>
|
|
<span className='icon fa fa-refresh icon--rotate'/>
|
|
<FormattedMessage
|
|
id='admin.saving'
|
|
defaultMessage='Saving Config...'
|
|
/>
|
|
</span>
|
|
);
|
|
} else {
|
|
contents = (
|
|
<FormattedMessage
|
|
id='admin.save'
|
|
defaultMessage='Save'
|
|
/>
|
|
);
|
|
}
|
|
|
|
let className = 'save-button btn';
|
|
if (!disabled) {
|
|
className += ' btn-primary';
|
|
}
|
|
|
|
return (
|
|
<button
|
|
type='submit'
|
|
className={className}
|
|
disabled={disabled}
|
|
{...props}
|
|
>
|
|
{contents}
|
|
</button>
|
|
);
|
|
}
|
|
}
|