diff --git a/src/app/admin/open-day/page.tsx b/src/app/admin/open-day/page.tsx index cdeaf88..9e99d9d 100644 --- a/src/app/admin/open-day/page.tsx +++ b/src/app/admin/open-day/page.tsx @@ -2,7 +2,7 @@ import { useState, useEffect, useMemo, useCallback } from "react"; import { - Plus, X, Loader2, Calendar, Trash2, Ban, CheckCircle2, RotateCcw, + Plus, X, Loader2, Calendar, Trash2, Ban, CheckCircle2, RotateCcw, Sparkles, } from "lucide-react"; import { adminFetch } from "@/lib/csrf"; import { ParticipantLimits } from "../_components/FormField"; @@ -100,34 +100,55 @@ function EventSettings({ /> -
-
- - onChange({ pricePerClass: parseInt(e.target.value) || 0 })} - className="w-full rounded-lg border border-white/10 bg-neutral-800 px-4 py-2.5 text-white outline-none focus:border-gold transition-colors" - /> -
-
- - onChange({ discountPrice: parseInt(e.target.value) || 0 })} - className="w-full rounded-lg border border-white/10 bg-neutral-800 px-4 py-2.5 text-white outline-none focus:border-gold transition-colors" - /> -
-
- - onChange({ discountThreshold: parseInt(e.target.value) || 1 })} - className="w-full rounded-lg border border-white/10 bg-neutral-800 px-4 py-2.5 text-white outline-none focus:border-gold transition-colors" - /> -
+
+ + onChange({ pricePerClass: parseInt(e.target.value) || 0 })} + className="w-full rounded-lg border border-white/10 bg-neutral-800 px-4 py-2.5 text-white outline-none focus:border-gold transition-colors sm:max-w-xs" + /> +
+ + {/* Discount toggle + fields */} +
+ + {event.discountPrice > 0 && ( +
+
+ + onChange({ discountPrice: parseInt(e.target.value) || 0 })} + className="w-full rounded-lg border border-white/10 bg-neutral-800 px-4 py-2.5 text-white outline-none focus:border-gold transition-colors" + /> +
+
+ + onChange({ discountThreshold: parseInt(e.target.value) || 1 })} + className="w-full rounded-lg border border-white/10 bg-neutral-800 px-4 py-2.5 text-white outline-none focus:border-gold transition-colors" + /> +
+
+ )}
- {event.pricePerClass} BYN / занятие, от {event.discountThreshold} — {event.discountPrice} BYN + {event.pricePerClass} BYN / занятие{event.discountPrice > 0 && event.discountThreshold > 0 && `, от ${event.discountThreshold} — ${event.discountPrice} BYN`}
diff --git a/src/components/sections/OpenDay.tsx b/src/components/sections/OpenDay.tsx index 5094044..bcf2d32 100644 --- a/src/components/sections/OpenDay.tsx +++ b/src/components/sections/OpenDay.tsx @@ -67,10 +67,12 @@ export function OpenDay({ data }: OpenDayProps) {

{event.pricePerClass} BYN за занятие

-

- - От {event.discountThreshold} занятий — {event.discountPrice} BYN за каждое! -

+ {event.discountPrice > 0 && event.discountThreshold > 0 && ( +

+ + От {event.discountThreshold} занятий — {event.discountPrice} BYN за каждое! +

+ )} diff --git a/src/components/ui/SignupModal.tsx b/src/components/ui/SignupModal.tsx index 190ab9b..13fac9a 100644 --- a/src/components/ui/SignupModal.tsx +++ b/src/components/ui/SignupModal.tsx @@ -178,13 +178,6 @@ export function SignupModal({ {successMessage || "Вы записаны!"} {subtitle &&

{subtitle}

} - {successData?.totalBookings !== undefined && ( -

- Вы записаны на {String(successData.totalBookings)} занятий. -
- Стоимость: {String(successData.pricePerClass)} BYN за занятие -

- )} )}