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',
|
'sbp-jm-msteams.types.newPost',
|
||||||
'Someone replies to a discussion I am following'
|
'Someone replies to a discussion I am following'
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{this.prefSwitch(
|
{this.prefSwitch(
|
||||||
user,
|
user,
|
||||||
prefs,
|
prefs,
|
||||||
'sbp-jm-msteams.types.postMentioned',
|
'sbp-jm-msteams.types.postMentioned',
|
||||||
'Someone mentions me in a post'
|
'Someone mentions me in a post'
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{this.prefSwitch(
|
{this.prefSwitch(
|
||||||
user,
|
user,
|
||||||
prefs,
|
prefs,
|
||||||
|
|
@ -48,19 +50,21 @@ prefSwitch(user, prefs, key, label) {
|
||||||
return (
|
return (
|
||||||
<Switch
|
<Switch
|
||||||
state={!!prefs[key]}
|
state={!!prefs[key]}
|
||||||
onchange={(value) =>
|
onchange={(value) => {
|
||||||
user.savePreferences({
|
user.savePreferences({
|
||||||
[key]: value,
|
[key]: value,
|
||||||
})
|
});
|
||||||
}
|
}}
|
||||||
>
|
>
|
||||||
{label}
|
{label}
|
||||||
</Switch>
|
</Switch>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export default function addTeamsSettings() {
|
export default function addTeamsSettings() {
|
||||||
extend(SettingsPage.prototype, 'content', function (vnode) {
|
extend(SettingsPage.prototype, 'content', function (vnode) {
|
||||||
|
// content ist in Flarum 1.x ein VNode mit children[]
|
||||||
vnode.children.push(<TeamsSettingsBlock />);
|
vnode.children.push(<TeamsSettingsBlock />);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue