fix(profile): align activity item cards
This commit is contained in:
@@ -30,6 +30,7 @@ import {
|
||||
formatJalali,
|
||||
formatNumberPersian,
|
||||
getBlogCardImageUrl,
|
||||
getEventCardImageUrl,
|
||||
resolveErrorMessage,
|
||||
toPersianDigits,
|
||||
} from "@/lib/utils";
|
||||
@@ -405,19 +406,30 @@ export default function Profile() {
|
||||
const renderRegistrationRow = (registration: Types.MyEventRegistrationSchema) => {
|
||||
const eventData = registration.event as Types.EventListItemSchema & { start_date?: string };
|
||||
const rawDate = eventData.start_date ?? eventData.start_time;
|
||||
const eventImage = getEventCardImageUrl(eventData);
|
||||
const eventImageUrl = eventImage === "/placeholder.svg" ? eventImage : toAbsoluteUrl(eventImage, apiBaseUrl);
|
||||
|
||||
return (
|
||||
<div key={registration.id} className="rounded-2xl border border-border/70 bg-background/80 p-4">
|
||||
<div className="flex flex-col gap-3 sm:flex-row-reverse sm:items-center sm:justify-between">
|
||||
<div className="text-right">
|
||||
<p className="font-medium">{registration.event.title}</p>
|
||||
<div className="mt-1 flex flex-wrap items-center justify-end gap-2 text-xs text-muted-foreground">
|
||||
<div key={registration.id} className="rounded-2xl border border-border/70 bg-background/80 p-4 text-right">
|
||||
<div className="flex flex-row gap-4">
|
||||
<Link to={`/events/${registration.event.slug}`} className="block w-24 shrink-0 overflow-hidden rounded-2xl sm:w-28">
|
||||
<img
|
||||
src={eventImageUrl}
|
||||
alt={registration.event.title}
|
||||
className="aspect-video h-full w-full rounded-2xl object-cover"
|
||||
loading="lazy"
|
||||
/>
|
||||
</Link>
|
||||
<div className="min-w-0 flex-1">
|
||||
<Link to={`/events/${registration.event.slug}`} className="font-medium text-primary hover:underline">
|
||||
{registration.event.title}
|
||||
</Link>
|
||||
<p className="mt-2 line-clamp-2 text-sm text-muted-foreground">{registration.event.description || "بدون توضیح"}</p>
|
||||
<div className="mt-2 flex flex-wrap items-center justify-end gap-2 text-xs text-muted-foreground">
|
||||
<span>{statusLabels[registration.status] ?? registration.status}</span>
|
||||
{rawDate ? <span>• {formatJalali(rawDate)}</span> : null}
|
||||
</div>
|
||||
</div>
|
||||
<Button variant="outline" size="sm" asChild>
|
||||
<Link to={`/events/${registration.event.slug}`}>مشاهده رویداد</Link>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
@@ -430,7 +442,7 @@ export default function Profile() {
|
||||
<BlogThumbnail
|
||||
post={post}
|
||||
imageUrl={toAbsoluteUrl(getBlogCardImageUrl(post), apiBaseUrl)}
|
||||
className="aspect-square rounded-2xl"
|
||||
className="aspect-video rounded-2xl"
|
||||
/>
|
||||
</Link>
|
||||
<div className="min-w-0 flex-1">
|
||||
|
||||
Reference in New Issue
Block a user