Skip to content
Draft
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
4 changes: 3 additions & 1 deletion frontend/src/components/cards/BaseCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@ export const BaseCard = ({
showOverflow = false,
isLoading = false,
isError = false,
className = "",
}: {
children?: React.ReactNode,
width?: number,
showOverflow?: boolean,
isLoading?: boolean,
isError?: boolean,
className?: string
}) => {
const style = width ? { width: `${width}px` } : undefined;
const overflowClass = showOverflow ? '' : 'overflow-hidden';

return (
<div
className={`relative ${overflowClass} bg-white flex flex-col border border-gray-200 shadow rounded-xl dark:bg-gray-800 dark:border-gray-700`}
className={`relative ${overflowClass} bg-white flex flex-col border border-gray-200 shadow rounded-xl dark:bg-gray-800 dark:border-gray-700 ${className}`}
style={style}
>
{isLoading ? (
Expand Down
7 changes: 5 additions & 2 deletions frontend/src/components/cards/EventCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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]" : ""} >

Copy link
Copy Markdown
Member

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?


{isRegistrationEvent && (
<div
className={`absolute inline-flex items-center justify-center py-0.5 px-2 text-sm font-bold text-white
Expand Down Expand Up @@ -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> */}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hvorfor beholde dette?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okidoki

</BaseCard>
);
}