mirror of
https://github.com/wassname/talk.git
synced 2026-08-20 12:50:41 +08:00
Implement apply
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user