Files
backspace/packages/web/src/components/ui/ToastContainer.tsx
T
Jannis Braun dca9c4dc83 feat: stateless federated identity resolver + federation UX improvements
Add identity.ts with isSelf() and resolveDisplayIdentity() — pure
stateless functions that detect replicated-self using the immutable
(username, homeInstance) composite key. No store lookups, no data
mutation. Fixes wrong avatar gradient and missing edit/delete on
own messages in remote channels.

Also includes: optimistic message dedup fix for cross-instance
messages (content-only matching), federation toast notifications,
Username component with @domain display, invite parser, and
deploy script simplification.
2026-03-04 03:37:49 +01:00

30 lines
926 B
TypeScript

import React from 'react';
import { useUIStore } from '../../stores/uiStore';
const borderColors = {
info: 'border-l-accent-sky',
warning: 'border-l-accent-amber',
success: 'border-l-accent-mint',
} as const;
export function ToastContainer() {
const toasts = useUIStore((s) => s.toasts);
const removeToast = useUIStore((s) => s.removeToast);
if (toasts.length === 0) return null;
return (
<div className="fixed bottom-6 right-6 z-[300] flex flex-col gap-2 pointer-events-none">
{toasts.map((toast) => (
<div
key={toast.id}
className={`glass-pill border-l-2 ${borderColors[toast.type]} rounded-[10px] px-4 py-2.5 max-w-[320px] animate-slide-up pointer-events-auto cursor-pointer`}
onClick={() => removeToast(toast.id)}
>
<span className="text-sm text-txt-primary leading-snug">{toast.message}</span>
</div>
))}
</div>
);
}