mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Added notification to user invitations
refs. https://github.com/TryGhost/Team/issues/3351
This commit is contained in:
parent
9aef897936
commit
ae6a2ba0cc
2 changed files with 12 additions and 4 deletions
|
@ -26,7 +26,7 @@ const Toast: React.FC<ToastProps> = ({
|
|||
children,
|
||||
props
|
||||
}) => {
|
||||
let classNames = `flex w-[300px] items-start justify-between rounded py-3 px-4 text-sm font-medium text-white gap-6`;
|
||||
let classNames = `flex w-[300px] items-start justify-between rounded py-3 px-4 text-sm font-medium text-white gap-6 z-[90] `;
|
||||
|
||||
if (t.visible) {
|
||||
classNames += ' animate-toaster-in';
|
||||
|
|
|
@ -6,7 +6,7 @@ import useRoles from '../../../../hooks/useRoles';
|
|||
import useStaffUsers from '../../../../hooks/useStaffUsers';
|
||||
import validator from 'validator';
|
||||
import {ServicesContext} from '../../../providers/ServiceProvider';
|
||||
import {toast} from 'react-hot-toast';
|
||||
import {showToast} from '../../../../admin-x-ds/global/Toast';
|
||||
import {useContext, useEffect, useRef, useState} from 'react';
|
||||
|
||||
type RoleType = 'administrator' | 'editor' | 'author' | 'contributor';
|
||||
|
@ -44,7 +44,7 @@ const InviteUserModal = NiceModal.create(() => {
|
|||
} else if (saveState === 'saved') {
|
||||
okLabel = 'Invite sent!';
|
||||
} else if (saveState === 'error') {
|
||||
okLabel = 'Failed to send. Retry?';
|
||||
okLabel = 'Retry';
|
||||
}
|
||||
|
||||
const handleSendInvitation = async () => {
|
||||
|
@ -70,9 +70,17 @@ const InviteUserModal = NiceModal.create(() => {
|
|||
|
||||
setSaveState('saved');
|
||||
|
||||
toast.success('Invitation sent!');
|
||||
showToast({
|
||||
message: `Invitation successfully sent to ${email}`,
|
||||
type: 'success'
|
||||
});
|
||||
} catch (e: any) {
|
||||
setSaveState('error');
|
||||
|
||||
showToast({
|
||||
message: `Failed to send invitation to ${email}`,
|
||||
type: 'error'
|
||||
});
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue