Skip to content

Custom component only for non-admin users? #404

Answered by jmikrut
ryanlanciaux asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @ryanlanciaux

You can definitely do this. You could import the default Dashboard and Nav components from the payload/dist folder, but I just published a beta version (payload@0.13.11-beta.0) that provides you with a more permanent way of importing those components.

You can now import them via the following:

import { Dashboard } from 'payload/components/views/Dashboard'
import { Nav } from 'payload/components/elements'

So what you'd do is provide your Payload config with custom components for the Dashboard and Nav views, perform your logic for which components to display to your logged in user, and then either render the default component or the custom component.

How's that?

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ryanlanciaux
Comment options

Answer selected by ryanlanciaux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants