diff --git a/apps/widget-telegram/src/App.tsx b/apps/widget-telegram/src/App.tsx index 66c87658..d7a21188 100644 --- a/apps/widget-telegram/src/App.tsx +++ b/apps/widget-telegram/src/App.tsx @@ -488,6 +488,95 @@ const PasswordForm = ({ state, t, dispatch, send, sendCancel }: FormProps) => { ); }; +// -------------------------------------------------------------------------- +// About card + modal +// -------------------------------------------------------------------------- + +type AboutCardProps = { + t: T; + onOpen: () => void; +}; + +// Click-target sibling of the login/logout cards. Lives in the widget +// (not in the host hero) so it sits visually adjacent to the action it +// explains — a user evaluating «should I sign in?» reads the about copy +// next to the button itself, not in a separate header chrome. +const AboutCard = ({ t, onOpen }: AboutCardProps) => ( + +); + +type AboutModalProps = { + t: T; + onClose: () => void; +}; + +const AboutModal = ({ t, onClose }: AboutModalProps) => { + // ESC closes — matches the standard «modal as transient overlay» pattern + // and keeps a fast escape hatch for keyboard users without focus-trap + // machinery (the widget is a small surface; trap-style focus management + // would be heavier than the panel deserves). + useEffect(() => { + const onKey = (e: KeyboardEvent) => { + if (e.key === 'Escape') onClose(); + }; + window.addEventListener('keydown', onKey); + return () => window.removeEventListener('keydown', onKey); + }, [onClose]); + + return ( +
+ ); +}; + // -------------------------------------------------------------------------- // Logout card with confirm-in-place // -------------------------------------------------------------------------- @@ -571,6 +660,14 @@ export function App({ bootstrap, api }: Props) { const [theme, setTheme] = useState<'light' | 'dark'>(bootstrap.theme); const [transcript, setTranscript] = useState{t('auth-card.code.privacy-hint-history')}
{description}
: null} + {descriptionShort ?{descriptionShort}
: null}