Implement apply

This commit is contained in:
Chi Vinh Le
2017-11-20 19:20:09 +01:00
parent 67f3f8cdef
commit 873d1915c3
2 changed files with 12 additions and 4 deletions
@@ -22,8 +22,9 @@ class Settings extends React.Component {
onToggleQuestionBox,
onQuestionBoxIconChange,
onQuestionBoxContentChange,
canSave,
onApply,
} = this.props;
const changed = false;
return (
<div className={styles.wrapper}>
<div className={styles.container}>
@@ -31,8 +32,9 @@ class Settings extends React.Component {
<Button
type="submit"
className={cn(styles.apply, 'talk-embed-stream-configuration-submit-button')}
checked={changed}
cStyle={changed ? 'green' : 'darkGrey'}
checked={canSave}
cStyle={canSave ? 'green' : 'darkGrey'}
onClick={onApply}
>
{t('configure.apply')}
</Button>
@@ -77,9 +79,13 @@ class Settings extends React.Component {
Settings.propTypes = {
settings: PropTypes.object.isRequired,
canSave: PropTypes.bool.isRequired,
onToggleModeration: PropTypes.func.isRequired,
onTogglePremodLinks: PropTypes.func.isRequired,
onToggleQuestionBox: PropTypes.func.isRequired,
onQuestionBoxContentChange: PropTypes.func.isRequired,
onQuestionBoxIconChange: PropTypes.func.isRequired,
onApply: PropTypes.func.isRequired,
};
export default Settings;
@@ -56,7 +56,8 @@ class SettingsContainer extends React.Component {
onToggleQuestionBox={this.toggleQuestionBox}
onQuestionBoxIconChange={this.setQuestionBoxIcon}
onQuestionBoxContentChange={this.setQuestionBoxContent}
onApply={this.savePending}
canSave={this.props.canSave}
/>;
}
}
@@ -69,6 +70,7 @@ SettingsContainer.propTypes = {
clearPending: PropTypes.func.isRequired,
notify: PropTypes.func.isRequired,
updatePending: PropTypes.func.isRequired,
canSave: PropTypes.bool.isRequired,
};
const withSettingsFragments = withFragments({