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: Hide moderator pages for casual users #130

Merged
merged 2 commits into from
Dec 13, 2024
Merged

Conversation

Valimp
Copy link
Collaborator

@Valimp Valimp commented Nov 20, 2024

What

Hide image and product pages for non moderator users

@Valimp Valimp changed the title Hide no moderator pages fix: Hide no moderator pages Nov 20, 2024
@Valimp Valimp changed the title fix: Hide no moderator pages fix: Hide moderator pages for casual users Nov 20, 2024
@Valimp Valimp requested a review from alexgarel November 20, 2024 08:42
Copy link
Member

@alexgarel alexgarel left a comment

Choose a reason for hiding this comment

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

Great !

Comment on lines +63 to +68
const filteredPages = isLoggedIn
? pages.filter((page) =>
isModerator ? page.showtoUsers.includes('moderator') : page.showtoUsers.includes('user')
)
:
pages.filter((page) => page.showtoUsers.includes('user'));
Copy link
Member

Choose a reason for hiding this comment

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

Quite elegant !

@alexgarel alexgarel merged commit 5818b51 into main Dec 13, 2024
7 checks passed
@alexgarel alexgarel deleted the hide-no-moderator-pages branch December 13, 2024 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants