diff --git a/client/src/app/layout/AppHeader.tsx b/client/src/app/layout/AppHeader.tsx index de9ffc8..48ce77b 100644 --- a/client/src/app/layout/AppHeader.tsx +++ b/client/src/app/layout/AppHeader.tsx @@ -171,6 +171,7 @@ export function AppHeader() { const user = useUnit($user) const navigate = useNavigate() const isAdmin = Boolean(user?.isAdmin) + const headerNavItems = isAdmin ? [...navItems, { label: 'Админка', to: '/admin' }] : navItems const cartQuery = useQuery({ queryKey: ['me', 'cart'], @@ -256,7 +257,7 @@ export function AppHeader() { {!isMobile && - navItems.map((i) => ( + headerNavItems.map((i) => ( @@ -292,36 +293,46 @@ export function AppHeader() { )} - - - - - + {!isAdmin && ( + <> + + + + + - - {user ? ( - <> - go('/me')}> - - - Выход - - ) : ( - go('/auth')}>Войти / регистрация - )} - + + {user ? ( + <> + go('/me')}> + + + Выход + + ) : ( + go('/auth')}>Войти / регистрация + )} + + + )} + + {isAdmin && user && !isMobile && ( + + )} {!isMobile && ( - {navItems.map((i) => ( + {headerNavItems.map((i) => ( @@ -364,9 +375,16 @@ export function AppHeader() { Заказы )} - + {!isAdmin && ( + + )} + {!user && isAdmin && ( + + )} {user && ( diff --git a/client/src/pages/me/ui/sections/OrderDetailPage.tsx b/client/src/pages/me/ui/sections/OrderDetailPage.tsx index c4aaf97..5f5c3a0 100644 --- a/client/src/pages/me/ui/sections/OrderDetailPage.tsx +++ b/client/src/pages/me/ui/sections/OrderDetailPage.tsx @@ -24,6 +24,7 @@ import { postProductReview, uploadReviewImage } from '@/entities/product/api/rev import { markOrderMessagesRead } from '@/entities/user/api/messages-api' import { formatPriceRub } from '@/shared/lib/format-price' import { orderStatusLabelRu } from '@/shared/lib/order-status-labels' +import { RichTextMessageContent } from '@/shared/ui/RichTextMessageContent' import { RichTextMessageEditor } from '@/shared/ui/RichTextMessageEditor' function reviewSubmitErrorMessage(err: unknown): string { @@ -95,6 +96,7 @@ export function OrderDetailPage() { }) const order = orderQuery.data?.item + const canSendMessage = text.replace(/<[^>]*>/g, ' ').trim().length > 0 const eligibilityQuery = useQuery({ queryKey: ['me', 'orders', id, 'review-eligibility'], @@ -322,12 +324,15 @@ export function OrderDetailPage() { bgcolor: m.authorType === 'admin' ? 'grey.100' : 'primary.50', border: 1, borderColor: 'divider', + alignSelf: m.authorType === 'admin' ? 'flex-start' : 'flex-end', + width: 'fit-content', + maxWidth: '85%', }} > {m.authorType === 'admin' ? 'Админ' : 'Вы'} · {new Date(m.createdAt).toLocaleString()} - {m.text} + ))} {order.messages.length === 0 && Пока сообщений нет.} @@ -340,7 +345,7 @@ export function OrderDetailPage() {