diff --git a/web-react/src/components/ArticleModal.jsx b/web-react/src/components/ArticleModal.jsx index 426f69b..483309d 100644 --- a/web-react/src/components/ArticleModal.jsx +++ b/web-react/src/components/ArticleModal.jsx @@ -6,11 +6,9 @@ function fmt(iso) { } export default function ArticleModal({ article, onClose }) { - // Закрытие по Escape useEffect(() => { const handler = e => { if (e.key === 'Escape') onClose() } window.addEventListener('keydown', handler) - // Блокируем скролл страницы под модалкой document.body.style.overflow = 'hidden' return () => { window.removeEventListener('keydown', handler) @@ -18,6 +16,8 @@ export default function ArticleModal({ article, onClose }) { } }, [onClose]) + const isFullHtml = /^\s*
e.stopPropagation()}> @@ -27,42 +27,67 @@ export default function ArticleModal({ article, onClose }) { {article.title} )} -
-
- {article.category && ( - {article.category.name} + {isFullHtml ? ( + <> +
+
+ {article.category && ( + {article.category.name} + )} + {article.published_at && {fmt(article.published_at)}} +
+

{article.title}

+
+