feat(Interview Booking): Removed Header, added starting info, added test API

This commit is contained in:
HamodiGit 2025-01-25 11:19:44 -07:00
parent 9a139619e3
commit 0bbca385e3
3 changed files with 21 additions and 4 deletions

View File

@ -1,5 +1,5 @@
import InterviewForm from "./InterviewForm";
import logo from "../Header/logo.webp";
/**
* @param {null} null - requires onthing
* @returns {JSX.Element} Page - HTML tags and JS functionality
@ -10,6 +10,9 @@ import InterviewForm from "./InterviewForm";
const InterviewBooking = () => {
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 />
</>
);

View File

@ -1,16 +1,29 @@
import { useState } from "react";
import { useEffect, useState } from "react";
const InterviewForm = () => {
const [isButtonDisabled, setIsButtonDisabled] = useState(false);
useEffect(() => {
test();
}, []);
const formsubmit = async (event) => {
event.preventDefault();
setIsButtonDisabled(true);
await new Promise((res) => setTimeout(res, 10000));
await new Promise((res) => setTimeout(res, 1000));
const formData = new FormData(event.target);
const formObject = Object.fromEntries(formData.entries());
await console.log("Form Data:", formObject);
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 (
<>
<form onSubmit={formsubmit}>
@ -27,6 +40,7 @@ const InterviewForm = () => {
Submit
</button>
</form>
<button onClick={test}> test</button>
</>
);
};

View File

@ -24,8 +24,8 @@ root.render(
<Route path="/JoinTheClub" element={<JoinTheClub />}></Route>
<Route path="/UpcomingEvents" element={<UpcomingEvents />}></Route>
<Route path="/Gallery" element={<Gallery />}></Route>
<Route path="/InterviewBooking" element={<InterviewBooking />} />
</Route>
<Route path="/InterviewBooking" element={<InterviewBooking />} />
</Routes>
</BrowserRouter>
</React.StrictMode>