Skip to content

Instantly share code, notes, and snippets.

@ixtk
Created December 19, 2025 09:02
Show Gist options
  • Select an option

  • Save ixtk/7c892fe4d82fea2064157e491148e20f to your computer and use it in GitHub Desktop.

Select an option

Save ixtk/7c892fe4d82fea2064157e491148e20f to your computer and use it in GitHub Desktop.

1. გამოიყენეთ განახლებული roomData

const roomData = {
  single: {
    img: 'https://hebbkx1anhila5yf.public.blob.vercel-storage.com/attachments/gen-images/public/cozy-single-hotel-room-with-one-bed-VyEDvoNKhePzyx3AyLwkJoAf0CXS6Y.jpg',
    price: 99,
    title: 'Single Room',
    description: 'Perfect for solo travelers seeking comfort',
  },
  double: {
    img: 'https://hebbkx1anhila5yf.public.blob.vercel-storage.com/attachments/gen-images/public/spacious-double-hotel-room-with-two-beds-j7Lm2FrYp3Vy1Ew24VWcliMCpGSIf2.jpg',
    price: 149,
    title: 'Double Room',
    description: 'Ideal for couples or friends traveling together',
  },
  exclusive: {
    img: 'https://hebbkx1anhila5yf.public.blob.vercel-storage.com/attachments/gen-images/public/luxury-hotel-suite-with-living-area-8oKPEAm2qkHmY8YlVlovfZHZuypuX7.jpg',
    price: 299,
    title: 'Executive Suite',
    description: 'Experience top-tier luxury and spacious living',
  },
};
  • Booking summary სექციაში ჯამური ფასი დინამიურად უნდა ითვლებოდეს
  • ოთახის სათაური და აღწერა დინამიურად უნდა იცვლებოდეს

2. გამოითვალეთ ღამეების რაოდენობა

image

Check in & check out თარიღების მიხედვით გამოითვალეთ ღამეების რაოდენობა. ღამეების რაოდენობა ყოველი თარიღის ცვლილებისას უნდა ითვლებოდეს და ფასზეც ახდენდეს გავლენას.

3. Booking summary სექცია გადაიტანეთ ცალკე კომპონენტში: Summary.jsx

Summary.jsx გამოიყენეთ App.jsx-დან და გადაეცით საჭირო prop-ები.

image

4. დაამატეთ bookRoom ფუნქცია

bookRoom ფუნქცია ფორმის submit-ისას გაეშვება. ფუნქციამ უნდა შეამოწმოს termsAccepted მონიშნულია თუ არა. თუ არა - terms accepted checkbox-ის ქვემოთ უნდა გამოვიდეს პატარა ერორის მესიჯი "Please accept terms and conditions".

image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment