Skip to content

Commit

Permalink
Add hacker packet
Browse files Browse the repository at this point in the history
  • Loading branch information
VictiniX888 committed Nov 9, 2024
1 parent 84b960b commit 8a96e98
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/dashboard/components/events/events-calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@ function EventsCalendar(props: EventsCalendarProps) {
// Preset scroll to current time
useEffect(() => {
const d = new Date();
console.log(d.getHours() * 100);

scrollRefs.current.forEach((el) => {
if (el) {
el.scrollTop = d.getHours() * 100;
}
});
}, []); // Empty dependency array to ensure this only runs on mount
}, [cards]); // Empty dependency array to ensure this only runs on mount

useEffect(() => {
const gridContainer = document.querySelectorAll('.grid-container');
Expand Down
6 changes: 6 additions & 0 deletions apps/dashboard/layouts/themeless-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
import { FaRegUserCircle } from 'react-icons/fa';
import { useRouter } from 'next/router';
import { SponsorServiceAPI } from '../common/api';
import { IoDocumentTextOutline } from 'react-icons/io5';

export type ThemelessLayoutProps = React.PropsWithChildren;

Expand Down Expand Up @@ -47,6 +48,11 @@ function ThemelessLayout({ children }: ThemelessLayoutProps) {
{ name: 'Events', url: '/events', image: MdOutlineCalendarViewMonth },
{ name: 'Leaderboard', url: '/leaderboard', image: MdStarOutline },
{ name: 'Profile', url: '/hacker-profile', image: FaRegUserCircle },
{
name: 'Hacker Packet',
url: '/hacker-packet',
image: IoDocumentTextOutline,
},
];
if (user.role === HibiscusRole.VOLUNTEER)
return [
Expand Down
4 changes: 4 additions & 0 deletions libs/sso-client/src/lib/sso-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ export const middlewareHandler =
return res;
}

if (request.nextUrl.pathname.startsWith('/hacker-packet')) {
return NextResponse.redirect(getEnv().Hibiscus.RSVPForm.HackerPacketURL);
}

// Special routes
// TODO: rewrite this to make it more generic
if (request.nextUrl.pathname.startsWith('/api/tally/')) {
Expand Down

0 comments on commit 8a96e98

Please sign in to comment.