Hide back button on home page and edit option on deleted reviews#339
Hide back button on home page and edit option on deleted reviews#339xenacode-art wants to merge 2 commits intom2b3:sureshDevfrom
Conversation
|
The live branch is sureshDev. Please target that. |
NavBar: the back arrow was showing on every page including the root home page where there's nowhere to go back to. Added a pathname check so it only renders when you're not on '/'. ReviewCard: the edit pencil was visible to the review author even after the review had been soft-deleted (deleted_at set). Added a !deleted_at guard so the edit option only shows up on reviews that haven't been deleted. Fixes m2b3#312, m2b3#290
62dfb2c to
081c4e4
Compare
|
thank you @bsureshkrishna for pointing that out, i have retargeted . Do take a look and let me know if there is anything else you need me to do. |
| > | ||
| <MoveLeft className="size-5" strokeWidth={1.5} /> | ||
| </button> | ||
| {pathname !== '/' && ( |
There was a problem hiding this comment.
I think removing back button on home page is necessary. it can stay there.
| <span className="flex items-center gap-2 text-sm font-bold text-text-secondary"> | ||
| {review.user.username} | ||
| {review.is_author && ( | ||
| {review.is_author && !review.deleted_at && ( |
There was a problem hiding this comment.
can you check the same for comments and discussions.
Revert the pathname !== '/' back button guard per reviewer feedback — the back button is fine to show on the home page. Also fixes the same deleted-item edit button issue in DiscussionCard: canEditDiscussion was true for any author regardless of deleted_at. Added !discussion.deleted_at guard to match the ReviewCard fix. Closes m2b3#290
|
On the ReviewCard comment: |
|
@xenacode-art - thank you for these. I would like to think first about the entire deletion policy setup before I move forward on this. |
Closes #312
Closes #290
NavBar — back button on root home page (#312)
The
MoveLeftback arrow was rendering on every page, including/where there's no history to go back to. Added a
pathname !== '/'check so it only shows when you're somewhere navigable back from.
ReviewCard — edit button visible on deleted reviews (#290)
The edit pencil was shown whenever
review.is_authorwas true, withno check for whether the review had been soft-deleted.
ReviewOutexposes a
deleted_atfield — added!review.deleted_atto thecondition so the edit option is hidden once a review is deleted.