0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-18 02:21:47 -05:00

Added webmention notifications toggle in AdminX when the labs flag is enabled (#17867)

refs https://github.com/TryGhost/Product/issues/3745

---

Added a user setting for webmention notifications in the admin panel.
This allows users to opt in or out of receiving notifications when they
are mentioned by other sites using webmentions.
This commit is contained in:
Jono M 2023-08-30 10:15:30 +01:00 committed by GitHub
parent 86ad035fbb
commit cbe3070476
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,6 +13,7 @@ import SettingGroup from '../../../admin-x-ds/settings/SettingGroup';
import SettingGroupContent from '../../../admin-x-ds/settings/SettingGroupContent';
import TextField from '../../../admin-x-ds/global/form/TextField';
import Toggle from '../../../admin-x-ds/global/form/Toggle';
import useFeatureFlag from '../../../hooks/useFeatureFlag';
import useRouting from '../../../hooks/useRouting';
import useStaffUsers from '../../../hooks/useStaffUsers';
import validator from 'validator';
@ -213,6 +214,8 @@ const Details: React.FC<UserDetailProps> = ({errors, validators, user, setUserDa
};
const EmailNotificationsInputs: React.FC<UserDetailProps> = ({user, setUserData}) => {
const hasWebmentions = useFeatureFlag('webmentions');
return (
<SettingGroupContent>
<Toggle
@ -224,6 +227,15 @@ const EmailNotificationsInputs: React.FC<UserDetailProps> = ({user, setUserData}
setUserData?.({...user, comment_notifications: e.target.checked});
}}
/>
{hasWebmentions && <Toggle
checked={user.mention_notifications}
direction='rtl'
hint='Every time another site links to your work'
label='Mentions'
onChange={(e) => {
setUserData?.({...user, mention_notifications: e.target.checked});
}}
/>}
<Toggle
checked={user.free_member_signup_notification}
direction='rtl'