fix: highlight open event registration action
This commit is contained in:
@@ -7,7 +7,6 @@ import { Link } from "@/lib/router";
|
|||||||
import type { EventListItemSchema } from "@/lib/types";
|
import type { EventListItemSchema } from "@/lib/types";
|
||||||
import { formatJalali, formatNumberPersian, formatToman, getEventCardImageUrl } from "@/lib/utils";
|
import { formatJalali, formatNumberPersian, formatToman, getEventCardImageUrl } from "@/lib/utils";
|
||||||
import {
|
import {
|
||||||
getEventCardState,
|
|
||||||
getEventBrowseLabel,
|
getEventBrowseLabel,
|
||||||
getEventRegistrationMessage,
|
getEventRegistrationMessage,
|
||||||
getEventRegistrationState,
|
getEventRegistrationState,
|
||||||
@@ -20,8 +19,6 @@ export function EventCard({ event, now }: { event: EventListItemSchema; now: num
|
|||||||
const registration = getEventRegistrationState(event, now);
|
const registration = getEventRegistrationState(event, now);
|
||||||
const registrationText = getEventRegistrationMessage(event, now);
|
const registrationText = getEventRegistrationMessage(event, now);
|
||||||
const canRegister = registration.state === "open";
|
const canRegister = registration.state === "open";
|
||||||
const isPast = getEventCardState(event, now) === "past";
|
|
||||||
const isComingSoon = statusLabel === "بهزودی";
|
|
||||||
const imageEffect = canRegister
|
const imageEffect = canRegister
|
||||||
? ""
|
? ""
|
||||||
: "scale-[1.02] blur-sm group-hover:scale-100 group-hover:blur-none group-active:scale-100 group-active:blur-none group-focus-visible:scale-100 group-focus-visible:blur-none";
|
: "scale-[1.02] blur-sm group-hover:scale-100 group-hover:blur-none group-active:scale-100 group-active:blur-none group-focus-visible:scale-100 group-focus-visible:blur-none";
|
||||||
@@ -87,7 +84,7 @@ export function EventCard({ event, now }: { event: EventListItemSchema; now: num
|
|||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
<div className="mt-auto pt-5">
|
<div className="mt-auto pt-5">
|
||||||
<span className={`inline-flex min-h-10 w-full items-center justify-center gap-2 rounded-md px-3 py-2 text-center text-xs font-semibold transition-colors md:min-h-11 md:text-sm ${isPast || isComingSoon ? "bg-muted text-muted-foreground group-hover:bg-muted/80 dark:bg-primary/15 dark:text-primary dark:group-hover:bg-primary/20" : "bg-primary text-primary-foreground group-hover:bg-primary/90"}`}>
|
<span className={`inline-flex min-h-10 w-full items-center justify-center gap-2 rounded-md px-3 py-2 text-center text-xs font-semibold transition-colors md:min-h-11 md:text-sm ${canRegister ? "bg-primary text-primary-foreground group-hover:bg-primary/90" : "bg-muted text-muted-foreground group-hover:bg-muted/80 dark:bg-primary/15 dark:text-primary dark:group-hover:bg-primary/20"}`}>
|
||||||
{canRegister ? "ثبتنام در رویداد" : "مشاهده جزئیات رویداد"}
|
{canRegister ? "ثبتنام در رویداد" : "مشاهده جزئیات رویداد"}
|
||||||
<ArrowLeft aria-hidden="true" className="size-4 shrink-0 transition-transform group-hover:-translate-x-0.5" />
|
<ArrowLeft aria-hidden="true" className="size-4 shrink-0 transition-transform group-hover:-translate-x-0.5" />
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user