Created
January 28, 2023 11:55
-
-
Save Youka/8b70c113001345ac7ba9fd64776daf50 to your computer and use it in GitHub Desktop.
Swagger-UI plugin: InfoCollapsePlugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const InfoCollapsePlugin = (system) => { | |
const React = system.React; | |
return { | |
wrapComponents: { | |
info: (Original) => (props) => React.createElement( | |
"details", | |
{ | |
open: true | |
}, | |
React.createElement( | |
"summary", | |
{ | |
style: { | |
cursor: "pointer", | |
backgroundColor: "#E0E0E0", | |
"text-align": "center", | |
"font-style": "italic" | |
} | |
}, | |
"Info" | |
), | |
React.createElement( | |
Original, | |
props | |
) | |
) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment