File tree Expand file tree Collapse file tree 2 files changed +18
-9
lines changed
apify-docs-theme/src/theme Expand file tree Collapse file tree 2 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,11 @@ export default function NavbarMobileSidebarHeader() {
1313 const { navbar : { items } } = useThemeConfig ( ) ;
1414 const searchBarItem = items . find ( ( item ) => item . type === 'search' ) ;
1515
16+ function onSearchClick ( event ) {
17+ event . preventDefault ( ) ;
18+ mobileSidebar . toggle ( ) ;
19+ }
20+
1621 return (
1722 < >
1823 < div className = "navbar-sidebar__brand" >
@@ -31,7 +36,7 @@ export default function NavbarMobileSidebarHeader() {
3136 < NavbarCTA />
3237 { ! searchBarItem && (
3338 < NavbarSearch >
34- < SearchBar />
39+ < SearchBar onClick = { onSearchClick } />
3540 </ NavbarSearch >
3641 ) }
3742 </ div >
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ export function Link(props) {
4040 return < a { ...props } > { props . children } </ a > ;
4141}
4242
43- export default function SearchBar ( ) {
43+ export default function SearchBar ( { onClick } ) {
4444 const { siteConfig } = useDocusaurusContext ( ) ;
4545 const location = useLocation ( ) ;
4646 const history = useHistory ( ) ;
@@ -62,13 +62,17 @@ export default function SearchBar() {
6262
6363 return (
6464 < BrowserOnly >
65- { ( ) => < ApifySearch
66- algoliaAppId = { siteConfig . themeConfig . algolia . appId }
67- algoliaIndexName = 'test_test_apify_sdk'
68- algoliaKey = { siteConfig . themeConfig . algolia . apiKey }
69- filters = { `version:${ getVersion ( ) } ` }
70- navigate = { navigate }
71- /> }
65+ { ( ) => (
66+ < div onClick = { onClick } >
67+ < ApifySearch
68+ algoliaAppId = { siteConfig . themeConfig . algolia . appId }
69+ algoliaIndexName = 'test_test_apify_sdk'
70+ algoliaKey = { siteConfig . themeConfig . algolia . apiKey }
71+ filters = { `version:${ getVersion ( ) } ` }
72+ navigate = { navigate }
73+ />
74+ </ div >
75+ ) }
7276 </ BrowserOnly >
7377 ) ;
7478}
You can’t perform that action at this time.
0 commit comments