forked from asyncapi/conference-website
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update ticket cards (asyncapi#359)
Co-authored-by: acethecreator <[email protected]>
- Loading branch information
1 parent
d1d5db3
commit 066c265
Showing
7 changed files
with
48 additions
and
24 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
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'; | ||
|
||
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='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> | ||
); | ||
} | ||
|
||
export default TicketCards; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters