-
Notifications
You must be signed in to change notification settings - Fork 5
feat: added an edit button on note card in user profile #90
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
base: main
Are you sure you want to change the base?
feat: added an edit button on note card in user profile #90
Conversation
|
@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. |
hdoro
left a comment
There was a problem hiding this 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), |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 😉
|
|
||
| {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> | ||
| )} | ||
|
|
There was a problem hiding this comment.
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?
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