mirror of
https://github.com/UofCBaja/BajaUofCWebsite.git
synced 2025-06-16 05:44:17 -06:00
feat(Interview Booking): Removed Header, added starting info, added test API
This commit is contained in:
parent
9a139619e3
commit
0bbca385e3
@ -1,5 +1,5 @@
|
|||||||
import InterviewForm from "./InterviewForm";
|
import InterviewForm from "./InterviewForm";
|
||||||
|
import logo from "../Header/logo.webp";
|
||||||
/**
|
/**
|
||||||
* @param {null} null - requires onthing
|
* @param {null} null - requires onthing
|
||||||
* @returns {JSX.Element} Page - HTML tags and JS functionality
|
* @returns {JSX.Element} Page - HTML tags and JS functionality
|
||||||
@ -10,6 +10,9 @@ import InterviewForm from "./InterviewForm";
|
|||||||
const InterviewBooking = () => {
|
const InterviewBooking = () => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<img id="logo" src={logo} alt="Schulich Off-Road's logo" />
|
||||||
|
<h1>UofC Baja Interview Form</h1>
|
||||||
|
<p>Please kindly fill out the form and our team will contact you.</p>
|
||||||
<InterviewForm />
|
<InterviewForm />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
@ -1,16 +1,29 @@
|
|||||||
import { useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
const InterviewForm = () => {
|
const InterviewForm = () => {
|
||||||
const [isButtonDisabled, setIsButtonDisabled] = useState(false);
|
const [isButtonDisabled, setIsButtonDisabled] = useState(false);
|
||||||
|
useEffect(() => {
|
||||||
|
test();
|
||||||
|
}, []);
|
||||||
const formsubmit = async (event) => {
|
const formsubmit = async (event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
setIsButtonDisabled(true);
|
setIsButtonDisabled(true);
|
||||||
await new Promise((res) => setTimeout(res, 10000));
|
await new Promise((res) => setTimeout(res, 1000));
|
||||||
const formData = new FormData(event.target);
|
const formData = new FormData(event.target);
|
||||||
const formObject = Object.fromEntries(formData.entries());
|
const formObject = Object.fromEntries(formData.entries());
|
||||||
await console.log("Form Data:", formObject);
|
await console.log("Form Data:", formObject);
|
||||||
setIsButtonDisabled(false);
|
setIsButtonDisabled(false);
|
||||||
};
|
};
|
||||||
|
const test = async () => {
|
||||||
|
const res = await fetch(
|
||||||
|
// "https://bajabackend.bajacloud.duckdns.org/getAppointments",
|
||||||
|
"https://randomfox.ca/floof",
|
||||||
|
{ method: "GET" }
|
||||||
|
);
|
||||||
|
let json = await res.json();
|
||||||
|
await console.log(json);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<form onSubmit={formsubmit}>
|
<form onSubmit={formsubmit}>
|
||||||
@ -27,6 +40,7 @@ const InterviewForm = () => {
|
|||||||
Submit
|
Submit
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
<button onClick={test}> test</button>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -24,8 +24,8 @@ root.render(
|
|||||||
<Route path="/JoinTheClub" element={<JoinTheClub />}></Route>
|
<Route path="/JoinTheClub" element={<JoinTheClub />}></Route>
|
||||||
<Route path="/UpcomingEvents" element={<UpcomingEvents />}></Route>
|
<Route path="/UpcomingEvents" element={<UpcomingEvents />}></Route>
|
||||||
<Route path="/Gallery" element={<Gallery />}></Route>
|
<Route path="/Gallery" element={<Gallery />}></Route>
|
||||||
<Route path="/InterviewBooking" element={<InterviewBooking />} />
|
|
||||||
</Route>
|
</Route>
|
||||||
|
<Route path="/InterviewBooking" element={<InterviewBooking />} />
|
||||||
</Routes>
|
</Routes>
|
||||||
</BrowserRouter>
|
</BrowserRouter>
|
||||||
</React.StrictMode>
|
</React.StrictMode>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user