added frame on posts

This commit is contained in:
SlimusMinus
2026-06-30 00:26:41 +03:00
parent 3b1f475c0f
commit b3bf41216c
2 changed files with 60 additions and 2 deletions

View File

@@ -34,8 +34,26 @@ export default function PostOnFeed({ ad, liked, onLike, onEdit, onDelete, onMark
// Проверяем, закрыт ли пост (вещь найдена)
const isClosed = ad.status === 'CLOSED';
const roleClass = ad.userRole === 'LOST_AND_FOUND' ? 'f-card-role-lost-found'
: ad.userRole === 'METRO' ? 'f-card-role-metro' : '';
const roleBadge = ad.userRole === 'LOST_AND_FOUND' ? (
<div className="f-role-badge f-role-lost-found" title="Бюро находок">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
<circle cx="12" cy="12" r="10"/>
<path d="M12 6v6l4 2"/>
</svg>
Бюро находок
</div>
) : ad.userRole === 'METRO' ? (
<div className="f-role-badge f-role-metro" title="Метрополитен">
<span className="f-role-metro-letter">М</span>
Метрополитен
</div>
) : null;
return (
<div className={`f-card${isClosed ? ' f-card-closed' : ''}`}>
<div className={`f-card${isClosed ? ' f-card-closed' : ''}${roleClass ? ' ' + roleClass : ''}`}>
<div className="f-card-inner">
<div className="f-card-img">
{imageUrl
@@ -49,6 +67,7 @@ export default function PostOnFeed({ ad, liked, onLike, onEdit, onDelete, onMark
<div className={`f-type-badge ${ad.type === "loss" ? "f-type-loss" : "f-type-found"}`}>
{ad.type === "loss" ? "Потеря" : "Находка"}
</div>
{roleBadge}
{isClosed && <div className="f-status-badge f-status-closed">✓ Найдено</div>}
</div>
<div className="f-card-title">{ad.title}</div>