Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/mighty-cameras-brake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react-brand': patch
---

Internal refactoring to `SubdomainNavBar` component to remove an unused prop — `showOnlyOnNarrow` — which was leaking into the DOM.
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ const mockSearchData = [
},
]

const Template: StoryFn<Args> = args => {
const Template: StoryFn<Args> = ({showSearch, numLinks, ...args}) => {
const inputRef = React.useRef<HTMLInputElement | null>(null)
const [searchResults, setSearchResults] = React.useState<
{title: string; description: string; date: string; url: string}[] | undefined
Expand Down Expand Up @@ -405,7 +405,7 @@ const Template: StoryFn<Args> = args => {
<div>
<SubdomainNavBar {...args} title={args.title}>
{['collections', 'topics', 'articles', 'events', 'video', 'social', 'podcasts', 'books', 'guides', 'webcasts']
.slice(0, args.numLinks)
.slice(0, numLinks)
.map(link => {
return (
<SubdomainNavBar.Link key={link} href={`#${link}`}>
Expand All @@ -417,7 +417,7 @@ const Template: StoryFn<Args> = args => {
</SubdomainNavBar.Link>
)
})}
{args.showSearch && (
{showSearch && (
<SubdomainNavBar.Search
ref={inputRef}
searchTerm={searchTerm}
Expand Down
1 change: 0 additions & 1 deletion packages/react/src/SubdomainNavBar/SubdomainNavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ function Root({
)}
{hasLinks && !menuHidden && (
<NavigationVisbilityObserver
showOnlyOnNarrow
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wow, so this wasn't doing anything at all? 😬

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No I don't believe so 😅

className={clsx(styles['SubdomainNavBar-primary-nav-list--visible'])}
>
{menuItems}
Expand Down
Loading