Skip to content

Commit

Permalink
merged dev with beta
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurikam2003 committed Jun 16, 2024
1 parent e90316e commit c623a04
Show file tree
Hide file tree
Showing 97 changed files with 3,090 additions and 1,102 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ dist-ssr

# Database stuff
mongo-volume
env
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,17 @@ This repository holds the source code for UofT Engineering's Orientation Website
split into two "packages". First, there is the frontend package, `client`, and second there is the backend
package `server`.

## The Frosh 2T4 Web Team
### Team Leads
* [Gaurika Mahajan](https://github.com/gaurikam2003), [Ashley Leal](https://github.com/ashleyleal)
### Team members
* [Asmita](https://github.com/asmita-chandra), [Alissa](https://github.com/kexinxiang), [William](https://github.com/WilliamJWen), [George](https://github.com/Wozunubi)

## The Frosh 2T3 Web Team
* Soon to come!
### Team Leads
* [Farbod M](https://github.com/Freeassassin), [Natalie Chan](https://github.com/natapokie)
### Team members
* [Vraj](https://github.com/vproHacks), [Uzma](https://github.com/uzFer), [Tanushanth](https://github.com/Tanushanth), [Sherry](https://github.com/Sherryzh0830)

## The Frosh 2T2 Web Team
### Webmasters
Expand Down
1 change: 1 addition & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ dist-ssr
*.njsproj
*.sln
*.sw?
.env
22 changes: 14 additions & 8 deletions client/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ import { Footer } from './components/footer/Footer';
import { useDispatch, useSelector } from 'react-redux';
import { initialsSelector, loggedInSelector, registeredSelector } from './state/user/userSlice';
import { useEffect } from 'react';
import { getUserInfo } from './state/user/saga';
import { AskQuestionButton } from './components/button/AskQuestionButton/AskQuestionButton';
import { DarkModeProvider } from './util/DarkModeProvider';
import { SnackbarProvider } from './util/SnackbarProvider';

import { getScuntSettings } from './state/scuntSettings/saga';
import { scuntSettingsSelector } from './state/scuntSettings/scuntSettingsSlice';
import { getUserInfo } from './state/user/saga';

import { LandingPage } from './pages/Initial/LandingPage';

const readyForFrosh = false;

export default function App() {
const dispatch = useDispatch();
Expand All @@ -25,11 +28,15 @@ export default function App() {

return (
<DarkModeProvider>
<SnackbarProvider>
<BrowserRouter>
<TransitionRoutes />
</BrowserRouter>
</SnackbarProvider>
{readyForFrosh ? (
<SnackbarProvider>
<BrowserRouter>
<TransitionRoutes />
</BrowserRouter>
</SnackbarProvider>
) : (
<LandingPage />
)}
</DarkModeProvider>
);
}
Expand All @@ -39,7 +46,6 @@ const TransitionRoutes = () => {
const loggedIn = useSelector(loggedInSelector);
const registered = useSelector(registeredSelector);
const initials = useSelector(initialsSelector);
const scuntSettings = useSelector(scuntSettingsSelector);

return (
<TransitionGroup>
Expand Down
Binary file added client/src/assets/about/execs/co-oc1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/about/execs/co-oc2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/about/execs/vcevents1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/about/execs/vcevents2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/about/execs/vcfinance.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/about/execs/vcleadership.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/about/execs/vcmarketing.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/judges/alexi.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/judges/amelie.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/judges/ben.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/judges/celin.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/judges/emaan.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/judges/erika.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/judges/jeremy.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/judges/kaija.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/judges/karen.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/judges/katie.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/judges/khalil.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/judges/luka.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/judges/nat.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/judges/novera.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/judges/rimjot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/judges/tanya.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/judges/tech.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions client/src/assets/social/instagram-brands-dark-purple.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/sponsors/Alumni.jpg
Binary file added client/src/assets/sponsors/Coco.jpg
Binary file added client/src/assets/sponsors/MoguMogu.png
Binary file added client/src/assets/sponsors/Nanis.png
Binary file added client/src/assets/sponsors/Neo.jpg
Binary file added client/src/assets/sponsors/OSPE.jpg
Binary file added client/src/assets/sponsors/PEO.png
Binary file added client/src/assets/sponsors/UTSU.jpg
9 changes: 3 additions & 6 deletions client/src/components/MakeSchedulePDF/MakeSchedulePDF.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const styles = StyleSheet.create({
});

const MakeSchedulePDF = (froshObject) => {
if (!froshObject) return null;
const froshGroup = froshObject?.froshGroup;
const scheduleData = getFroshGroupSchedule(froshGroup);

Expand Down Expand Up @@ -66,14 +67,10 @@ const MakeSchedulePDF = (froshObject) => {
</Text>
{scheduleDay['Event Location'] ? (
<Text style={styles.eventLoc}>{scheduleDay['Event Location']}</Text>
) : (
<></>
)}
) : null}
{scheduleDay['Event Description'] ? (
<Text style={styles.eventDesc}>{scheduleDay['Event Description']}</Text>
) : (
<></>
)}
) : null}
</div>
))}
</div>
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/ScuntLinks/ScuntLinks.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useEffect, useRef } from 'react';
import React from 'react';
import { Link, useLocation } from 'react-router-dom';
import { pages } from '../../util/pages';
import { ButtonOutlined } from '../button/ButtonOutlined/ButtonOutlined';
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/form/RadioButtons/RadioButtons.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ const RadioButtons = ({
<div
style={{
display: 'flex',
alignItems: 'center',
alignItems: 'flex-start',
flexWrap: 'wrap',
justifyContent: 'space-evenly',
justifyContent: 'space-around',
}}
className={'radio-buttons'}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,38 +26,34 @@ export const ProfilePageResources = ({ froshObject }) => {
})}
{froshObject ? (
<>
<a key={'5Download'} className="no-link-style">
<ButtonBubble
label={'Download Information PDF'}
onClick={async () => {
const MakeReceipt = (await import('../../MakeReceipt/MakeReceipt')).MakeReceipt;
const ReactPDF = await import('@react-pdf/renderer');
const blob = await ReactPDF.pdf(MakeReceipt(froshObject)).toBlob();
const fileURL = URL.createObjectURL(blob);
const pdfWindow = window.open(fileURL, '_blank');
pdfWindow && pdfWindow.focus();
}}
isSecondary
style={{ margin: 0, marginTop: '10px' }}
/>
</a>
<ButtonBubble
label={'Download Information PDF'}
onClick={async () => {
const { MakeReceipt } = await import('../../MakeReceipt/MakeReceipt');
const ReactPDF = await import('@react-pdf/renderer');
const blob = await ReactPDF.pdf(MakeReceipt(froshObject)).toBlob();
const fileURL = URL.createObjectURL(blob);
const pdfWindow = window.open(fileURL, '_blank');
pdfWindow && pdfWindow.focus();
}}
isSecondary
style={{ margin: 0, marginTop: '10px' }}
/>
<ButtonBubble
label={'Download Schedule PDF'}
onClick={async () => {
const ReactPDF = await import('@react-pdf/renderer');
const { MakeSchedulePDF } = await import('../../MakeSchedulePDF/MakeSchedulePDF');
const blob = await ReactPDF.pdf(MakeSchedulePDF(froshObject)).toBlob();
const fileURL = URL.createObjectURL(blob);
const pdfWindow = window.open(fileURL, '_blank');
pdfWindow && pdfWindow.focus();
}}
isSecondary
style={{ margin: 0, marginTop: '10px' }}
/>
</>
) : (
<></>
)}
<ButtonBubble
label={'Download Schedule PDF'}
onClick={async () => {
const ReactPDF = await import('@react-pdf/renderer');
const { MakeSchedulePDF } = await import('../../MakeSchedulePDF/MakeSchedulePDF');
const blob = await ReactPDF.pdf(MakeSchedulePDF(froshObject)).toBlob();
const fileURL = URL.createObjectURL(blob);
const pdfWindow = window.open(fileURL, '_blank');
pdfWindow && pdfWindow.focus();
}}
isSecondary
style={{ margin: 0, marginTop: '10px' }}
/>
) : null}
</div>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
preKitPickUp,
searchFroshList,
clearFroshList,
getFood,
} from '../../../../state/frosh/saga';
import PropTypes from 'prop-types';
import { capitalizeFirstLetter } from '../../../../pages/Profile/functions';
Expand All @@ -29,6 +30,8 @@ export const ProfilePageQRScanner = ({ scopes }) => {
setScannerType('registration');
} else if (scopes?.includes('scanner:kits')) {
setScannerType('kits');
} else if (scopes?.includes('scanner:food')) {
setScannerType('food');
}
}, [scopes]);

Expand Down Expand Up @@ -91,6 +94,20 @@ export const ProfilePageQRScanner = ({ scopes }) => {
)}
</>
);
case 'food':
return (
<>
{frosh['gotFood'] ? (
<div style={{ color: 'black' }}>
<ErrorSuccessBox error content={'Food already picked up'} />
</div>
) : (
<div style={{ color: 'black' }}>
<ErrorSuccessBox success content={'Food picked up!'} />
</div>
)}
</>
);
}
};

Expand All @@ -104,6 +121,8 @@ export const ProfilePageQRScanner = ({ scopes }) => {
dispatch(signInFrosh({ userID }));
} else if (scannerType === 'kits') {
dispatch(preKitPickUp({ userID }));
} else if (scannerType === 'food') {
dispatch(getFood({ userID }));
}
}
}}
Expand All @@ -126,9 +145,16 @@ export const ProfilePageQRScanner = ({ scopes }) => {
{Object.keys(frosh).map((keyPassed) => {
const key = keyPassed.toString();
return (
!['_id', 'signInDate', 'userType', 'firstName', 'preferredName', 'preKit'].includes(
key,
) && (
![
'_id',
'signInDate',
'userType',
'firstName',
'preferredName',
'preKit',
'isRegistered',
'gotFood',
].includes(key) && (
<div key={key}>
<b>{capitalizeFirstLetter(key) + ': '}</b>
{frosh[key]?.toString()}
Expand Down Expand Up @@ -177,6 +203,8 @@ export const ProfilePageQRScanner = ({ scopes }) => {
dispatch(signInFrosh({ userID: searchResultFrosh._id }));
} else if (scannerType === 'kits') {
dispatch(preKitPickUp({ userID: searchResultFrosh._id }));
} else if (scannerType === 'food') {
dispatch(getFood({ userID: searchResultFrosh._id }));
}
}}
key={searchResultFrosh.email + index}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const ProfilePageFroshScuntTeamsSelection = () => {
const { scuntSettings } = useSelector(scuntSettingsSelector);
const { axios } = useAxios();

if (!isRegistered || !user?.attendingScunt || scuntSettings?.revealTeams) {
if (!isRegistered || !user?.attendingScunt || !scuntSettings || scuntSettings?.revealTeams) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,63 +8,64 @@ import { ButtonOutlined } from '../../../button/ButtonOutlined/ButtonOutlined';
import './ProfilePageScuntToken.scss';
import { getScuntTeamObjFromTeamNumber } from '../../../../pages/ScuntJudgeForm/ScuntJudgeForm';
import { scuntDiscord } from '../../../../util/scunt-constants';
import { scuntTeamsSelector } from '../../../../state/scuntTeams/scuntTeamsSlice';

export const ProfilePageScuntToken = ({ scuntTeams, scuntTeamObjs }) => {
const { scuntSettings, error } = useSelector(scuntSettingsSelector);
const { user } = useSelector(userSelector);
const isRegistered = useSelector(registeredSelector);
const { setSnackbar } = useContext(SnackbarContext);
const [showToken, setShowToken] = useState(false);
// export const ProfilePageScuntToken = () => {
// const { scuntSettings } = useSelector(scuntSettingsSelector);
// const { user } = useSelector(userSelector);
// const { scuntTeams } = useSelector(scuntTeamsSelector);
// const isRegistered = useSelector(registeredSelector);
// const { setSnackbar } = useContext(SnackbarContext);
// const [showToken, setShowToken] = useState(false);
// if (!isRegistered || (scuntSettings && !scuntSettings?.revealTeams)) {
// return null;
// }

const code = user?.scuntToken;
if (code === undefined || !isRegistered || !scuntSettings?.revealTeams) {
return <></>;
}
if (!user?.attendingScunt && user?.userType !== 'leadur') {
return (
<div className="profile-page-scunt-token profile-page-side-section">
<p>
<b>Looking for your Scunt login Token?</b>
</p>
<p>You have chosen not to participate in Scunt.</p>
<div style={{ height: '30px' }} />
</div>
);
}
return (
<div className="profile-page-scunt-token profile-page-side-section">
<h2>{getScuntTeamObjFromTeamNumber(user?.scuntTeam, scuntTeamObjs)?.name}</h2>
<i>
<h4>Team {user?.scuntTeam ? user?.scuntTeam.toString() : '‽'}</h4>
</i>
<h3
style={{ filter: showToken ? '' : 'blur(10px)' }}
onClick={() => {
setSnackbar('Copied to clipboard');
navigator.clipboard.writeText(code);
}}
>
{code}
</h3>
<p>Scunt Login Token</p>
<p style={{ fontSize: '13px' }}>
Use this token to login to the{' '}
<a href={scuntDiscord} target="_blank" rel="noreferrer">
Scunt Discord
</a>
</p>
<ButtonOutlined
isSecondary={showToken}
label={showToken ? 'Hide' : 'Show'}
onClick={() => {
setShowToken(!showToken);
}}
/>
</div>
);
};
// if (!user?.attendingScunt && user?.userType !== 'leadur') {
// return (
// <div className="profile-page-scunt-token profile-page-side-section">
// <p>
// <b>Looking for your Scunt login Token?</b>
// </p>
// <p>You have chosen not to participate in Scunt.</p>
// <div style={{ height: '30px' }} />
// </div>
// );
// }
// return (
// <div className="profile-page-scunt-token profile-page-side-section">
// <h2>{getScuntTeamObjFromTeamNumber(user?.scuntTeam, scuntTeams)?.name}</h2>
// <i>
// <h4>Team {user?.scuntTeam ? user?.scuntTeam.toString() : '‽'}</h4>
// </i>
// <h3
// style={{ filter: showToken ? '' : 'blur(10px)' }}
// onClick={() => {
// navigator.clipboard.writeText(code);
// setSnackbar('Copied to clipboard');
// }}
// >
// {code}
// </h3>
// <p>Scunt Login Token</p>
// <p style={{ fontSize: '13px' }}>
// Use this token to login to the{' '}
// <a href={scuntDiscord} target="_blank" rel="noreferrer">
// Scunt Discord
// </a>
// </p>
// <ButtonOutlined
// isSecondary={showToken}
// label={showToken ? 'Hide' : 'Show'}
// onClick={() => {
// setShowToken(!showToken);
// }}
// />
// </div>
// );
// };

ProfilePageScuntToken.propTypes = {
scuntTeams: PropTypes.array,
scuntTeamObjs: PropTypes.array,
};
// ProfilePageScuntToken.propTypes = {
// scuntTeams: PropTypes.array,
// scuntTeamObjs: PropTypes.array,
// };
Loading

0 comments on commit c623a04

Please sign in to comment.