feat: add Записаться button to group cards with pre-filled Instagram DM

- BookingModal now accepts optional groupInfo for pre-filled message
- Trainer profile: each group card has Записаться button
- Schedule group view: each group card has Записаться button
- Message includes class type, trainer, days, and time

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-15 16:45:27 +03:00
parent 4f92057411
commit 6981376171
4 changed files with 37 additions and 3 deletions

View File

@@ -8,9 +8,10 @@ import { siteContent } from "@/data/content";
interface BookingModalProps {
open: boolean;
onClose: () => void;
groupInfo?: string;
}
export function BookingModal({ open, onClose }: BookingModalProps) {
export function BookingModal({ open, onClose, groupInfo }: BookingModalProps) {
const { contact } = siteContent;
const [name, setName] = useState("");
const [phone, setPhone] = useState("+375 ");
@@ -65,7 +66,8 @@ export function BookingModal({ open, onClose }: BookingModalProps) {
(e: React.FormEvent) => {
e.preventDefault();
// Build Instagram DM message with pre-filled text
const message = `Здравствуйте! Меня зовут ${name}, хочу записаться на занятие. Мой телефон: ${phone}`;
const groupText = groupInfo ? ` (${groupInfo})` : "";
const message = `Здравствуйте! Меня зовут ${name}, хочу записаться на занятие${groupText}. Мой телефон: ${phone}`;
const instagramUrl = `https://ig.me/m/blackheartdancehouse?text=${encodeURIComponent(message)}`;
window.open(instagramUrl, "_blank");
setSubmitted(true);