Skip to content

Conversation

@marcelo-soares-souza
Copy link

Please consider this possible solution/improvement to add an edit button to the notes displayed in the user profile to improve usability. We can discuss the solution before merging. Thanks

@vercel
Copy link

vercel bot commented May 9, 2025

@marcelo-soares-souza is attempting to deploy a commit to the Mulungood Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Owner

@hdoro hdoro left a comment

Choose a reason for hiding this comment

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

Looking good, thank you for the contribution 🎉

I have a couple of small changes, but overall super happy you managed to find your way around the code 🙏

order_by: {
expression: e.random(),
},
is_owner: e.op(profile.id, '=', e.global.current_user_profile.id),
Copy link
Owner

Choose a reason for hiding this comment

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

As it currently is, is_owner is being fetched only in the profile page, but it's expected in every instance of NoteCard.

Can you move this into the query fragment noteForCard so that every card instance includes this data?

Copy link
Owner

Choose a reason for hiding this comment

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

Ah, and after doing this, you can remove the manual TS definition of is_owner?: boolean | null in the NoteCard type, as it'll be automatically inferred by Gel 😉

Comment on lines +74 to +83

{note.is_owner && (
<Button mode="bleed" tone="secondary" size="xs" asChild>
<Link href={paths.editNote(note.handle)}>
<EditIcon className="w-[1.25em]" />
Editar
</Link>
</Button>
)}

Copy link
Owner

Choose a reason for hiding this comment

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

I think we need to redesign the notes card to better accommodate for these actions... In the meantime, can you move it after the share button, make both size="sm" and apply the w-[1.25em] class to the share icon?

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.

2 participants