diff --git a/src/App.jsx b/src/App.jsx index 875db58..ec2b0be 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -9,7 +9,6 @@ import LandingPage from './pages/LandingPage'; import SponsorPage from './pages/SponsorPage'; import Login from './pages/Login'; import Dashboard from './pages/HackerDashboard'; -import Portal from './pages/Portal'; import CheckIn from './pages/CheckIn'; const router = createBrowserRouter( @@ -17,7 +16,6 @@ const router = createBrowserRouter( } /> } /> - } /> } /> } /> } /> diff --git a/src/assets/fonts/O4b.ttf b/src/assets/fonts/O4b.ttf new file mode 100644 index 0000000..9c2323b Binary files /dev/null and b/src/assets/fonts/O4b.ttf differ diff --git a/src/assets/fonts/fonts.css b/src/assets/fonts/fonts.css index 4616930..24dacab 100644 --- a/src/assets/fonts/fonts.css +++ b/src/assets/fonts/fonts.css @@ -17,3 +17,8 @@ font-family: 'ft88-bold'; src: url('./FT88-Bold.otf') format('opentype'); } + +@font-face { + font-family: 'O4b'; + src: url('./O4b.ttf'); +} diff --git a/src/assets/images/HackerDashboard/Accepted.png b/src/assets/images/HackerDashboard/Accepted.png new file mode 100644 index 0000000..c96a07a Binary files /dev/null and b/src/assets/images/HackerDashboard/Accepted.png differ diff --git a/src/assets/images/HackerDashboard/CheckedIn.png b/src/assets/images/HackerDashboard/CheckedIn.png new file mode 100644 index 0000000..b279c54 Binary files /dev/null and b/src/assets/images/HackerDashboard/CheckedIn.png differ diff --git a/src/assets/images/HackerDashboard/Confirmed.png b/src/assets/images/HackerDashboard/Confirmed.png new file mode 100644 index 0000000..8569c6d Binary files /dev/null and b/src/assets/images/HackerDashboard/Confirmed.png differ diff --git a/src/assets/images/HackerDashboard/Declined.png b/src/assets/images/HackerDashboard/Declined.png new file mode 100644 index 0000000..33073f0 Binary files /dev/null and b/src/assets/images/HackerDashboard/Declined.png differ diff --git a/src/assets/images/HackerDashboard/Group 10417.png b/src/assets/images/HackerDashboard/Group 10417.png new file mode 100644 index 0000000..8fbc735 Binary files /dev/null and b/src/assets/images/HackerDashboard/Group 10417.png differ diff --git a/src/assets/images/HackerDashboard/Group 10417.svg b/src/assets/images/HackerDashboard/Group 10417.svg new file mode 100644 index 0000000..8a9f6d8 --- /dev/null +++ b/src/assets/images/HackerDashboard/Group 10417.svg @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/images/HackerDashboard/Llama (Traced).png b/src/assets/images/HackerDashboard/Llama (Traced).png new file mode 100644 index 0000000..0076c3a Binary files /dev/null and b/src/assets/images/HackerDashboard/Llama (Traced).png differ diff --git a/src/assets/images/HackerDashboard/Llama (Traced).svg b/src/assets/images/HackerDashboard/Llama (Traced).svg new file mode 100644 index 0000000..de3aa1c --- /dev/null +++ b/src/assets/images/HackerDashboard/Llama (Traced).svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/images/HackerDashboard/NotStarted.png b/src/assets/images/HackerDashboard/NotStarted.png new file mode 100644 index 0000000..71d1347 Binary files /dev/null and b/src/assets/images/HackerDashboard/NotStarted.png differ diff --git a/src/assets/images/HackerDashboard/PinkPurpleBalloons.png b/src/assets/images/HackerDashboard/PinkPurpleBalloons.png new file mode 100644 index 0000000..e4bae6a Binary files /dev/null and b/src/assets/images/HackerDashboard/PinkPurpleBalloons.png differ diff --git a/src/assets/images/HackerDashboard/PinkPurpleBalloons.svg b/src/assets/images/HackerDashboard/PinkPurpleBalloons.svg new file mode 100644 index 0000000..0d2ba6e --- /dev/null +++ b/src/assets/images/HackerDashboard/PinkPurpleBalloons.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/assets/images/HackerDashboard/Red cloud.png b/src/assets/images/HackerDashboard/Red cloud.png new file mode 100644 index 0000000..3a06906 Binary files /dev/null and b/src/assets/images/HackerDashboard/Red cloud.png differ diff --git a/src/assets/images/HackerDashboard/Red cloud.svg b/src/assets/images/HackerDashboard/Red cloud.svg new file mode 100644 index 0000000..34b03df --- /dev/null +++ b/src/assets/images/HackerDashboard/Red cloud.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/images/HackerDashboard/Rejected.png b/src/assets/images/HackerDashboard/Rejected.png new file mode 100644 index 0000000..244c6ee Binary files /dev/null and b/src/assets/images/HackerDashboard/Rejected.png differ diff --git a/src/assets/images/HackerDashboard/Stars.png b/src/assets/images/HackerDashboard/Stars.png new file mode 100644 index 0000000..7da1cb3 Binary files /dev/null and b/src/assets/images/HackerDashboard/Stars.png differ diff --git a/src/assets/images/HackerDashboard/Stars.svg b/src/assets/images/HackerDashboard/Stars.svg new file mode 100644 index 0000000..270a74e --- /dev/null +++ b/src/assets/images/HackerDashboard/Stars.svg @@ -0,0 +1,398 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/images/HackerDashboard/Submitted.png b/src/assets/images/HackerDashboard/Submitted.png new file mode 100644 index 0000000..7c757e1 Binary files /dev/null and b/src/assets/images/HackerDashboard/Submitted.png differ diff --git a/src/assets/images/HackerDashboard/Waitlisted.png b/src/assets/images/HackerDashboard/Waitlisted.png new file mode 100644 index 0000000..226663a Binary files /dev/null and b/src/assets/images/HackerDashboard/Waitlisted.png differ diff --git a/src/assets/images/HackerDashboard/bush 1.png b/src/assets/images/HackerDashboard/bush 1.png new file mode 100644 index 0000000..9311263 Binary files /dev/null and b/src/assets/images/HackerDashboard/bush 1.png differ diff --git a/src/assets/images/HackerDashboard/bush 1.svg b/src/assets/images/HackerDashboard/bush 1.svg new file mode 100644 index 0000000..073469b --- /dev/null +++ b/src/assets/images/HackerDashboard/bush 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/assets/images/HackerDashboard/orange balloon.png b/src/assets/images/HackerDashboard/orange balloon.png new file mode 100644 index 0000000..df286e2 Binary files /dev/null and b/src/assets/images/HackerDashboard/orange balloon.png differ diff --git a/src/assets/images/HackerDashboard/orange balloon.svg b/src/assets/images/HackerDashboard/orange balloon.svg new file mode 100644 index 0000000..47f3f1e --- /dev/null +++ b/src/assets/images/HackerDashboard/orange balloon.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/components/LandingPageComponents/ApplyButton.jsx b/src/components/LandingPageComponents/ApplyButton.jsx index 609c099..5da573c 100644 --- a/src/components/LandingPageComponents/ApplyButton.jsx +++ b/src/components/LandingPageComponents/ApplyButton.jsx @@ -8,7 +8,7 @@ const ApplyButton = () => { const [image, setImage] = useState(InitialButtonState); const navigate = useNavigate(); const handleClick = () => { - navigate('/portal'); + navigate('/login'); }; return ( diff --git a/src/components/common/CountDownTimer.jsx b/src/components/common/CountDownTimer.jsx index 7c76d26..9e1417e 100644 --- a/src/components/common/CountDownTimer.jsx +++ b/src/components/common/CountDownTimer.jsx @@ -36,9 +36,9 @@ const CountDownTimer = () => { const seconds = Math.floor((timeLeft % (1000 * 60)) / 1000); return ( -
+
-
+
diff --git a/src/pages/Application.jsx b/src/pages/Application.jsx index 0905452..4e1d9a0 100644 --- a/src/pages/Application.jsx +++ b/src/pages/Application.jsx @@ -94,10 +94,6 @@ const Application = ({ applicationId }) => { }; // Display message to user while form is loading / has finished loading. - const [programmingInputs, setProgrammingInputs] = React.useState([ - { language: '', experienceLevel: '' }, - ]); - const [user, loading] = useAuthState(auth); const [resume, setResume] = useState(null); const navigate = useNavigate(); const { @@ -150,7 +146,7 @@ const Application = ({ applicationId }) => { uploadBytes(resumeRef, resume).then(() => { alert('Application Submitted'); - navigate('/'); + navigate('/login'); }); } else { alert('please upload a resume'); @@ -780,12 +776,6 @@ const Application = ({ applicationId }) => { />
- {/* */}
diff --git a/src/pages/HackerDashboard.jsx b/src/pages/HackerDashboard.jsx index 8a89272..ecfbd13 100644 --- a/src/pages/HackerDashboard.jsx +++ b/src/pages/HackerDashboard.jsx @@ -1,59 +1,158 @@ import { useEffect, useState } from 'react'; import { db, auth } from '../firebase/firebase-config'; -import { useAuthState } from "react-firebase-hooks/auth"; -import { useNavigate } from "react-router-dom"; -import { query, collection, getDocs, where } from 'firebase/firestore'; +import { useAuthState } from 'react-firebase-hooks/auth'; +import { useNavigate } from 'react-router-dom'; +import { query, collection, getDocs, where, addDoc } from 'firebase/firestore'; + +import PinkPurpleBaloons from '../assets/images/HackerDashboard/PinkPurpleBalloons.svg'; +import OrangeBalloon from '../assets/images/HackerDashboard/orange balloon.svg'; +import Llama from '../assets/images/HackerDashboard/Llama (Traced).svg'; +import Clouds from '../assets/images/HackerDashboard/Red cloud.png'; +import CounterDownTimer from '../components/common/CountDownTimer'; +import Bush from '../assets/images/HackerDashboard/bush 1.svg'; +import Stars from '../assets/images/HackerDashboard/stars.svg'; +import NotStarted from '../assets/images/HackerDashboard/NotStarted.png'; +import Submitted from '../assets/images/HackerDashboard/Submitted.png'; +import Waitlisted from '../assets/images/HackerDashboard/Waitlisted.png'; +import Rejected from '../assets/images/HackerDashboard/Rejected.png'; +import Accepted from '../assets/images/HackerDashboard/Accepted.png'; +import Confirmed from '../assets/images/HackerDashboard/Confirmed.png'; +import CheckedIn from '../assets/images/HackerDashboard/CheckedIn.png'; +import Declined from '../assets/images/HackerDashboard/Declined.png'; +import Logo from '../assets/images/bhacks-logo.svg'; +import Application from './Application'; const HackerDashboard = () => { const [user, loading] = useAuthState(auth); - const [application, setApplication] = useState({}); + const [application, setApplication] = useState(null); const navigate = useNavigate(); // const applicationTypes = ["Submitted", "Waitlisted", "Rejected", "Declined", "Confirmed", "Accepted", "Checked In"]; useEffect(() => { if (loading) return; - if (!user) return navigate("/login"); + if (!user) return navigate('/login'); - fetchApplications(); + var intervalId = window.setInterval(function () { + fetchApplication(intervalId); + }, 1000); }, [user, loading, navigate]); if (!user) return null; // Grabs the application and sets the variable - const fetchApplications = async () => { + const fetchApplication = async (intervalId) => { try { - const q = query(collection(db, "applications"), where("uid", "==", user.uid)); + const q = query( + collection(db, 'applications'), + where('uid', '==', user?.uid) + ); const doc = await getDocs(q); - - if (doc.docs.length != 0) { - setApplication(doc.docs[0].data()) + if (doc.docs.length !== 0) { + setApplication({ ...doc.docs[0].data(), id: doc.docs[0].id }); + clearInterval(intervalId); } - + } catch (err) { + console.error(err); + alert('An error occured while fetching user data'); + } + }; + // Function to sign the user out and redirect to the landing page + const signOutAndRedirect = async () => { + try { + await auth.signOut(); + navigate('/'); } catch (error) { - console.log(error); - alert("An error has occurred fetching user data"); + console.error('Error signing out:', error); } - } + }; - return ( -
-
- Welcome Hacker {application ? application.name : 'Loading...'} -
- -
- Your Status: {application.status} -
+ const ImageSelect = (status) => { + switch (status) { + case 'Not Started': + return NotStarted; + case 'Submitted': + return Submitted; + case 'Rejected': + return Rejected; + case 'Accepted': + return Accepted; + case 'Waitlisted': + return Waitlisted; + case 'Declined': + return Declined; + case 'Confirmed': + return Confirmed; + case 'CheckedIn': + return CheckedIn; + } + }; + + return !application ? ( +
+ Loading... +
+ ) : application.status === 'Not Started' ? ( + + ) : ( +
+ + {/* Sign-out button */} - {/* If application is not finished we navigate them to the form page */} - {application.status === 'Not Started' && ( - // Edit to navigate to form page - )} + +
+
+ WELCOME HACKER {application ? application.firstName : 'Loading...'}! +
YOUR STATUS: {application.status}
+
+
+ +
+ +
+
+
+ UNTIL BOSTONHACKS! +
+
+ + + +
+
+ +
+ + +
); }; diff --git a/src/pages/Login.jsx b/src/pages/Login.jsx index f72c2a0..74d7177 100644 --- a/src/pages/Login.jsx +++ b/src/pages/Login.jsx @@ -12,7 +12,7 @@ export default function Login() { useEffect(() => { if (loading) return; - if (user) navigate('/portal'); + if (user) navigate('/dashboard'); }, [user, loading, navigate]); return ( diff --git a/tailwind.config.js b/tailwind.config.js index b233b5f..fbef9a5 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -12,6 +12,7 @@ export default { minecraft: ['minecraft', 'serif'], ft88: ['ft88-reg', 'serif'], ft88b: ['ft88-bold', 'serif'], + O4b: ['O4b', 'serif'], }, colors: { 'text-primary': '#FFFFFF', //"#FFFFFF" add this when we don't have a white background @@ -36,7 +37,7 @@ export default { }, listStyleImage: { goldKey: 'url("/src/assets/images/SponsorPage/PerksAssets/GoldKey.svg")', - } + }, }, plugins: [], };