-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
261 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* eslint-disable react/prop-types */ | ||
import formatDate from "../utils/formatDate"; | ||
|
||
const RegistrationCard = ({ event }) => { | ||
const date = formatDate(event.createdAt); | ||
|
||
return ( | ||
<div className="flex flex-col gap-2 items-center bg-green-500/30 backdrop-blur-lg p-3 rounded-lg shadow-lg border border-green-500/20 hover:border-4"> | ||
<img src="logo.png" alt="logo" className="w-[300px] h-[70px]" /> | ||
<img src={event.image_url} alt={event.product_id} className="w-[250px] h-[220px] rounded-md" /> | ||
|
||
<div className="flex flex-col gap-1 items-center justify-center"> | ||
<span className="text-lg font-semibold text-gray-700">{event.club} presents</span> | ||
<span className="text-xl font-bold">{event.name}</span> | ||
<span className="text-gray-600 font-semibold">{event.desc}</span> | ||
<span className="text-gray-600">{event.institute}</span> | ||
<span className="text-gray-600 font-semibold text-lg">Team Details</span> | ||
<span className="text-gray-600">{event.team_name}</span> | ||
<span className="text-gray-600">{event.team_lead_name}</span> | ||
<span className="text-gray-600">{event.team_lead_phone}</span> | ||
<span className="text-gray-600">Team Strength: {event.members.length}</span> | ||
<span className="text-gray-600">Date of Purchase: {date}</span> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default RegistrationCard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { motion } from 'framer-motion'; | ||
|
||
const Spinner = () => { | ||
return ( | ||
<div className="flex items-center justify-center h-full"> | ||
<motion.div | ||
animate={{ rotate: 360 }} | ||
transition={{ repeat: Infinity, duration: 1, ease: "linear" }} | ||
className="h-5 w-5 border-t-4 border-blue-300 border-solid rounded-full" | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Spinner; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { useState } from "react"; | ||
import toast from "react-hot-toast"; | ||
import { useAuthContext } from "../context/AuthContext"; | ||
|
||
const useGetMyEvents = () => { | ||
const [loading, setLoading] = useState(); | ||
const apiUrl = import.meta.env.VITE_API_URL; | ||
const { authUser } = useAuthContext() | ||
|
||
const myEvents = async () => { | ||
setLoading(true); | ||
try { | ||
const res = await fetch(`${apiUrl}/events/my-registrations/${authUser._id}`, { | ||
method: "GET", | ||
headers: { | ||
"Content-Type": "application/json" | ||
} | ||
}); | ||
const data = await res.json(); | ||
|
||
if (data.error) { | ||
throw new Error(data.error); | ||
} | ||
|
||
return data; | ||
} catch (error) { | ||
toast.error(error.message); | ||
console.log(error.message); | ||
} finally { | ||
setLoading(false); | ||
} | ||
} | ||
return { loading, myEvents } | ||
} | ||
|
||
export default useGetMyEvents; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.