|
|
@ -29,7 +29,7 @@ const messages = defineMessages({
|
|
|
|
enableMentions: 'Enable Mentions',
|
|
|
|
enableMentions: 'Enable Mentions',
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const NotificationsDiscord: React.FC = () => {
|
|
|
|
const NotificationsDiscord = () => {
|
|
|
|
const intl = useIntl();
|
|
|
|
const intl = useIntl();
|
|
|
|
const settings = useSettings();
|
|
|
|
const settings = useSettings();
|
|
|
|
const { addToast, removeToast } = useToasts();
|
|
|
|
const { addToast, removeToast } = useToasts();
|
|
|
@ -168,18 +168,16 @@ const NotificationsDiscord: React.FC = () => {
|
|
|
|
<span className="label-required">*</span>
|
|
|
|
<span className="label-required">*</span>
|
|
|
|
<span className="label-tip">
|
|
|
|
<span className="label-tip">
|
|
|
|
{intl.formatMessage(messages.webhookUrlTip, {
|
|
|
|
{intl.formatMessage(messages.webhookUrlTip, {
|
|
|
|
DiscordWebhookLink: function DiscordWebhookLink(msg) {
|
|
|
|
DiscordWebhookLink: (msg: React.ReactNode) => (
|
|
|
|
return (
|
|
|
|
<a
|
|
|
|
<a
|
|
|
|
href="https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks"
|
|
|
|
href="https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks"
|
|
|
|
className="text-white transition duration-300 hover:underline"
|
|
|
|
className="text-white transition duration-300 hover:underline"
|
|
|
|
target="_blank"
|
|
|
|
target="_blank"
|
|
|
|
rel="noreferrer"
|
|
|
|
rel="noreferrer"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{msg}
|
|
|
|
{msg}
|
|
|
|
</a>
|
|
|
|
</a>
|
|
|
|
),
|
|
|
|
);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
})}
|
|
|
|
})}
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</label>
|
|
|
|
</label>
|
|
|
@ -192,9 +190,11 @@ const NotificationsDiscord: React.FC = () => {
|
|
|
|
inputMode="url"
|
|
|
|
inputMode="url"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{errors.webhookUrl && touched.webhookUrl && (
|
|
|
|
{errors.webhookUrl &&
|
|
|
|
<div className="error">{errors.webhookUrl}</div>
|
|
|
|
touched.webhookUrl &&
|
|
|
|
)}
|
|
|
|
typeof errors.webhookUrl === 'string' && (
|
|
|
|
|
|
|
|
<div className="error">{errors.webhookUrl}</div>
|
|
|
|
|
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="form-row">
|
|
|
|
<div className="form-row">
|
|
|
@ -210,9 +210,11 @@ const NotificationsDiscord: React.FC = () => {
|
|
|
|
placeholder={settings.currentSettings.applicationTitle}
|
|
|
|
placeholder={settings.currentSettings.applicationTitle}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{errors.botUsername && touched.botUsername && (
|
|
|
|
{errors.botUsername &&
|
|
|
|
<div className="error">{errors.botUsername}</div>
|
|
|
|
touched.botUsername &&
|
|
|
|
)}
|
|
|
|
typeof errors.botUsername === 'string' && (
|
|
|
|
|
|
|
|
<div className="error">{errors.botUsername}</div>
|
|
|
|
|
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="form-row">
|
|
|
|
<div className="form-row">
|
|
|
@ -228,9 +230,11 @@ const NotificationsDiscord: React.FC = () => {
|
|
|
|
inputMode="url"
|
|
|
|
inputMode="url"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{errors.botAvatarUrl && touched.botAvatarUrl && (
|
|
|
|
{errors.botAvatarUrl &&
|
|
|
|
<div className="error">{errors.botAvatarUrl}</div>
|
|
|
|
touched.botAvatarUrl &&
|
|
|
|
)}
|
|
|
|
typeof errors.botAvatarUrl === 'string' && (
|
|
|
|
|
|
|
|
<div className="error">{errors.botAvatarUrl}</div>
|
|
|
|
|
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="form-row">
|
|
|
|
<div className="form-row">
|
|
|
|