MCPcopy Create free account
hub / github.com/Roy3838/Observer / TutorialDoneModal

Function TutorialDoneModal

app/src/components/TutorialDoneModal.tsx:15–72  ·  view source on GitHub ↗
({ isOpen, onClose })

Source from the content-addressed store, hash-verified

13}
14
15export const TutorialDoneModal: React.FC<TutorialDoneModalProps> = ({ isOpen, onClose }) => {
16 useEffect(() => {
17 if (!isOpen) return;
18 const onKey = (e: KeyboardEvent) => { if (e.key === 'Escape') onClose(); };
19 window.addEventListener('keydown', onKey);
20 return () => window.removeEventListener('keydown', onKey);
21 }, [isOpen, onClose]);
22
23 if (!isOpen) return null;
24
25 return ReactDOM.createPortal(
26 <div
27 className="fixed inset-0 z-[10000] flex items-end sm:items-center justify-center bg-zinc-950/30 backdrop-blur-[2px] animate-sheet-fade"
28 onMouseDown={e => { if (e.target === e.currentTarget) onClose(); }}
29 >
30 <div
31 role="dialog"
32 aria-modal="true"
33 aria-label="Notification sent"
34 className="relative w-full sm:max-w-md sm:mx-4 max-h-[92vh] overflow-y-auto rounded-t-[28px] sm:rounded-[28px] bg-white dark:bg-zinc-900 text-zinc-900 dark:text-zinc-100 shadow-[0_24px_80px_-16px_rgba(0,0,0,0.35)] ring-1 ring-black/5 dark:ring-white/10 animate-sheet-in"
35 onMouseDown={e => e.stopPropagation()}
36 >
37 <div className="flex items-center justify-end px-5 pt-5">
38 <button
39 onClick={onClose}
40 aria-label="Close"
41 className="flex items-center justify-center h-8 w-8 rounded-full text-zinc-400 hover:text-zinc-700 hover:bg-zinc-100 dark:hover:text-zinc-200 dark:hover:bg-zinc-800 transition-colors"
42 >
43 <X className="h-4 w-4" />
44 </button>
45 </div>
46
47 <div className="px-7 pb-7 -mt-2 flex flex-col items-center text-center">
48 {/* Drawn check, same as the "connected" state in the ask_user_info sheets */}
49 <svg viewBox="0 0 52 52" className="h-14 w-14">
50 <circle cx="26" cy="26" r="24" className="fill-emerald-500/10 stroke-emerald-500" strokeWidth="2" />
51 <path d="M15 27 l7 7 l15 -16" fill="none" strokeWidth="3.5" strokeLinecap="round" strokeLinejoin="round"
52 className="stroke-emerald-500 animate-check-draw" style={{ strokeDasharray: 40, strokeDashoffset: 40 }} />
53 </svg>
54
55 <h2 className="mt-4 text-[19px] font-semibold tracking-tight">Notification sent</h2>
56 <p className="mt-3 text-sm font-medium text-zinc-900 dark:text-zinc-100">Welcome to Observer</p>
57 <p className="mt-1 text-sm leading-relaxed text-zinc-500 dark:text-zinc-400 max-w-xs">
58 Hope it gives you back a little time every day :)
59 </p>
60
61 <button
62 onClick={onClose}
63 className="mt-6 w-full inline-flex items-center justify-center gap-2 h-11 rounded-full bg-zinc-900 text-white dark:bg-white dark:text-zinc-900 text-sm font-medium hover:bg-zinc-800 dark:hover:bg-zinc-200 active:scale-[0.99] transition-all"
64 >
65 Start exploring <ArrowRight className="h-4 w-4" />
66 </button>
67 </div>
68 </div>
69 </div>,
70 document.getElementById('modal-root') ?? document.body,
71 );
72};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected