Skip to content

Role-Based UI Handling #60

@grantfox-oss

Description

@grantfox-oss

Description:
Show or hide UI elements based on the user's role (user or admin).

Tasks:

  • Create a src/hooks/useRole.js custom hook that returns { isAdmin, isUser } based on selectCurrentUser
  • Hide the "Create Campaign" button for admin users
  • Show the "Admin Panel" link in the Navbar only for admin users
  • Conditionally render "Edit" and "Delete" buttons on campaign cards only for the campaign owner
  • Create a <AdminRoute> component that redirects non-admins to /dashboard

Acceptance Criteria:
Admin-only UI is hidden from regular users; owner-only actions are hidden from non-owners.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions