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
32 changes: 1 addition & 31 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 38 additions & 9 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import CreateApplicationPage from './pages/Application/Create';
import EditApplicationPage from './pages/Application/Edit';
import SingleHackerPage from './pages/Application/View/[id]';
import CheckinPage from './pages/Hacker/Checkin';
import TeamCheckinPage from './pages/Hacker/TeamCheckin';
import HackPassPage from './pages/Hacker/Pass';
import DashboardPage from './pages/index';
import LoginPage from './pages/Login/index';
Expand All @@ -30,6 +31,7 @@ import {
IAccount,
IHacker,
UserType,
ISetting,
} from './config';
import * as CONSTANTS from './config/constants';

Expand Down Expand Up @@ -378,18 +380,45 @@ class App extends React.Component {
this.props
)}
/>
<Route
path={FrontendRoute.CHECKIN_STAFF_PAGE}
element={React.createElement(
withBackground(
withNavbar(
withAuthRedirect(CheckinPage, {
requiredAuthState: true,
AuthVerification: (user: IAccount) =>
user.confirmed &&
(user.accountType === UserType.STAFF ||
user.accountType === UserType.VOLUNTEER),
}),
{ activePage: 'checkin' }
)
),
this.props
)}
/>
<Route
path={FrontendRoute.CHECKIN_HACKER_PAGE}
element={React.createElement(
withNavbar(
withAuthRedirect(CheckinPage, {
requiredAuthState: true,
AuthVerification: (user: IAccount) =>
user.confirmed &&
(user.accountType === UserType.STAFF ||
user.accountType === UserType.HACKBOARD ||
user.accountType === UserType.VOLUNTEER),
})
withBackground(
withNavbar(
withAuthRedirect(
withHackerRedirect(TeamCheckinPage, {
requiredAuthState: true,
AuthVerification: (hacker: IHacker, settings?: ISetting) =>
Boolean(settings?.checkinOpen) &&
hacker.status === HackerStatus.HACKER_STATUS_CHECKED_IN,
}),
{
requiredAuthState: true,
redirAfterLogin: true,
AuthVerification: (user: IAccount) =>
user.confirmed && user.accountType === UserType.HACKER,
}
),
{ activePage: 'checkin' }
)
),
this.props
)}
Expand Down
2 changes: 1 addition & 1 deletion src/api/APIResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ export class APIResponse<T = any> {
public data: T;
public message: string;
}
export default APIResponse;
export default APIResponse;
33 changes: 33 additions & 0 deletions src/api/checkin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { AxiosPromise } from 'axios';
import { APIRoute } from '../config';
import API from './api';
import APIResponse from './APIResponse';

interface ICheckinData {
prizeCategories?: string[];
sponsorChallenges?: string[];
mlhChallenges?: string[];
// workshopsAttended: string[];
discordTag: string;
devpostLink: string;
}

class CheckinAPI {
constructor() {
API.createEntity(APIRoute.HACKER_CHECKIN);
}

/**
* Submits a hacker's check-in information
* @param data The check-in data including team members, categories, and sponsor prizes
*/
public submitCheckin(data: ICheckinData): AxiosPromise<APIResponse<{}>> {
return API.getEndpoint(APIRoute.HACKER_CHECKIN).create({ formData: data });
}
}

const checkinAPI = new CheckinAPI();

export const submitCheckin = async (formData: ICheckinData) => {
return checkinAPI.submitCheckin(formData);
};
1 change: 1 addition & 0 deletions src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export * from './APIResponse';
export * from './account';
export * from './api';
export * from './auth';
export * from './checkin';
export * from './endpoint';
export * from './hacker';
export * from './travel';
Expand Down
1 change: 1 addition & 0 deletions src/config/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,4 @@ export const SETTINGS_OPEN_TIME_LABEL = 'Applications open at:';
export const SETTINGS_CLOSE_TIME_LABEL = 'Applications close at:';
export const SETTINGS_CONFIRM_TIME_LABEL = 'Hacker confirmations close at:';
export const SETTINGS_IS_REMOTE_LABEL = 'Remote hackathon mode';
export const SETTINGS_CHECKIN_OPEN_LABEL = 'Open/Close team check-in form';
1 change: 1 addition & 0 deletions src/config/frontendRoutes.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export enum FrontendRoute {
ADMIN_SEARCH_PAGE = '/admin/search',
CHECKIN_HACKER_PAGE = '/hacker/checkin',
CHECKIN_STAFF_PAGE = '/staff/checkin',
PASS_HACKER_PAGE = '/hacker/pass',
CONFIRM_ACCOUNT_PAGE = '/account/confirm',
CREATE_ACCOUNT_PAGE = '/account/create',
Expand Down
8 changes: 8 additions & 0 deletions src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,12 @@ export * from './travel';
export * from './userTypes';
export * from './validationError';
export * from './pageType';
export * from './prizeCategories';
export * from './sponsorChallenges';
export * from './mlhChallenges';
export * from './workshops';
export * from './reviewers'
export * from './prizeCategories';
export * from './sponsorChallenges';
export * from './mlhChallenges';
export * from './workshops';
10 changes: 10 additions & 0 deletions src/config/mlhChallenges.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export enum MlhChallenges {
MLH_CHALLENGE_1 = 'Best Use of ElevenLabs - Custom Apple Airpods',
MLH_CHALLENGE_2 = 'Best Use of Gemini API - Wireless Headphones',
MLH_CHALLENGE_3 = 'Best Use of MongoDB Atlas - Google Swag Kits',
MLH_CHALLENGE_4 = 'Best Use of DigitalOcean - M5GO starter kit',
MLH_CHALLENGE_5 = 'Best Use of Solana - Retro Wireless Mouse',
MLH_CHALLENGE_6 = 'Best Use of Auth0 - Ledger Nano S Plus',
}

export default MlhChallenges;
Loading