Skip to content

Commit

Permalink
Merge branch 'dev' into prod
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurikam2003 committed Jul 31, 2024
2 parents b42883f + 87fb6ef commit ff3ab3d
Show file tree
Hide file tree
Showing 51 changed files with 2,315 additions and 166 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion client/src/assets/login/background-colour.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
185 changes: 185 additions & 0 deletions client/src/assets/mascots/dragon-retreat.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/misc/backarrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions client/src/assets/misc/left-arrow-svgrepo-com.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 not shown.
983 changes: 983 additions & 0 deletions client/src/assets/scuntlogo/scunt_color_2t4.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const DashboardDropdown = ({ open, setOpen, items, title, icon }) => {
<div className={'dashboard-dropdown-links'} key={title} ref={refContainer}>
<div className={'dashboard-dropdown-title'} onClick={() => setOpen(!open)}>
<img src={icon} className={'dashboard-dropdown-icon'} />
<h3 className={'dashboard-dropdown-text'}>{title}</h3>
<h3 className={'dashboard-dropdown-text'}>{title.toUpperCase()}</h3>
<div className={`dashboard-dropdown-image${open ? ' open' : ''}`}>
{darkMode ? (
<img alt={'arrow'} src={ArrowDarkMode} className="dashboard-dropdown-arrow" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const FAQAskQuestion = () => {
pageState !== 'form' ? 'faq-page-disappear' : 'faq-page-appear'
}`}
>
<h1 className={'faq-ask-question-title'}>Ask a Question</h1>
<h1 className={'faq-ask-question-title'}>ASK A QUESTION</h1>
<p className="faq-ask-question-paragraph">We will get back to you in an email soon!</p>
<form>
<label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const ProfilePageLeaderPermissionDashboardLinks = () => {
const dropdowns = [
{
label: 'data',
title: 'DATA',
title: 'Data',
state: openDataDropdown,
setState: setOpenDataDropdown,
icon: DataDashboardIcon,
Expand All @@ -46,7 +46,7 @@ export const ProfilePageLeaderPermissionDashboardLinks = () => {
},
{
label: 'outreach',
title: 'OUTREACH',
title: 'Outreach',
state: openOutreachDropdown,
setState: setOpenOutreachDropdown,
icon: OutreachDashboardIcon,
Expand Down Expand Up @@ -81,7 +81,7 @@ export const ProfilePageLeaderPermissionDashboardLinks = () => {
{
label: 'Skule™ Hunt Judge Panel',
anyRegisterScope: false,
link: '/scunt-judge-form',
link: '/skule-hunt-judge-form',
authScopes: [
'scunt:exec allow leaderboard',
'scunt:exec allow missions page',
Expand All @@ -98,7 +98,7 @@ export const ProfilePageLeaderPermissionDashboardLinks = () => {
{
label: 'Skule™ Hunt Mission Panel',
anyRegisterScope: false,
link: '/scunt-missions-dashboard',
link: '/skule-hunt-missions-dashboard',
authScopes: [
'scunt:exec show missions',
'scunt:exec hide missions',
Expand All @@ -109,13 +109,13 @@ export const ProfilePageLeaderPermissionDashboardLinks = () => {
{
label: 'Skule™ Hunt Point Transactions',
anyRegisterScope: false,
link: '/scunt-transactions',
link: '/skule-hunt-transactions',
authScopes: ['scunt:exec view transactions'],
},
{
label: 'Skule™ Hunt Settings',
anyRegisterScope: false,
link: '/scunt-game-controls',
link: '/skule-hunt-game-controls',
authScopes: ['scunt:exec game controls'],
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const ProfilePageQRScanner = ({ scopes }) => {

return (
<div className="profile-page-qr-code-scanner profile-page-side-section">
<h2 className="profile-page-manual-entry-header">{`Scanning for ${scannerType}`}</h2>
<h2 className="profile-page-manual-entry-header">{`SCANNING FOR ${scannerType.toUpperCase()}`}</h2>
<QRScannerDisplay
setScannedData={(userID) => {
if (userID) {
Expand Down Expand Up @@ -174,7 +174,7 @@ export const ProfilePageQRScanner = ({ scopes }) => {

{/* Manual Search */}

<h2 className="profile-page-manual-entry-header">Manual Entry</h2>
<h2 className="profile-page-manual-entry-header">MANUAL ENTRY</h2>
<div style={{ padding: '0px 10px', width: '100%' }}>
<TextInput
placeholder={'Search by Email, Name, or UtorID'}
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/text/Header/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const Header = ({ text, children, underlineDesktop, underlineMobile }) => {
<>
<div className="header-page-container">
<div className="header-page-subcontainer">
<h2 className="header-page-title">{text}</h2>
<h2 className="header-page-title">{text.toUpperCase()}</h2>
<div
className="header-page-title-underline display-only-desktop"
style={{ width: underlineDesktop }}
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/About/ExecProfile/ExecProfile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ const ScuntJudgeDescription = ({ name, bribes, description }) => {
style={{ textAlign: 'center' }}
>
<div className="exec-profile-title-cont" style={{ marginBottom: '10px' }}>
<h3 className="exec-profile-name">{name}</h3>
<h3 className="exec-profile-name">{name.toUpperCase()}</h3>
</div>

{description !== undefined ? (
Expand Down
1 change: 1 addition & 0 deletions client/src/pages/FAQLeaders/FAQLeaders.scss
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
}

.faq-leaders-questions-titles {
font-family: 'Proxima Nova', sans-serif;
font-size: 23px;
margin-bottom: 10px;
color: var(--text-dark-use);
Expand Down
154 changes: 121 additions & 33 deletions client/src/pages/FroshRetreat/FroshRetreat.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,34 @@ import { useSelector } from 'react-redux';
import { RadioButtons } from '../../components/form/RadioButtons/RadioButtons';
import { ErrorSuccessBox } from '../../components/containers/ErrorSuccessBox/ErrorSuccessBox';
import { SnackbarContext } from '../../util/SnackbarProvider';
import waiverPDF from '../../assets/retreatWaiver/frosh-retreat-2T3-waiver.pdf';
import waiverPDF from '../../assets/retreatWaiver/frosh-retreat-2T4-waiver.pdf';
import useAxios from '../../hooks/useAxios';
import { SingleAccordion } from '../../components/text/Accordion/SingleAccordion/SingleAccordion';
import egglinton from '../../assets/mascots/Egglinton-1.png';
import dragon from '../../assets/mascots/dragon-retreat.svg';

export const FroshRetreat = () => {
const [remainingTickets, setRemainingTickets] = useState();
const { setSnackbar } = useContext(SnackbarContext);
const navigate = useNavigate();
const isRegistered = useSelector(registeredSelector);
const { user } = useSelector(userSelector);
const accountObj = {
firstName: user.firstName || '',
lastName: user.lastName || '',
preferredName: user.preferredName || '',
phoneNumber: user.phoneNumber || '',
phoneNumberCountryCode: user.phoneNumberCountryCode || '',
emergencyContactName: user.emergencyContactName || '',
emergencyContactRelationship: user.emergencyContactRelationship || '',
emergencyContactCountryCode: user.emergencyContactCountryCode || '',
emergencyContactNumber: user.emergencyContactNumber || '',
email: user.email || '',
allergies: user.allergies || [],
allergiesOther: user.allergiesOther || '',
medicalInfo: user.medicalInfo || '',
specficMedicalInfo: user.specficMedicalInfo || '',
medication: user.medication || '',
};

const remainingTicketsSetter = async () => {
setRemainingTickets(await getRemainingTickets(setSnackbar));
Expand All @@ -28,11 +46,11 @@ export const FroshRetreat = () => {
remainingTicketsSetter();
}, []);

useEffect(() => {
if (!isRegistered) {
navigate('/profile');
}
}, [isRegistered]);
// useEffect(() => {
// if (!isRegistered) {
// navigate('/profile');
// }
// }, [isRegistered]);

return (
<div className="frosh-retreat-page">
Expand All @@ -43,15 +61,14 @@ export const FroshRetreat = () => {
ESCAPE THE CITY TO THE LOVELY HART HOUSE FARMS FOR A WEEKEND OF WHOLESOME CAMP VIBES!
</h3>
<p style={{ color: 'var(--white)' }}>
The retreat is taking place on August 31st and September 1st, 2024 at Hart House
Farm.
The retreat is taking place on August 31st and September 1st, 2024 at Hart House Farm.
</p>
<p style={{ color: 'var(--white)' }}>
Due to limited spaces, we are selling a limited number of tickets so purchase yours
before they sell out!{' '}
</p>
<p style={{ color: 'var(--white)' }}>
Tickets to Retreat are $95.00 &#40;they include bus transportation; no tickets without
Tickets to Retreat are $103.00 &#40;they include bus transportation; no tickets without
bus transportation&#41;
</p>
</div>
Expand Down Expand Up @@ -113,6 +130,13 @@ const retreatFAQs = [
'• Anything appropriate for a 36-hour camping trip on a farm!',
],
},
{
title:
'What time does the bus leave?',
description: [
'The bus leaves from campus at 11:00am on August 31st and returns to campus at 1:00pm on September 1st.',
],
}
];

const FroshRetreatFAQ = () => {
Expand All @@ -130,9 +154,9 @@ const FroshRetreatFAQ = () => {
alignSelf: 'center',
}}
>
<img src={egglinton} style={{ width: '200px', margin: '20px' }}></img>
<img src={dragon} style={{ width: '350px', margin: '20px' }}></img>
<h2 style={{ marginBottom: '20px' }}>
GET MOO-VING WITH OUR FAQS: PREPARE FOR A GOOD TIME DOWN ON THE FARM!
FAQS: PREPARE FOR A GOOD TIME DOWN ON THE FARM!
</h2>
{retreatFAQs.map((item, index) => {
const [isOpen, setIsOpen] = useState(false);
Expand Down Expand Up @@ -187,13 +211,18 @@ const RetreatRegistration = () => {
const [viewedWaiver, setViewedWaiver] = useState(false);
const [waiverValue, setWaiverValue] = useState();
const [buttonClicked, setButtonClicked] = useState(false);
const isRegistered = useSelector(registeredSelector);

const waiverLink = '../../assests/retreatWaiver/frosh-retreat-2T3-waiver.pdf';
const waiverLink = '../../assests/retreatWaiver/frosh-retreat-2T4-waiver.pdf';

const { user } = useSelector(userSelector);
const { setSnackbar } = useContext(SnackbarContext);
const { axios } = useAxios();
const isRetreat = user?.isRetreat === true;
const isWaiverUploaded = user?.waiver?.filename !== undefined;

const [file, setFile] = useState(null);
const [isUploaded, setIsUploaded] = useState(false);

const [outOfTickets, setOutOfTickets] = useState(false);

Expand All @@ -205,12 +234,61 @@ const RetreatRegistration = () => {
outOfTicketsSetter();
}, []);

useEffect(() => {
if (isWaiverUploaded) {
setViewedWaiver(true);
setIsUploaded(true);
}
}, [isWaiverUploaded]);

const handleFileChange = (event) => {
setFile(event.target.files[0]);
};

const handleUpload = async () => {
if (!file) {
setSnackbar('Please select a PDF file to upload.');
return;
}
const formData = new FormData();
formData.append('waiver', file);
formData.append('username', user.firstName);

try {
const response = await axios.post('/frosh/upload-waiver', formData, {
headers: { 'content-type': 'multipart/form-data' },
});
setSnackbar('File uploaded successfully!');
setIsUploaded(true);
} catch (error) {
console.error('File upload failed:', error);
setSnackbar('File upload failed. Please try again.');
setIsUploaded(false);
}
};

const handleViewWaiver = async () => {
try {
const { axios } = useAxios();
const response = await axios.get(`/frosh/view-waiver/`, {
responseType: 'blob', // handling binary data
});
const blob = new Blob([response.data], { type: 'application/pdf' });
const url = window.URL.createObjectURL(blob);
window.open(url);
} catch (e) {
console.error(e);
setSnackbar('Error viewing waiver', true);
}
};

return (
<div style={{ margin: '0 20px' }}>
<p style={{ textAlign: 'center' }}>
In order to register, the following information will be collected from your account. Please
ensure this information is accurate and up to date. If any information needs to be modified,
please edit your information <Link to={'/profile-edit'}>here</Link>.
please edit your information{' '}
<Link to={isRegistered ? '/profile-edit' : '/profile-edit-unregistered'}>here</Link>.
</p>
<div className="retreat-registration-form">
<div className="display-field">
Expand Down Expand Up @@ -267,37 +345,47 @@ const RetreatRegistration = () => {
}}
style={{ marginBottom: '25px' }}
/>
<h3>I HAVE READ AND AGREE TO THE FROSH RETREAT WAIVER.</h3>
<h4>
<i>
By pressing &apos;Yes&apos; you/a guardian if you are under 18 have digitally signed
the waiver.
</i>
</h4>
<div style={{ height: '10px' }} />
{viewedWaiver ? (
<RadioButtons
initialSelectedIndex={1}
values={['Yes', 'No']}
onSelected={(value) => {
setWaiverValue(value);
if (value === 'Yes') setSnackbar('Thanks for reading the waiver!');
}}

<div className="display-field">
<h3>UPLOAD SIGNED WAIVER:</h3>
<p>Only PDF files under 1 MB are accepted</p>
{viewedWaiver ? (
<>
<input type="file" accept=".pdf" onChange={handleFileChange} />
<Button
label="Upload PDF"
isSecondary
onClick={handleUpload}
style={{ marginTop: '10px' }}
/>
</>
) : (
<p>Please view the waiver before uploading the signed copy.</p>
)}
</div>

{isWaiverUploaded ? (
<Button
label="View Uploaded Waiver"
isSecondary
onClick={handleViewWaiver}
style={{ marginBottom: '25px' }}
/>
) : (
<></>
)}
</div>

{isRetreat ? (
<h2>You have already payed for Frosh Retreat!</h2>
<h2>You have already paid for Frosh Retreat!</h2>
) : outOfTickets ? (
<h2>Sorry there are no more tickets available!</h2>
) : viewedWaiver ? (
<Button
label={'Continue to Payment'}
isDisabled={waiverValue !== 'Yes' || buttonClicked}
isDisabled={!isUploaded || buttonClicked}
onClick={() => {
if (waiverValue === 'Yes') {
if (isUploaded) {
setButtonClicked(true);
axios
.post('/payment/frosh-retreat-payment')
Expand Down
4 changes: 2 additions & 2 deletions client/src/pages/PagePaymentSuccess/PagePaymentSuccess.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ export const PagePaymentSuccess = ({ title, message }) => {
<>
<div className="navbar-space-top"></div>
<div className="payment-success-page">
<h1>{title}</h1>
<h1>{title.toUpperCase()}</h1>
<p>Payment Successful!</p>
<h3>{message}</h3>
<h3 className='proxima-nova-text'>{message}</h3>
<div>
<Link to={'/profile'} className="no-link-style">
<Button label="Profile" />
Expand Down
Loading

0 comments on commit ff3ab3d

Please sign in to comment.