Skip to content

Commit

Permalink
Revert to useRouter to see if that recudes bundle size
Browse files Browse the repository at this point in the history
  • Loading branch information
paales committed Dec 17, 2024
1 parent 79afe82 commit 8545dfe
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 0 additions & 4 deletions docs/framework/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,6 @@ Settings for recently viewed products
Allow the site to be indexed by search engines.
If false, the robots.txt file will be set to disallow all.

#### searchOverlay: boolean

Enable / disable quick search overlay

#### sidebarGallery: [SidebarGalleryConfig](#SidebarGalleryConfig)

Configuration for the SidebarGallery component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
import { i18n } from '@lingui/core'
import { Trans } from '@lingui/react'
import { Divider, Fab } from '@mui/material'
import { usePathname } from 'next/navigation'
import { useRouter } from 'next/router'
import { Footer } from './Footer'
import { LayoutQuery } from './Layout.gql'
import { Logo } from './Logo'
Expand All @@ -37,7 +37,7 @@ export function LayoutNavigation(props: LayoutNavigationProps) {
const { footer, menu, children, ...uiProps } = props

const selection = useNavigationSelection()
const pathName = usePathname()
const router = useRouter()
const cartEnabled = useCartEnabled()

return (
Expand Down Expand Up @@ -116,7 +116,7 @@ export function LayoutNavigation(props: LayoutNavigationProps) {

<LayoutDefault
{...uiProps}
noSticky={pathName === '/'}
noSticky={router.asPath.split('?')[0] === '/'}
header={
<>
<Logo />
Expand Down
8 changes: 8 additions & 0 deletions packages/magento-search-overlay/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Magento Search Overlay

## Installation

1. Find current version of your `@graphcommerce/magento-search` in your
package.json.
2. `yarn add @graphcommerce/[email protected]` (replace 1.2.3 with the
version of the step above)
1 change: 0 additions & 1 deletion packagesDev/next-config/dist/generated/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ function GraphCommerceConfigSchema() {
productRoute: _zod.z.string().nullish(),
recentlyViewedProducts: RecentlyViewedProductsConfigSchema().nullish(),
robotsAllow: _zod.z.boolean().nullish(),
searchOverlay: _zod.z.boolean().nullish(),
sidebarGallery: SidebarGalleryConfigSchema().nullish(),
storefront: _zod.z.array(GraphCommerceStorefrontConfigSchema()),
wishlistHideForGuests: _zod.z.boolean().nullish(),
Expand Down
3 changes: 0 additions & 3 deletions packagesDev/next-config/src/generated/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,6 @@ export type GraphCommerceConfig = {
* If false, the robots.txt file will be set to disallow all.
*/
robotsAllow?: InputMaybe<Scalars['Boolean']['input']>;
/** Enable / disable quick search overlay */
searchOverlay?: InputMaybe<Scalars['Boolean']['input']>;
/** Configuration for the SidebarGallery component */
sidebarGallery?: InputMaybe<SidebarGalleryConfig>;
/** All storefront configuration for the project */
Expand Down Expand Up @@ -591,7 +589,6 @@ export function GraphCommerceConfigSchema(): z.ZodObject<Properties<GraphCommerc
productRoute: z.string().nullish(),
recentlyViewedProducts: RecentlyViewedProductsConfigSchema().nullish(),
robotsAllow: z.boolean().nullish(),
searchOverlay: z.boolean().nullish(),
sidebarGallery: SidebarGalleryConfigSchema().nullish(),
storefront: z.array(GraphCommerceStorefrontConfigSchema()),
wishlistHideForGuests: z.boolean().nullish(),
Expand Down

0 comments on commit 8545dfe

Please sign in to comment.