Skip to content

COmmited #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/pages/Cultural.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const Cultural = () => {
const [events, setEvents] = useState([]);
const [curEvents,setCurEvents]=useState([]);
const options = [
{value:"All",label:"All"},
{ value: "General Events", label: "General Events" },
{ value: "Dance", label: "Dance" },
{ value: "Music", label: "Music" },
Expand All @@ -25,7 +26,7 @@ const Cultural = () => {
{ value: "Art", label: "Art" },
{ value: "Cookery", label: "Cookery" },
{ value: "Movie/Anime", label: "Movie/Anime" },
{value:"All",label:"All"}

];
useEffect(() => {
const getData = async () => {
Expand All @@ -37,8 +38,8 @@ const Cultural = () => {
id: docData.id,
};
});
setEvents(newData.filter((event) => event.cat === "Cultural"||event.cat === "cultural"));
setCurEvents(newData.filter((event) => event.cat === "Cultural"||event.cat === "cultural"));
setEvents(newData.filter((event) => event.cat.trim() === "Cultural"||event.cat.trim() === "cultural"));
setCurEvents(newData.filter((event) => event.cat.trim() === "Cultural"||event.cat.trim() === "cultural"));
// Assuming wait is a custom function or you meant to use setTimeout here
setTimeout(() => setLoaded(true), 1000);
});
Expand All @@ -58,7 +59,7 @@ const Cultural = () => {


return (
<div className="bg-cover bg-fixed bg-no-repeat h-auto min-h-screen bg-gradient-to-b from-gray-900 to-black w-full px-5">
<div className="bg-cover bg-fixed bg-no-repeat h-auto min-h-screen bg-[url('https://firebasestorage.googleapis.com/v0/b/sampkle.appspot.com/o/Signupbg.jpeg?alt=media&token=94bfbc88-78f6-4c8a-a749-19fcb76fe493')] w-full px-5">
<div className="flex justify-center items-center pt-32">
<h1 className="text-white text-6xl font-pop sm:text-7xl tracking-widest">
CULTURAL
Expand Down
54 changes: 38 additions & 16 deletions src/pages/EventDescPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { displayRazorpay } from "../razorpay/razorpay";
const EventPage = () => {
const [eventData, setEventData] = useState(null);
const { id } = useParams();
const [registering,setRegistering] = useState(false)
const [registering, setRegistering] = useState(false);
const [newMemberName, setNewMemberName] = useState("");

const [refCode, setRefcode] = useState(null);
Expand Down Expand Up @@ -115,6 +115,7 @@ const EventPage = () => {
const proceedToPay = async () => {



if(agreeToTerms===true)
{
if (
Expand All @@ -124,18 +125,21 @@ const EventPage = () => {
) {
getUserByEmail(currentUser.email).then((userData) => {
const token = {

uid: userData.id,
nkid: userData.NKID,
email:userData.email,
email: userData.email,
username: userData.name,
amount: eventData.regfee*100,
amount: eventData.regfee * 100,
eventid: eventData.id,
eventname: eventData.name,
phone: userData.phoneNumber,
ref: refCode ? refCode : "nor",
team:eventData.type.toLowerCase() === "team" ? team.toString() : null,
team:
eventData.type.toLowerCase() === "team" ? team.toString() : null,
};
setRegistering(true);

displayRazorpay(token,nav);
});
} else {
Expand All @@ -148,6 +152,7 @@ const EventPage = () => {
{
alert("Read the rules and regulations")


}
};

Expand Down Expand Up @@ -176,7 +181,7 @@ const EventPage = () => {
if (!eventData) return <div className="text-center p-10">Loading...</div>;

return (
<div className="max-w-7xl mx-auto px-4 py-8">
<div className="max-w-7xl mx-auto px-4 py-8 bg-cover bg-fixed bg-no-repeat h-auto min-h-screen bg-[url('https://firebasestorage.googleapis.com/v0/b/sampkle.appspot.com/o/Signupbg.jpeg?alt=media&token=94bfbc88-78f6-4c8a-a749-19fcb76fe493')] w-full px-5">
<div className="flex flex-col md:flex-row gap-8 mt-24">
{/* Image Container */}
<div className="flex-1">
Expand Down Expand Up @@ -234,10 +239,22 @@ const EventPage = () => {
{eventData.prizes.map((prize, index) => (
<div key={index} className="mb-2">
<div className="font-medium font-pop">
{prize.title === "1st" && <TrophyIcon className="text-yellow-500 inline" size={32} />}
{prize.title === "2nd" && <TrophyIcon className="text-gray-400 inline" size={32} />}
{prize.title === "3rd" && <TrophyIcon className="text-orange-400 inline" size={32} />}
{(prize.title !== "1st" && prize.title !== "2nd" && prize.title !== "3rd") || prize.title} {prize.amt}

{prize.title === "1st" && (
<TrophyIcon className="text-yellow-500 inline" size={32} />
)}
{prize.title === "2nd" && (
<TrophyIcon className="text-gray-400 inline" size={32} />
)}
{prize.title === "3rd" && (
<TrophyIcon className="text-orange-400 inline" size={32} />
)}
{prize.title !== "1st" ||
prize.title !== "2nd" ||
prize.title !== "3rd" ||
prize.title}{" "}
{prize.amt}

</div>
</div>
))}
Expand Down Expand Up @@ -292,6 +309,7 @@ const EventPage = () => {
Register
</h2>
<div className="flex flex-col md:flex-row gap-4">

{currentUser ? (
<>
{needSignUp ? (
Expand All @@ -301,6 +319,7 @@ const EventPage = () => {
onClick={() => {
nav(`/signup?redirect=/events/cultural/${id}`);
}}

>
SignUp to register
</button>
Expand Down Expand Up @@ -407,35 +426,38 @@ const EventPage = () => {


<div className="w-full flex flex-col justify-center gap-6">
<div className="font-pop text-white mt-7">REFERRAL CODE</div>
<div className="flex w-72 flex-col gap-6">
<div className="font-pop text-white mt-7">
REFERRAL CODE
</div>
<div className="flex flex-col gap-6 w-full sm:w-72">
<input
type="text"
value={refCode}
onChange={handleRefCodeChange}
className="text-white font-pop py-2 px-4 rounded"
className="text-white font-pop py-2 px-4 rounded "
placeholder="Enter referral code"
/>
</div>
</div>

<button
className="bg-blue-500 mt-3 hover:bg-blue-700 font-pop w-72 text-white font-bold py-2 px-4 rounded"
className="bg-blue-500 mt-3 hover:bg-blue-700 font-pop w-full px-5 sm:w-72 text-white font-bold py-2 px-4 rounded"
disabled={registering}
onClick={() => {

proceedToPay();
}}
>
{registering ? "Registering, May take time ..":"Register"}
{registering
? "Registering, May take time .."
: "Register"}
</button>
</div>
)}
</>
) : (
<>
<button
className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"
className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 rounded w-full px-5 sm:w-72"
onClick={() => {
handleSignIn();
}}
Expand Down
36 changes: 17 additions & 19 deletions src/pages/EventsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ function EventsPage() {
nav(page);
};
return (
<div className="upper-section bg-cover bg-no-repeat bg-fixed bg-center h-full bg-gradient-to-b from-gray-900 to-black ">
<div className="upper-section bg-cover bg-no-repeat bg-fixed bg-center h-full bg-[url('https://firebasestorage.googleapis.com/v0/b/sampkle.appspot.com/o/Signupbg.jpeg?alt=media&token=94bfbc88-78f6-4c8a-a749-19fcb76fe493')] ">
<div className="justify-evenly align-middle flex w-2/3 sm:w-1/3 mx-auto">
<h1 className="text-white font-pop text-7xl sm:text-8xl mt-24">E</h1>
<h1 className="text-white font-pop text-7xl sm:text-8xl mt-24">V</h1>
<h1 className="text-white font-pop text-7xl sm:text-8xl mt-24">E</h1>
<h1 className="text-white font-pop text-7xl sm:text-8xl mt-24">N</h1>
<h1 className="text-white font-pop text-7xl sm:text-8xl mt-24">T</h1>
<h1 className="text-white font-pop text-7xl sm:text-8xl mt-24">S </h1>
<h1 className="text-white font-neu text-7xl sm:text-8xl mt-24">E</h1>
<h1 className="text-white font-neu text-7xl sm:text-8xl mt-24">V</h1>
<h1 className="text-white font-neu text-7xl sm:text-8xl mt-24">E</h1>
<h1 className="text-white font-neu text-7xl sm:text-8xl mt-24">N</h1>
<h1 className="text-white font-neu text-7xl sm:text-8xl mt-24">T</h1>
<h1 className="text-white font-neu text-7xl sm:text-8xl mt-24">S </h1>
</div>
<div className="flex flex-col lg:flex-row mt-16 align-middle lg:justify-around h-1/3">
<div></div>
Expand All @@ -25,11 +25,11 @@ function EventsPage() {
}}
>
<div className=" hover:scale-110 transition duration-200 cursor-pointer rounded-2xl">
<img
src="https://firebasestorage.googleapis.com/v0/b/sampkle.appspot.com/o/CULTURAL%20EVENTS-1.png?alt=media&token=48777f84-42c5-4097-9aeb-160858e5d8ef"
alt="event"
className="rounded-2xl"
/>
<img
src="https://firebasestorage.googleapis.com/v0/b/nakshatra-9c45c.appspot.com/o/CULTURAL%20EVENTS-1.jpg?alt=media&token=88369d0a-6c34-48b1-850c-cb82d1362780"
alt="event"
className="rounded-2xl"
/>
</div>
</div>
<div
Expand All @@ -39,13 +39,11 @@ function EventsPage() {
}}
>
<div className=" hover:scale-110 transition duration-200 cursor-pointer rounded-2xl">

<img
src="https://firebasestorage.googleapis.com/v0/b/sampkle.appspot.com/o/Technical%20Events.png?alt=media&token=f0dfb5e8-dee8-4d0e-a307-642b8b8e3cbc"
alt="event"
className=" rounded-2xl"
/>

<img
src="https://firebasestorage.googleapis.com/v0/b/nakshatra-9c45c.appspot.com/o/Technical%20Events-min.png?alt=media&token=0d244ed6-3ceb-41f1-8eab-ec6b43aec7ed"
alt="event"
className=" rounded-2xl"
/>
</div>
</div>
<div></div>
Expand Down
14 changes: 8 additions & 6 deletions src/pages/Technical.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ const Technical = () => {
const [events, setEvents] = useState([]);
const [curEvents,setCurEvents]=useState([]);
const options = [
{ value: "All", label: "All" },
{ value: "Competition", label: "Competition" },
{ value: "Workshop", label: "Workshop" },
{ value: "All", label: "All" },

];
useEffect(() => {
const getData = async () => {
Expand All @@ -29,7 +30,8 @@ const Technical = () => {
id: docData.id,
};
});
setEvents(newData.filter((event) => event.cat === "Technical"||event.cat === "technical"));
setEvents(newData.filter((event) => event.cat === "Technical" || event.cat === "technical"));
setCurEvents(newData.filter((event) => event.cat === "Technical" || event.cat === "technical"));
setTimeout(() => setLoaded(true), 1000);
});
};
Expand All @@ -45,7 +47,7 @@ const Technical = () => {
}
}
return (
<div className="bg-cover bg-fixed bg-no-repeat h-auto min-h-screen bg-gradient-to-b from-gray-900 to-black w-full px-5">
<div className="bg-cover bg-fixed bg-no-repeat h-auto min-h-screen bg-[url('https://firebasestorage.googleapis.com/v0/b/sampkle.appspot.com/o/Signupbg.jpeg?alt=media&token=94bfbc88-78f6-4c8a-a749-19fcb76fe493')] w-full px-5">
<div className="flex justify-center items-center pt-32">
<h1 className="text-white text-6xl font-pop sm:text-7xl tracking-widest">
TECHNICAL
Expand Down Expand Up @@ -78,17 +80,17 @@ const Technical = () => {
<div className="flex flex-wrap justify-center mx-4 my-12">
{loaded ? (
curEvents.map((event, index) => (
<Suspense fallback={<Loader />} key={index}>

<div className="hover:scale-110 transition duration-200 cursor-pointer rounded-2xl m-4" onClick={() => nav(`/events/cultural/${event.id}`)}>
<div class="max-w-sm rounded-lg overflow-hidden shadow-lg bg-white">
<img
class="w-full h-fit"
src={event.imgurl}
alt={`${event.type}`}
alt={event.id}
/>
</div>
</div>
</Suspense>

))
) : (
<div className="text-center">{/* Loader Placeholder */}</div>
Expand Down