Skip to content

Commit 8381825

Browse files
fix: make sure hidden section not appearing in sidebar (#1038)
1 parent 2769648 commit 8381825

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

library/src/containers/Sidebar/Sidebar.tsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const SidebarContext = React.createContext<{
1414
export 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

0 commit comments

Comments
 (0)