Skip to content
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

fix eventslist #135

Merged
merged 2 commits into from
Dec 27, 2023
Merged
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
Binary file added public/images/allEventsBackground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions src/components/EditProfileComponenets/UserDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ function UserDetails() {
});
};

// Function to handle interest selection
const handleInterestClick = (interest) => {
const updatedInterests = [...userData.userInterests];
const index = updatedInterests.indexOf(interest);
Expand Down Expand Up @@ -123,7 +122,6 @@ function UserDetails() {
{t("profile.pro")}
</h1>

{/* First Row */}
<div className='grid grid-cols-1 md:grid-cols-2 md:gap-8'>
<div className='flex flex-col mb-4 md:mb-0'>
<label htmlFor='displayName' className='text-lg'>
Expand Down Expand Up @@ -156,7 +154,6 @@ function UserDetails() {
</div>
</div>

{/* Second Row */}
<div className='grid grid-cols-1 md:grid-cols-2 md:gap-8'>
<div className='flex flex-col mb-4 md:mb-0'>
<LocationInput
Expand Down
11 changes: 1 addition & 10 deletions src/components/EditProfileComponenets/updateSignInDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ function UpdateSignInDetailes() {

const handleDelete = async () => {
try {
// Reauthenticate the user with their current credentials, must be done, firebase rules
const credential = EmailAuthProvider.credential(
currentEmail,
currentPassword
Expand All @@ -67,14 +66,12 @@ function UpdateSignInDetailes() {
e.preventDefault();

try {
// Reauthenticate the user with their current credentials, must be done, firebase rules
const credential = EmailAuthProvider.credential(
currentEmail,
currentPassword
);
await reauthenticateWithCredential(user, credential);

//checks if the new password inputs are identical
if (newPassword !== "") {
if (newPassword === confirmPassword) {
await updatePassword(user, newPassword);
Expand All @@ -83,7 +80,6 @@ function UpdateSignInDetailes() {
}
}

// Update the user context with the signed-up user
setUser(user);

if (newPassword !== "") {
Expand Down Expand Up @@ -114,16 +110,13 @@ function UpdateSignInDetailes() {
}
};

//effect for notification
useEffect(() => {
if (successMessage || error) {
// After 5 seconds, remove the success message
const timer = setTimeout(() => {
setError(null);
setSuccessMessage(null);
}, 5000);

// Clear the timer if the component unmounts or if successMessage changes
return () => clearTimeout(timer);
}
}, [successMessage, error]);
Expand All @@ -142,7 +135,6 @@ function UpdateSignInDetailes() {
<span className='flex justify-center text-lg'>
{t("editProfile.CRUDreq")}
</span>
{/* First Row */}
<div className='grid grid-cols-1 md:grid-cols-2 md:gap-x-8'>
<div className='flex flex-col'>
<label
Expand Down Expand Up @@ -175,8 +167,7 @@ function UpdateSignInDetailes() {
/>
</div>
</div>
{/* End First Row */}
{/* Second Row */}

<div className='grid grid-cols-1 md:grid-cols-2 md:gap-x-8'>
<div className='flex flex-col'>
<label htmlFor='newPassword' className='text-black'>
Expand Down
5 changes: 2 additions & 3 deletions src/components/aboutus/AboutUs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const AboutUs = () => {

const team = [
{
avatar: "/images/AboutUs/khalil.jpg",
avatar: "/images/AboutUs/Khalil.jpg",
name: t("Khalil Noui"),
title: t("Web Developer"),
linkedin: "https://www.linkedin.com/in/khalil-noui-pr/",
Expand Down Expand Up @@ -210,7 +210,7 @@ const AboutUs = () => {
</motion.div>
</motion.div>
</section>
{/* Team Section */}

<section>
<hr className='md:w-screen' />

Expand All @@ -229,7 +229,6 @@ const AboutUs = () => {
</div>
</section>

{/* Technologies Used Section */}
<section className='w-full mx-auto px-4 text-center md:px-20 py-20 bg-[url("/images/AboutUs/pc.jpg")] bg-cover'>
<h3 className='text-white text-3xl font-semibold sm:text-4xl'>
{t("Technologies Used")}
Expand Down
4 changes: 2 additions & 2 deletions src/components/createEventPageComponents/CreateEvent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function CreateEvent() {

useEffect(() => {
if (urlsBunch) {
console.log("urlsBunch.....:", urlsBunch);
// console.log("urlsBunch.....:", urlsBunch);
}
}, [urlsBunch]);

Expand Down Expand Up @@ -82,7 +82,7 @@ function CreateEvent() {
e.target.reset();
router.push("/events");
} catch (error) {
console.error("Error:", error);
// console.error("Error:", error);
}
}

Expand Down
3 changes: 0 additions & 3 deletions src/components/eventsPageComponents/BottomSheets.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,13 @@ function BottomSheet({
<div
className={`fixed h-80 rounded-t-lg bottom-0 left-0 right-0 bg-white shadow-lg transform transition-transform duration-300 ${sheetStyles}`}
>
{/* Close button */}
<div
className='flex justify-center h-5 cursor-pointer'
onClick={onClose}
>
<div className=' mt-0 w-[30%] h-2 text-center bg-gray-400 hover:bg-black rounded-xl'></div>
</div>
{/* Your content for the bottom sheet */}
<div className='p-1 h-full'>
{/* <h1 className='text-xl font-semibold'>Bottom Sheet Title</h1> */}
<div className='h-72 scroll-m-4 overflow-y-auto mt-2'>
{filterType === "interest" ? (
<InterestsFilter
Expand Down
22 changes: 8 additions & 14 deletions src/components/eventsPageComponents/EventCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,21 @@ function EventCard({ TheEvent }) {
const [joinUpdate, setJoinUpdate] = useState(0);
const [userDoc, setUserDoc] = useState(null);
const { user } = useUser();
console.log("userdocfromeventcard", userDoc);
// fetch user docs

useEffect(() => {
const fetchUserDocument = async () => {
if (user) {
const doc = await getUserDocument(user.uid);
if (doc.exists()) {
setUserDoc({ ...doc.data(), id: doc.id });
} else {
// Handle the case where the document doesn't exist
setUserDoc(null);
}
}
};

fetchUserDocument();
}, [user]);
// fetch event data
useEffect(() => {
const fetchEventData = async () => {
const eventDoc = await getEventDocument(TheEvent);
Expand All @@ -53,13 +50,12 @@ function EventCard({ TheEvent }) {
.filter((matchingInterest) => matchingInterest);
function formatDate() {
if (eventData?.date) {
// Split the date string into day, month, and year
const dateParts = eventData.date.split("/");
const day = parseInt(dateParts[0], 10); // Parse day as an integer
const month = parseInt(dateParts[1], 10) - 1; // Parse month as an integer (0-based)
const day = parseInt(dateParts[0], 10);
const month = parseInt(dateParts[1], 10) - 1;
const year = parseInt(dateParts[2], 10);

const date = new Date(year, month, day); // Create a date object
const date = new Date(year, month, day);

const daysOfWeek = [
"Sun",
Expand All @@ -86,7 +82,7 @@ function EventCard({ TheEvent }) {
];

const dayOfWeek = daysOfWeek[date.getDay()];
const formattedDay = ("0" + day).slice(-2); // Pads with zero if needed
const formattedDay = ("0" + day).slice(-2);
const monthName = months[month];
const yearValue = year;

Expand All @@ -100,10 +96,10 @@ function EventCard({ TheEvent }) {
}
}

const currentDate = new Date(); // You can pass your date here
const currentDate = new Date();
const formattedDate = formatDate(currentDate);
if (!eventData || !eventData.image) {
return null; // Return null or a placeholder component if TheEvent or image is null
return null;
}

return (
Expand Down Expand Up @@ -138,9 +134,7 @@ function EventCard({ TheEvent }) {
style={{
backgroundImage: `url(${eventData.image})`,
}}
>
{/* <div className='absolute inset-0 bg-gradient-to-b from-transparent via-transparent to-black group-hover:from-black/70 group-hover:via-black/60 group-hover:to-black/70'></div> */}
</div>
></div>
</div>
<div className='w-[65%] h-[100%] flex flex-col '>
<div className='h-[80%] overflow-hidden'>
Expand Down
Loading
Loading