patch language switcher bug

This commit is contained in:
tarafanlin 2021-03-25 18:58:43 -07:00
parent 9c04d44159
commit 7a2633a1db
2 changed files with 2 additions and 1 deletions

View File

@ -115,6 +115,7 @@ export default class APIDocsGetSlate extends React.Component {
language={language}
title="Get slate by ID"
onLanguageChange={this.props.onLanguageChange}
multiLang="true"
/>
<br />
<CodeBlock

View File

@ -326,7 +326,7 @@ class CodeBlock extends React.Component {
this.props.onLanguageChange(language);
};
render() {
let availableLanguages = Object.keys(this.props.children);
let availableLanguages = this.props.multiLang ? Object.keys(this.props.children) : 1;
let showTopBar = this.props.title || availableLanguages.length > 1;
if (this.props.title) {
}