-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
feat(gatsby-plugin-gatsby-cloud): Add disablePreviewUI
option
#32907
feat(gatsby-plugin-gatsby-cloud): Add disablePreviewUI
option
#32907
Conversation
export const wrapRootElement = ({ element }, pluginOptions) => { | ||
if ( | ||
process.env.GATSBY_PREVIEW_INDICATOR_ENABLED === `true` && | ||
!pluginOptions.disablePreviewUI |
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.
!pluginOptions.disablePreviewUI | |
!pluginOptions?.disablePreviewUI |
I can't remember if they have no options pluginOptions
will be undefined
or it will be an empty object. So let's just guard against it in case it is undefined
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.
Let's also add our new pluginOption to the schema. You can see an example of it here
In this case it will just be a boolean
disablePreviewUI
option
…eivew property to the schema
* added pluginOptions from wrappRootElement * updated access to the pluginOptions property and added the disabledPreivew property to the schema Co-authored-by: Leithon Englidh <[email protected]>
Description
Added pluginOptions to wrappRootElement browser API function. Specifically added the "disablePreviewUI" property for enabling/disabling preview UI
Documentation
https://www.gatsbyjs.com/docs/reference/config-files/gatsby-browser/#wrapRootElement