Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ticket section is being rendered #436

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
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
47 changes: 31 additions & 16 deletions components/Tickets/ticketCards.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,42 @@
import React from 'react';
import Button from '../Buttons/button';
import React from "react";
import Button from "../Buttons/button";

function TicketCards({ className, city }) {
// Determine card style based on event status
const isEndedOrUpcoming = city.ended || !city.ticket;
const cardOpacity = isEndedOrUpcoming ? 'opacity-40' : 'opacity-100';
const buttonText = city.isFree ? 'Get Your Ticket' : 'Buy Now';
// Determine card style and status based on event status
const isEnded = city.ended;
const isUpcoming = !city.ticket;
const cardOpacity = isEnded ? "opacity-60" : "opacity-100";
const buttonText = city.isFree ? "Get Your Ticket" : "Buy Now";
const statusLabel = isEnded
? "Ended"
: isUpcoming
? "Coming Soon"
: "Available";

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
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 className="mt-1 text-sm italic">{statusLabel}</div>
</div>
<div className='flex justify-center border-t h-20 border-dashed p-4 text-center'>
<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'}
{isEnded ? (
<Button disabled overlay={true} className="w-[200px] bg-gray-400">
Ended
</Button>
) : isUpcoming ? (
<Button disabled overlay={true} className="w-[200px] bg-gray-400">
Coming Soon
</Button>
) : (
<a href={city.ticket} target='_blank' rel='noreferrer'>
<Button className='w-[200px]'>{buttonText}</Button>
<a href={city.ticket} target="_blank" rel="noreferrer">
<Button className="w-[200px]">{buttonText}</Button>
</a>
)}
</div>
Expand Down
60 changes: 31 additions & 29 deletions config/city-lists.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,40 @@
[

{
"name": "Online",
"country": " Edition",
"date": "30th October 2024",
"cfpdate":"Not announced yet",
"description": "Join us for the AsyncAPI Online Conference Edition as the community unites across the globe to share experiences, collaborate, and foster meaningful connections.",
"img": "/img/testMic.webp",
"address": "AsyncAPI YouTube Channel",
"map": "https://www.youtube.com/live/F9wHxd-v2f0?si=PT8BuAUKNmoLHRiM",
"name": "Paris",
"country": "France",
"date": "December 3-5, 2024",
"cfpdate":"October 12, 2024",
"description": "Join us at apidays Paris for the AsyncAPI Conference and experience the art of API perfection! Let's craft a symphony of messaging and celebrate tech in style!",
"img": "https://media1.giphy.com/media/v1.Y2lkPTc5MGI3NjExd24yenR4djEyZzRoeDA0ZmEyb3Y1c2F4NWVmbG13NmZwYWNhZzdnNiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/Tuy3QxNZF1cxG/giphy.gif",
"address": "CNIT (Centre des Nouvelles Industries et Technologies), Paris 2 Place de la Défense, 92092 Puteaux",
"map": "https://maps.app.goo.gl/5te8WRM9Rb8B6vNd9",
"sponsors": [
"/img/apidays.png"
],
"ticket": false,
"isFree": true,
"ended": true

"ended": false,
"cfp": "https://apidays.typeform.com/to/ILJeAaV8?typeform-source=www.apidays.global#event_name=xxxxx"
},
{
"name": "Helsinki",
"country": "Finland",
"date": "May 29 2024",
"name": "Online",
"country": " Edition",
"date": "30th October 2024",
"cfpdate":"Not announced yet",
"description": "Join us in Helsinki for the AsyncAPI Conference, where we will explore all things AsyncAPI and connect physical and digital worlds. Get excited as we delve into sustainable APIs for the Era of AI, Data Platforms, and Quantum Computing!.",
"img": "/img/finland.webp",
"address": "Pikku-Finlandia, Helsinki, Karamzininranta 4, 00100 Helsinki, Finland",
"map": "https://maps.app.goo.gl/UpdEp188m5YNEAEo9",
"description": "Join us for the AsyncAPI Online Conference Edition as the community unites across the globe to share experiences, collaborate, and foster meaningful connections.",
"img": "/img/testMic.png",
"address": "AsyncAPI Youtube Channel",
"map": "https://www.youtube.com/@AsyncAPI",
"sponsors": [
"/img/apidays.png"
],
"ticket": false,
"isFree": false,
"isFree": true,
"ended": true

},

{
"name": "London",
"country": "UK",
Expand All @@ -46,24 +49,23 @@
],
"ticket": "https://ticket.apidays.global/event/apidays-london-2024/869eca20-bfb6-4103-b8bb-d0348932e940/",
"isFree": true,
"ended": true,
"recordings":"https://youtube.com/playlist?list=PLbi1gRlP7pig77jJD2ER9wfTxPSzBrLW5&si=YPmjUsj5mU6FpLhB",
"playlist":"https://www.youtube.com/embed/videoseries?si=92z0xOVroBuDUvMR&amp;list=PLbi1gRlP7pig77jJD2ER9wfTxPSzBrLW5"
"ended": true
},
{
"name": "Paris",
"country": "France",
"date": "December 3-5, 2024",
"name": "Helsinki",
"country": "Finland",
"date": "May 29 2024",
"cfpdate":"Not announced yet",
"description": "Join us at apidays Paris for the AsyncAPI Conference and experience the art of API perfection! Let's craft a symphony of messaging and celebrate tech in style!",
"img": "https://media1.giphy.com/media/v1.Y2lkPTc5MGI3NjExd24yenR4djEyZzRoeDA0ZmEyb3Y1c2F4NWVmbG13NmZwYWNhZzdnNiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/Tuy3QxNZF1cxG/giphy.gif",
"address": "CNIT (Centre des Nouvelles Industries et Technologies), Paris 2 Place de la Défense, 92092 Puteaux",
"map": "https://maps.app.goo.gl/5te8WRM9Rb8B6vNd9",
"description": "Join us in Helsinki for the AsyncAPI Conference, where we will explore all things AsyncAPI and connect physical and digital worlds. Get excited as we delve into sustainable APIs for the Era of AI, Data Platforms, and Quantum Computing!.",
"img": "/img/finland.webp",
"address": "Pikku-Finlandia, Helsinki, Karamzininranta 4, 00100 Helsinki, Finland",
"map": "https://maps.app.goo.gl/UpdEp188m5YNEAEo9",
"sponsors": [
"/img/apidays.png"
],
"ticket": false,
"isFree": true,
"isFree": false,
"ended": true
}

]
Loading
Loading