Skip to content

Commit

Permalink
disableSidebar and disableSearch optional params
Browse files Browse the repository at this point in the history
  • Loading branch information
Melissa Garcia committed Mar 12, 2024
1 parent c3396c3 commit 486625c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/gatsby-theme-aio/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/gatsby-theme-aio",
"version": "4.11.5-rc8",
"version": "4.11.7-rc2",
"description": "The Adobe I/O theme for building markdown powered sites",
"main": "index.js",
"license": "Apache-2.0",
Expand Down Expand Up @@ -153,4 +153,4 @@
"use-debounce": "^9.0.4",
"uuid": "^9.0.0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import PropTypes from 'prop-types';
const licenseKey = process.env.GATSBY_REDOCLY_KEY;

// Redocly API Block that will render the OpenAPI yaml files with Redocly TryIt feature.
const RedoclyAPIBlock = ({ src, width = '500px', codeBlock = "tokens: { punctuation: { color: 'white' }}" }) => {
const RedoclyAPIBlock = ({ src, width = '500px', codeBlock = "tokens: { punctuation: { color: 'white' }}", disableSidebar = false, disableSearch = false }) => {
const [isRedoclyLoading, setIsRedoclyLoading] = useState(true);

let input = {};
Expand Down Expand Up @@ -48,14 +48,14 @@ const RedoclyAPIBlock = ({ src, width = '500px', codeBlock = "tokens: { punctuat
<>
{!isRedoclyLoading && (
<>
<div id="redocly_container"/>
<div id="redocly_container" />

<script>{
`RedoclyReferenceDocs.init(
'${src}',
{licenseKey: '${licenseKey}',
disableSidebar: true,
disableSearch: true,
disableSidebar: ${disableSidebar},
disableSearch: ${disableSearch},
hideLoading: true,
theme: {
rightPanel: {
Expand All @@ -75,7 +75,11 @@ const RedoclyAPIBlock = ({ src, width = '500px', codeBlock = "tokens: { punctuat
};

RedoclyAPIBlock.propTypes = {
src: PropTypes.string
src: PropTypes.string,
width: PropTypes.string,
codeBlock: PropTypes.string,
disableSidebar: PropTypes.bool,
disableSearch: PropTypes.bool,
};

export { RedoclyAPIBlock };

0 comments on commit 486625c

Please sign in to comment.