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

Added Admin page & some UI Changes #819

Closed

Conversation

pruthviraj7714
Copy link
Contributor

@pruthviraj7714 pruthviraj7714 commented Jul 10, 2024

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

  • [✔] I have performed a self-review of my code
  • [✔] I assure there is no similar/duplicate pull request regarding same issue

@pruthviraj7714 pruthviraj7714 changed the title Added Admin page & some UI fix Added Admin page & some UI Changes Jul 10, 2024
Copy link
Collaborator

@siinghd siinghd left a 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,example@gmail.com"
NEXT_PUBLIC_ADMINS = "Random,example@gmail.com,test@gmail.com"
Copy link
Collaborator

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 ?? '',
Copy link
Collaborator

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

@pruthviraj7714
Copy link
Contributor Author

@siinghd done!

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.

None yet

2 participants