Skip to content

Commit

Permalink
added resume url
Browse files Browse the repository at this point in the history
  • Loading branch information
danielyu12 committed Sep 26, 2023
1 parent c01c181 commit 4f37c4d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const router = createBrowserRouter(
<Route path="/">
<Route index element={<LandingPage />} />
<Route path="sponsor" element={<SponsorPage />} />
{/* <Route path="portal" element={<Portal />} /> */}
<Route path="portal" element={<Portal />} />
<Route path="login" element={<Login />} />
<Route path="dashboard" element={<Dashboard />} />
</Route>
Expand Down
27 changes: 13 additions & 14 deletions src/pages/Application.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useNavigate } from 'react-router-dom';
import { auth, db, storage } from '../firebase/firebase-config';
import { useAuthState } from 'react-firebase-hooks/auth';
import { doc, updateDoc } from 'firebase/firestore';
import { ref, uploadBytes } from 'firebase/storage';
import { ref, uploadBytes, getDownloadURL } from 'firebase/storage';

import { useForm, Controller } from 'react-hook-form';
import Select from 'react-select';
Expand Down Expand Up @@ -146,8 +146,12 @@ const Application = ({ applicationId }) => {

if (resume != null) {
const resumeRef = ref(storage, `${applicationId}`);
const resumeURL = await getDownloadURL(resumeRef);
console.log(resumeURL);
uploadBytes(resumeRef, resume).then(() => {
navigate('/login');
updateDoc(userDoc, {
resumeURL: resumeURL,
}).then(navigate('/login'));
});
} else {
alert('please upload a resume');
Expand Down Expand Up @@ -658,14 +662,12 @@ const Application = ({ applicationId }) => {
render={({ field }) => (
<Select
styles={selectFieldStyles}
options={sleepAccomodations.map(
(sleepOption) => {
return {
label: sleepOption,
value: sleepOption,
};
}
)}
options={sleepAccomodations.map((sleepOption) => {
return {
label: sleepOption,
value: sleepOption,
};
})}
{...field}
/>
)}
Expand Down Expand Up @@ -807,9 +809,6 @@ const Application = ({ applicationId }) => {
</div>
</div>




<hr className="border border-black w-3/4 mx-auto" />

<div className="my-[50px]">
Expand All @@ -827,7 +826,7 @@ const Application = ({ applicationId }) => {
</div>
<div className="w-full flex justify-end">
<input
style={{ backgroundImage: "url(" + RegisterButton + ")"}}
style={{ backgroundImage: 'url(' + RegisterButton + ')' }}
type="submit"
className="cursor-pointer w-[150px] h-[75px] bg-contain bg-no-repeat"
value=""
Expand Down

0 comments on commit 4f37c4d

Please sign in to comment.