This commit is contained in:
PxlLoewe
2025-03-11 20:08:11 -07:00
4 changed files with 12 additions and 13 deletions

View File

@@ -1,3 +1,5 @@
NEXTAUTH_SECRET=
NEXT_PUBLIC_PUBLIC_URL=
NEXT_PUBLIC_HUB_URL= NEXT_PUBLIC_HUB_URL=
NEXT_PUBLIC_SERVICE_ID= NEXT_PUBLIC_SERVICE_ID=
NEXTAUTH_SECRET= NEXTAUTH_SECRET=

View File

@@ -48,7 +48,7 @@ export const KursItem = ({
/> />
</div> </div>
</div> </div>
<div className="col-span-2"> <div className="flex col-span-2 justify-end">
{event.finishedBadges.map((b) => { {event.finishedBadges.map((b) => {
return <Badge name={b} key={b} />; return <Badge name={b} key={b} />;
})} })}

View File

@@ -94,22 +94,21 @@ const ModalBtn = ({
date.id === selectAppointmentForm.watch("eventAppointmentId") || date.id === selectAppointmentForm.watch("eventAppointmentId") ||
selectedAppointment?.id, selectedAppointment?.id,
); );
const ownIndexInParticipantList = const ownIndexInParticipantList = (
(selectedDate as any)?.Participants?.findIndex( selectedDate as any
(p: Participant) => p.userId === user.id, )?.Participants?.findIndex((p: Participant) => p.userId === user.id);
) || (selectedDate as any)?.Participants?.length + 1;
const ownPlaceInParticipantList = const ownPlaceInParticipantList =
ownIndexInParticipantList === -1 ownIndexInParticipantList === -1
? (selectedDate as any)?.Participants?.length + 1 ? (selectedDate as any)?.Participants?.length + 1
: ownIndexInParticipantList + 1; : ownIndexInParticipantList + 1;
console.log( console.log({
selectedDate, selectedDate,
ownPlaceInParticipantList > event.maxParticipants!,
ownPlaceInParticipantList, ownPlaceInParticipantList,
event.maxParticipants, ownIndexInParticipantList,
); maxParticipants: event.maxParticipants,
});
return ( return (
<> <>

View File

@@ -28,9 +28,7 @@ export const Badge = ({
const image = BadgeImage[name]; const image = BadgeImage[name];
return ( return (
<span <span className={cn("flex h-fit p-1", className)}>
className={cn("badge badge-secondary badge-outline h-fit p-1", className)}
>
<img src={image.src} alt={name} width={100} /> <img src={image.src} alt={name} width={100} />
</span> </span>
); );