File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ const SidebarContext = React.createContext<{
1414export const Sidebar : React . FunctionComponent = ( ) => {
1515 const [ showSidebar , setShowSidebar ] = useState ( false ) ;
1616 const asyncapi = useSpec ( ) ;
17+ const config = useConfig ( ) ;
1718
1819 const info = asyncapi . info ( ) ;
1920 // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
@@ -23,6 +24,9 @@ export const Sidebar: React.FunctionComponent = () => {
2324 const schemas = components ?. schemas ( ) . all ( ) ;
2425 const hasOperations = asyncapi . operations ( ) . length > 0 ;
2526
27+ const showMessages = config . show ?. messages ;
28+ const showSchemas = config . show ?. schemas ;
29+
2630 const messagesList = messages ?. length > 0 && (
2731 < li className = "mb-3 mt-9" >
2832 < a
@@ -85,8 +89,8 @@ export const Sidebar: React.FunctionComponent = () => {
8589 </ a >
8690 < OperationsList />
8791 </ li >
88- { messagesList }
89- { schemasList }
92+ { showMessages && messagesList }
93+ { showSchemas && schemasList }
9094 </ >
9195 ) ;
9296
You can’t perform that action at this time.
0 commit comments