Skip to content

Commit f26b786

Browse files
authored
Update Root.tsx
updates per #5051
1 parent 5601ebc commit f26b786

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/theme/Root.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
import React from 'react';
22
import Berry from '../components/Berry';
33
import { useLocation } from '@docusaurus/router';
4+
import { useHomePageRoute } from '@docusaurus/theme-common/internal';
45

56
export default function Root({ children }: { children: React.ReactNode }) {
67
const location = useLocation();
8+
const homePageRoute = useHomePageRoute();
9+
const isHomePage = homePageRoute?.path === location.pathname;
10+
711
return (
812
<>
913
{children}
10-
{location.pathname !== '/' && <Berry mode='popup' />}
14+
{!isHomePage && <Berry mode='popup' />}
1115
</>
1216
);
1317
}

0 commit comments

Comments
 (0)