Skip to content

Commit b5c1526

Browse files
authored
Merge pull request #3508 from Blargian/KB_button_fix
KB navigation: fix routing bug
2 parents 5c2dd6f + 6f94751 commit b5c1526

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/theme/BlogListPage/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function BlogListPageContent(props) {
5151
<ButtonGroup
5252
onClick={function Nav(value) {
5353
if (typeof window !== 'undefined') {
54-
value === 'recent' ? history.push(`/docs/${currentLocale}/knowledgebase`) : history.push(`/docs/${currentLocale}/knowledgebase/tags`)
54+
value === 'recent' ? history.push(`/docs/knowledgebase`) : history.push(`/docs/knowledgebase/tags`)
5555
}
5656
}}
5757
options={[

src/theme/BlogPostItem/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default function BlogPostItem({children, className}) {
1717
const containerClassName = useContainerClassName();
1818
return (
1919
<BlogPostItemContainer className={clsx(containerClassName, className)}>
20-
{location.pathname === '/docs/knowledgebase' || location.pathname.includes('/docs/knowledgebase/tags/') ? <div></div> : <BlogBreadcrumbs/>}
20+
{location.pathname.includes('/knowledgebase') || location.pathname.includes('/knowledgebase/tags/') ? <div></div> : <BlogBreadcrumbs/>}
2121
<BlogPostItemHeader />
2222
<BlogPostItemContent>{children}</BlogPostItemContent>
2323
<BlogPostItemFooter />

src/theme/BlogTagsListPage/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default function BlogTagsListPage({ tags, sidebar }) {
3737
<BlogBreadcrumbs />
3838
<Heading as="h1" className={styles.kbTitle}><Translate id={`theme.blog.title`} description={`Translation for Knowledge Base`}>Knowledge Base</Translate></Heading>
3939
<ButtonGroup
40-
onClick={function Nav(value) { if (typeof window !== 'undefined') { value === 'recent' ? history.push(`/docs/${currentLocale}/knowledgebase`) : history.push(`/docs/${currentLocale}/knowledgebase/tags`) } }}
40+
onClick={function Nav(value) { if (typeof window !== 'undefined') { value === 'recent' ? history.push(`/docs/knowledgebase`) : history.push(`/docs/knowledgebase/tags`) } }}
4141
options={[
4242
{
4343
label: 'Recent',

src/theme/BlogTagsPostsPage/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function BlogTagsPostsPageContent({ tag, items, sidebar, listMetadata }) {
4343
<BlogBreadcrumbs />
4444
<h1 className={styles.kbTitle}>Knowledge Base</h1>
4545
<ButtonGroup
46-
onClick={function Nav(value) { value === 'recent' ? history.push(`/docs/${currentLocale}/knowledgebase`) : history.push(`/docs/${currentLocale}/knowledgebase/tags`) }}
46+
onClick={function Nav(value) { value === 'recent' ? history.push(`/docs/knowledgebase`) : history.push(`/docs/knowledgebase/tags`) }}
4747
options={[
4848
{
4949
label: 'Recent',

0 commit comments

Comments
 (0)