-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Added Admin page & some UI Changes #819
Conversation
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.
Isnt there already admin page?
.env.example
Outdated
@@ -15,7 +15,6 @@ BOT_TOKEN = "123" | |||
GUILD_ID = "123" | |||
LOCAL_CMS_PROVIDER = true | |||
CACHE_EXPIRE_S = 10 | |||
|
|||
ADMINS = "Random,[email protected]" | |||
NEXT_PUBLIC_ADMINS = "Random,[email protected],[email protected]" |
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.
why this public? we dont need this public as the role is inside session
@@ -47,6 +51,19 @@ const ProfileDropdown = () => { | |||
</div> | |||
</DropdownMenuTrigger> | |||
<DropdownMenuContent className="mr-3 mt-2 w-56 shadow-2xl"> | |||
{Isession && | |||
process.env.NEXT_PUBLIC_ADMINS?.split(',').includes( | |||
Isession?.user?.email ?? '', |
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.
there is session.user.role
@siinghd done! |
Added the Admin Page to navigate to Add course and add content in the dropdown. Only Admins Can have it's access
Added toast for validation to check if content is added or not, Made UI good & informative
Preview:
https://github.com/code100x/cms/assets/138095461/06092094-c592-4f21-9941-3532c1ae1276
Checklist before requesting a review