-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(v2): allow to change location of search bar #4199
Conversation
handleSearchBarToggle={setIsSearchBarExpanded} | ||
isSearchBarExpanded={isSearchBarExpanded} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's dead code, although it may be used by third party plugins implementing local search (not Algolia). It doesn't make sense to support it anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree, and it's not documented afaik
Deploy preview for docusaurus-2 ready! Built with commit 0df3750 |
[V1] Deploy preview success Built with commit 0df3750 |
Size Change: +1 B (0%) Total Size: 156 kB ℹ️ View Unchanged
|
9857868
to
57c26b2
Compare
@@ -73,6 +70,7 @@ function Navbar(): JSX.Element { | |||
} | |||
}, [windowSize]); | |||
|
|||
const hasSearchNavbarItem = items.some((item) => item.type === 'search'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need help with proper typing this 🤷♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just added something to fix it
export type NavbarItem = {
type?: string | undefined;
items?: NavbarItem[];
label?: string;
};
it's not the ideal type but we'll improve that later, as there are many things that are not typed correctly currently
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, LGTM and good enough to merge
fixed a few things and we'll figure out better TS types later
handleSearchBarToggle={setIsSearchBarExpanded} | ||
isSearchBarExpanded={isSearchBarExpanded} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree, and it's not documented afaik
@@ -73,6 +70,7 @@ function Navbar(): JSX.Element { | |||
} | |||
}, [windowSize]); | |||
|
|||
const hasSearchNavbarItem = items.some((item) => item.type === 'search'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just added something to fix it
export type NavbarItem = {
type?: string | undefined;
items?: NavbarItem[];
label?: string;
};
it's not the ideal type but we'll improve that later, as there are many things that are not typed correctly currently
declare module '@theme/NavbarItem/SearchNavbarItem' { | ||
import type {Props as DefaultNavbarItemProps} from '@theme/NavbarItem/DefaultNavbarItem'; | ||
|
||
export type Props = DefaultNavbarItemProps; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will fix this because it does not take such additional props
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-4199--docusaurus-2.netlify.app/classic/ |
@slorber cool, thanks! |
Motivation
Fixes #4157
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
See docs.
Related PRs
(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)