Skip to content

Commit 9377f6c

Browse files
committed
Hide support dropdown menu from home page
1 parent 664d5d8 commit 9377f6c

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/theme/DocItem/Layout/index.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ const DocItemLayout: React.FC<DocItemLayoutProps> = ({ children }) => {
4848
const hideTOC = frontMatter.hide_table_of_contents;
4949
const windowSize = useWindowSize();
5050

51+
// Check if the current page is the home page or a version homepage.
52+
const isHomePage = metadata.permalink === '/docs/latest/' ||
53+
/^\/docs\/\d+\.\d+\/$/.test(metadata.permalink) ||
54+
metadata.permalink === '/ja-jp/docs/latest/' ||
55+
/^\/ja-jp\/docs\/\d+\.\d+\/$/.test(metadata.permalink);
56+
5157
return (
5258
<div className="row">
5359
<div className={clsx('col', !docTOC.hidden && styles.docItemCol)}>
@@ -57,7 +63,7 @@ const DocItemLayout: React.FC<DocItemLayoutProps> = ({ children }) => {
5763
<article>
5864
<DocBreadcrumbs />
5965
<DocVersionBadge />
60-
{windowSize === 'mobile' && (
66+
{windowSize === 'mobile' && !isHomePage && (
6167
<div style={{ display: 'flex', justifyContent: 'left', marginBottom: '1rem' }}>
6268
<SupportDropdownMenu />
6369
</div>
@@ -73,9 +79,11 @@ const DocItemLayout: React.FC<DocItemLayoutProps> = ({ children }) => {
7379
{!hideTOC && windowSize !== 'mobile' && (
7480
<div className="col col--3" style={{ position: "relative" }}>
7581
<div style={{ position: "sticky", top: "80px", zIndex: 1 }}>
76-
<div style={{ display: 'flex', justifyContent: 'flex-start', padding: '0px 17px', right: '0' }}>
77-
<SupportDropdownMenu />
78-
</div>
82+
{!isHomePage && (
83+
<div style={{ display: 'flex', justifyContent: 'flex-start', padding: '0px 17px', right: '0' }}>
84+
<SupportDropdownMenu />
85+
</div>
86+
)}
7987
{docTOC.desktop}
8088
</div>
8189
</div>

0 commit comments

Comments
 (0)