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