Update guest v2 branding and theming
This commit is contained in:
18
resources/js/guest-v2/lib/toast.ts
Normal file
18
resources/js/guest-v2/lib/toast.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
export type GuestToastPayload = {
|
||||
text: string;
|
||||
type?: 'success' | 'error' | 'info';
|
||||
action?: { label: string; onClick: () => void };
|
||||
durationMs?: number;
|
||||
};
|
||||
|
||||
export function pushGuestToast(detail: GuestToastPayload) {
|
||||
if (typeof window === 'undefined') {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
window.dispatchEvent(new CustomEvent('guest-toast', { detail }));
|
||||
} catch (error) {
|
||||
console.warn('Dispatching toast event failed', error);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user