jetzt syntax korrekt
This commit is contained in:
parent
5985a047ea
commit
7b7481187a
|
|
@ -27,12 +27,14 @@ class TeamsSettingsBlock extends Component {
|
|||
'sbp-jm-msteams.types.newPost',
|
||||
'Someone replies to a discussion I am following'
|
||||
)}
|
||||
|
||||
{this.prefSwitch(
|
||||
user,
|
||||
prefs,
|
||||
'sbp-jm-msteams.types.postMentioned',
|
||||
'Someone mentions me in a post'
|
||||
)}
|
||||
|
||||
{this.prefSwitch(
|
||||
user,
|
||||
prefs,
|
||||
|
|
@ -48,19 +50,21 @@ prefSwitch(user, prefs, key, label) {
|
|||
return (
|
||||
<Switch
|
||||
state={!!prefs[key]}
|
||||
onchange={(value) =>
|
||||
onchange={(value) => {
|
||||
user.savePreferences({
|
||||
[key]: value,
|
||||
})
|
||||
}
|
||||
});
|
||||
}}
|
||||
>
|
||||
{label}
|
||||
</Switch>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default function addTeamsSettings() {
|
||||
extend(SettingsPage.prototype, 'content', function (vnode) {
|
||||
// content ist in Flarum 1.x ein VNode mit children[]
|
||||
vnode.children.push(<TeamsSettingsBlock />);
|
||||
});
|
||||
}
|
||||
Loading…
Reference in New Issue