Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 20 additions & 17 deletions components/Tickets/ticketCards.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,27 @@ function TicketCards({ className, city }) {
const buttonText = city.isFree ? 'Get Your Free Ticket' : 'Buy Now';

return (
<div className={`w-[300px] lg:w-full ${cardOpacity} hoverEffect h-[400px] cursor-pointer flex flex-col text-white justify-between rounded-lg card bg-white ${className}`}>
<div className='p-4'>
<div className='text-xl font-bold text-gradient'>{city.name}, {city.country}</div>
<div className='mt-2 text-lg'>{city.date}</div>
</div>
<div className='flex justify-center border-t h-20 border-dashed p-4 text-center'>
{/* Show a button based on the event status */}
{isEndedOrUpcoming ? (
<Button disabled overlay={true} className='w-[200px] bg-gray-400'>
{city.ended ? 'Ended' : 'Coming soon'}
</Button>
) : (
<a href={city.ticket} target='_blank' rel='noreferrer'>
<Button className='w-[200px]'>{buttonText}</Button>
</a>
)}
<div className={`w-[300px] shrink-0 ${cardOpacity} h-[400px] cursor-pointer flex flex-col text-white justify-between rounded-lg card bg-white m-2 ${className}`}>
<div className="p-4 h-[100%] bg-cover relative">
<div className='text-xl font-bold text-gradient'>{city.name}, {city.country}
</div>
<div className='mt-2 text-lg mb-2'>{city.date}</div>
<p className='border-t pt-2'>{city.description}</p>
</div>

<div className='flex justify-center border-t h-20 border-dashed p-4 text-center'>
{/* Show a button based on the event status */}
{isEndedOrUpcoming ? (
<Button disabled overlay={true} className='w-[200px] bg-gray-400'>
{city.ended ? 'Ended' : 'Coming soon'}
</Button>
) : (
<a href={city.ticket} target='_blank' rel='noreferrer'>
<Button className='w-[200px]'>{buttonText}</Button>
</a>
)}
</div>
</div>
</div>
);
}

Expand Down
65 changes: 45 additions & 20 deletions pages/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @next/next/no-img-element */
/* eslint-disable react/no-unescaped-entities */
import { useEffect, useState } from 'react';
import { useEffect, useRef, useState } from 'react';
import Head from 'next/head';
import { useMediaQuery } from 'react-responsive';
import Header from '../components/Header/header';
Expand All @@ -16,11 +16,13 @@ import speakers from '../config/speakers.json';
import Link from 'next/link';
import Button from '../components/Buttons/button';
import Dropdown from '../components/Dropdown/dropdown';
import ReactSlider from '../components/Slider/slider';

export default function Home() {
const isTablet = useMediaQuery({ maxWidth: '1118px' });
const [speakersList, setSpeakersList] = useState([]);
const [city, setCity] = useState("");
const carouselRef = useRef(null);
speakers[0].lists = [];
speakers.map((speaker) => {
if (Array.isArray(speaker.lists) && Object.keys(speaker.lists).length > 0) {
Expand All @@ -36,6 +38,27 @@ export default function Home() {
setCity(speakers[0]);
setSpeakersList(speakers[0].lists);
},[]);

const shiftLeft = () => {
console.log(carouselRef.current);
if (carouselRef.current) {
carouselRef.current.scrollBy({
left: -365,
behavior: 'smooth',
});
}
}

const shiftRight = () => {
if (carouselRef.current) {
carouselRef.current.scrollBy({
left: 365,
behavior: 'smooth',
});
}
}


return (
<div>
<Head>
Expand Down Expand Up @@ -164,25 +187,27 @@ export default function Home() {
</div>
</div>
</div>
<div id='tickets' className='flex items-center'>
<div className='text-lg sm:text-sm text-white font-semi-bold border-b-2 border-blue-400 mb-1'>Tickets</div>
</div>
<div data-test="ticket-section">
<Heading typeStyle='heading-md' className='text-gradient text-center lg:mt-10'>
Get Tickets
</Heading>
<div className='max-w-3xl sm:w-full text-center'>
<Paragraph typeStyle='body-lg' className="mt-6" textColor='text-gray-200' >
Experience the Future of Asynchronous Communication: Get Tickets for the AsyncAPI Conference on Tour!
</Paragraph>
</div>
<div className='w-[1000px] lg:w-full mt-10 flex justify-between lg:flex-col'>
{cities.map((city) => {
if(city.ended === false){
return <TicketCards key={city.name} city={city} className='lg:mt-10' />
}
})}
</div>
<div className='w-full mx-20 flex flex-col justify-center items-center'>
<div id='tickets' className='flex items-center'>
<div className='text-lg sm:text-sm text-white font-semi-bold border-b-2 border-blue-400 mb-1'>Tickets</div>
</div>
<Heading typeStyle='heading-md' className='text-gradient text-center lg:mt-10'>
Get Tickets
</Heading>
<div className='max-w-3xl sm:w-full text-center'>
<Paragraph typeStyle='body-lg' className="mt-6" textColor='text-gray-200' >
Experience the Future of Asynchronous Communication: Get Tickets for the AsyncAPI Conference on Tour!
</Paragraph>
<ReactSlider>
{cities.filter((x)=>x.ended == false).map((city) => {
return <TicketCards key={city.name} city={city} className='lg:mt-10' />
})}
{cities.filter((x)=>x.ended == true).map((city) => {
return <TicketCards key={city.name} city={city} className='lg:mt-10' />
})}
</ReactSlider>
</div>
</div>
</div>
</div>
<div id='sponsors' className='mt-20'>
Expand Down