Skip to content

Commit

Permalink
feat: try it panel event handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
melissag-ensemble committed Sep 27, 2024
1 parent 27490d8 commit 3178773
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ const RedoclyAPIBlock = ({
jsonSampleExpandLevel = 2,
generateCodeSamples = 'languages: [], skipOptionalParameters: false,',
requestInterceptor = '',
tryItOpenEventHandler = '',
tryItSentEventHandler = '',
}) => {
const [isRedoclyLoading, setIsRedoclyLoading] = useState(true);

Expand Down Expand Up @@ -75,6 +77,10 @@ const RedoclyAPIBlock = ({
jsonSampleExpandLevel: ${jsonSampleExpandLevel === all ? `'${jsonSampleExpandLevel}'` : jsonSampleExpandLevel},
${generateCodeSamples ? "generateCodeSamples: { " + generateCodeSamples + "}," : ''}
${requestInterceptor ? "requestInterceptor: " + requestInterceptor + "," : ''}
events: {
${tryItOpenEventHandler ? "tryItOpen: " + tryItOpenEventHandler + "," : ''}
${tryItSentEventHandler ? "tryItSent: " + tryItSentEventHandler + "," : ''}
},
hideLoading: true,
theme: {
${typography ? "typography: { " + typography + "}," : ''}
Expand Down Expand Up @@ -109,6 +115,8 @@ RedoclyAPIBlock.propTypes = {
]),
generateCodeSamples: PropTypes.string,
requestInterceptor: PropTypes.string,
tryItOpenEventHandler: PropTypes.string,
tryItSentEventHandler: PropTypes.string,
};

export { RedoclyAPIBlock };

0 comments on commit 3178773

Please sign in to comment.