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

feat(save feature): add save feature to the events #123

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

oualidelh
Copy link
Contributor

@oualidelh oualidelh commented Nov 25, 2023

#121

Related Issue

@oualidelh oualidelh linked an issue Nov 25, 2023 that may be closed by this pull request
Copy link

vercel bot commented Nov 25, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
aidebeaide ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 25, 2023 10:30pm

Copy link
Contributor

@Khalil-NOUI Khalil-NOUI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a possibility we use the same join functionality to do this without creating a whole structure ?

Copy link
Collaborator

@HachemBouhadede HachemBouhadede left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great work ! mostly clean, i've left some optimizition suggestion, feel free to adjust to them or not ! great work

don''t forget to remove the console logs x)

@@ -91,6 +112,9 @@ function EventCard({ TheEvent }) {
<div className='flex justify-center text-[16px] shadow-md items-center bg-emerald-100 md:w-[30%] w-[50%] rounded-md lg:text-lg font-semibold'>
{formattedDate}
</div>
<div className='text-xl'>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you didn't have to fetch the user document, you could"ve just used the context
userDoc={user.uid), this way you'll be making full use of the user context, actually you won't have to pass it even as an argument, you'll just call the useUser in the save event componenet, userContext was created for this reason

that way, code will be shorteer, and remember the first rule about useEffect," if you can avoid using use effect don't use it" - creater of react

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's what i'd call clean code <3

@@ -301,6 +302,12 @@ function EventDetails() {
backgroundImage: `url(${eventDisplay.image})`,
}}
>
<div className='absolute text-2xl z-10 -top-24 left-2 group-hover:top-0 rounded-b-sm transition-all duration-300 bg-slate-200 py-2 px-1 opacity-0 group-hover:opacity-100'>
<EventsSave
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same thing, you onlly need to be passing the event id

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well it's nice to set it to avoid "!eventsSave", but the upload methode creates a new field if it doesn't exsite

none the less better then regret and good work, i didn't check the preview onlly checking the code

@HachemBouhadede
Copy link
Collaborator

is there a possibility we use the same join functionality to do this without creating a whole structure ?

he's on the right track, just small optimization that's all, limit fetching and prop drilling

@HachemBouhadede HachemBouhadede merged commit 7a13d5d into develop Nov 27, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

save event feature
3 participants