-
Notifications
You must be signed in to change notification settings - Fork 2
Style ongoing events #284
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
base: main
Are you sure you want to change the base?
Style ongoing events #284
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,8 +10,9 @@ import { fetchAttendanceByEventId } from '../../api/owApi'; | |
| import { calculateSeatsInfo, selectIndicatorColor, determineTimeBeforeRegistrationOpens, determineStatusText } from '../../lib/event'; | ||
|
|
||
| export function EventCard({ event }: { event: IEvent }) { | ||
| const { ingress, title, start_date, event_type, images } = event; | ||
| const { ingress, title, start_date, end_date, event_type, images } = event; | ||
| const image = images[0]; | ||
| const isOngoing = Date.parse(start_date) <= new Date().getTime() && new Date().getTime() <= Date.parse(end_date) | ||
|
|
||
| const isRegistrationEvent = event.max_capacity !== null; | ||
|
|
||
|
|
@@ -45,7 +46,8 @@ export function EventCard({ event }: { event: IEvent }) { | |
| const timeBeforeRegistrationOpens = determineTimeBeforeRegistrationOpens(registrationStart); | ||
|
|
||
| return ( | ||
| <BaseCard showOverflow> | ||
| <BaseCard showOverflow className={isOngoing ? "bg-gradient-to-t from-[#fdba74]/40 via-[#fdba74]/5 via-40% border-b-2 border-b-[#fdba74]" : ""} > | ||
|
|
||
| {isRegistrationEvent && ( | ||
| <div | ||
| className={`absolute inline-flex items-center justify-center py-0.5 px-2 text-sm font-bold text-white | ||
|
|
@@ -82,6 +84,7 @@ export function EventCard({ event }: { event: IEvent }) { | |
| )} | ||
| </div> | ||
| </div> | ||
| {/* <div className={`rounded-lg absolute w-2/3 m-auto h-1 -bottom-3 ${isOngoing ? "shadow-lg shadow-red-500 bg-red-500" : ""}`}></div> */} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hvorfor beholde dette?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Denne PR-eren er egentlig ikke klar, tror jeg. Det vil si, jeg har ikke sjekket, det var bare kode jeg hadde ucommittet på pc-en, men som jeg måtte gjøre noe med for å hente ned nye changes.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. okidoki |
||
| </BaseCard> | ||
| ); | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bruke tailwind variabler for fargene?