Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/components/PrizesChallenges/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const AwardBox: React.FC<AwardBoxProps> = ({
};

const PrizesChallenges: React.FC = () => {
const { data: prizesAndChallengesFlag } = useFlagState("PrizeEnable");
const { data: prizesAndChallengesFlag } = useFlagState("PrizesEnabled");

return (
<section
Expand Down
49 changes: 47 additions & 2 deletions src/components/Schedule/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,24 @@ const EventItem: React.FC<EventItemProps> = ({
const columnWidth = `${100 / totalColumns}%`;
const leftOffset = `${(event.column * 100) / totalColumns}%`;

// Add state for current time and update it every minute
const [isHappening, setIsHappening] = useState(false);

useEffect(() => {
const checkIfHappening = () => {
const now = new Date();
setIsHappening(now >= event.startTime && now <= event.endTime);
};

// Check initially
checkIfHappening();

// Update every minute
const interval = setInterval(checkIfHappening, 60000);

return () => clearInterval(interval);
}, [event.startTime, event.endTime]);

// Adjust positioning and sizing based on interval type
// 1-hour intervals: 80px per hour = 80/60 = 1.33px per minute
// 2-hour intervals: 120px per 2 hours = 120/120 = 1px per minute
Expand All @@ -251,7 +269,7 @@ const EventItem: React.FC<EventItemProps> = ({

return (
<motion.div
className={`absolute p-3 rounded-xl border-3 ${colors.bg} ${colors.border} text-white shadow-md overflow-hidden cursor-pointer flex items-center justify-center`}
className={`absolute p-3 rounded-xl border-3 ${colors.bg} ${colors.border} text-white shadow-md overflow-hidden cursor-pointer`}
style={{
top: `${topPosition}px`,
left: leftOffset,
Expand All @@ -268,6 +286,16 @@ const EventItem: React.FC<EventItemProps> = ({
whileTap={{ scale: 0.99 }}
onClick={() => onEventClick(event)}
>
{isHappening && (
<div
className="absolute w-2 h-2 rounded-full bg-red-500 animate-pulse"
style={{
top: "8px",
left: "8px",
zIndex: 2,
}}
/>
)}
<div
className={`text-center leading-tight overflow-y-auto max-h-full w-full px-2 text-white ${isMobile ? "text-xs" : "text-sm"}`}
style={{
Expand Down Expand Up @@ -586,9 +614,26 @@ const PreHackathonList: React.FC<{
return (
<li
key={event.id}
className={`cursor-pointer rounded-xl border-3 ${colors.border} ${colors.bg} px-3 py-3 shadow-md transition-all duration-300 hover:scale-105`}
className={`cursor-pointer rounded-xl border-3 ${colors.border} ${colors.bg} px-3 py-3 shadow-md transition-all duration-300 hover:scale-105 relative`}
onClick={() => onEventClick(event)}
>
{(() => {
const now = new Date();
const isHappening =
now >= event.startTime && now <= event.endTime;
return (
isHappening && (
<div
className="absolute w-2 h-2 rounded-full bg-red-500 animate-pulse"
style={{
top: "8px",
right: "8px",
zIndex: 2,
}}
/>
)
);
})()}
<div className="font-bold text-white mb-1">{event.name}</div>
<div className="text-xs text-white/90 font-medium mb-1">
{event.startTime.toLocaleDateString("en-US", {
Expand Down
22 changes: 11 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2857,11 +2857,11 @@
integrity sha512-H3iskjFIAn5SlJU7OuxUmTEpebK6TKB8rxZShDslBMZJ5u9S//KM1sbdAisiSrqwLQncVjnpi2OK2J51h+4lsg==

"@types/node@>=12.12.47", "@types/node@>=13.7.0", "@types/node@^24.1.0":
version "24.8.1"
resolved "https://registry.yarnpkg.com/@types/node/-/node-24.8.1.tgz#74c8ae00b045a0a351f2837ec00f25dfed0053be"
integrity sha512-alv65KGRadQVfVcG69MuB4IzdYVpRwMG/mq8KWOaoOdyY617P5ivaDiMCGOFDWD2sAn5Q0mR3mRtUOgm99hL9Q==
version "24.9.0"
resolved "https://registry.yarnpkg.com/@types/node/-/node-24.9.0.tgz#4fb62beb8b322fe2955ac94f80ff5a58c941ebf4"
integrity sha512-MKNwXh3seSK8WurXF7erHPJ2AONmMwkI7zAMrXZDPIru8jRqkk6rGDBVbw4mLwfqA+ZZliiDPg05JQ3uW66tKQ==
dependencies:
undici-types "~7.14.0"
undici-types "~7.16.0"

"@types/parse-json@^4.0.0":
version "4.0.2"
Expand Down Expand Up @@ -5674,9 +5674,9 @@ postcss@^8.4.47:
source-map-js "^1.2.1"

posthog-js@^1.257.0:
version "1.276.0"
resolved "https://registry.yarnpkg.com/posthog-js/-/posthog-js-1.276.0.tgz#3605e99dd42e69b772fc43c661c064edc3693aa1"
integrity sha512-FYZE1037LrAoKKeUU0pUL7u8WwNK2BVeg5TFApwquVPUdj9h7u5Z077A313hPN19Ar+7Y+VHxqYqdHc4VNsVgw==
version "1.277.0"
resolved "https://registry.yarnpkg.com/posthog-js/-/posthog-js-1.277.0.tgz#027c4c546863edd899aff60bdfd7e46a4aa5849a"
integrity sha512-whSyov8KH2IwXkeJVbgu07EkPk6AITXnrJN7Mg5rGAHJQ0LS1w6qh2Ib4LMsLHTrR5UAqwYHcufbjDl6snoESw==
dependencies:
"@posthog/core" "1.3.0"
core-js "^3.38.1"
Expand Down Expand Up @@ -6654,10 +6654,10 @@ unbox-primitive@^1.1.0:
has-symbols "^1.1.0"
which-boxed-primitive "^1.1.1"

undici-types@~7.14.0:
version "7.14.0"
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.14.0.tgz#4c037b32ca4d7d62fae042174604341588bc0840"
integrity sha512-QQiYxHuyZ9gQUIrmPo3IA+hUl4KYk8uSA7cHrcKd/l3p1OTpZcM0Tbp9x7FAtXdAYhlasd60ncPpgu6ihG6TOA==
undici-types@~7.16.0:
version "7.16.0"
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.16.0.tgz#ffccdff36aea4884cbfce9a750a0580224f58a46"
integrity sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==

unicode-canonical-property-names-ecmascript@^2.0.0:
version "2.0.1"
Expand Down