jetzt syntax korrekt

This commit is contained in:
JM 2026-05-06 11:43:21 +02:00
parent 5985a047ea
commit 7b7481187a
1 changed files with 17 additions and 13 deletions

View File

@ -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,
@ -44,23 +46,25 @@ class TeamsSettingsBlock extends Component {
);
}
prefSwitch(user, prefs, key, label) {
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 />);
});
}