@graphcommerce/next-ui 6.2.0-canary.14 → 6.2.0-canary.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/LayoutParts/MenuFabSecondaryItem.tsx +10 -3
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 6.2.0-canary.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1930](https://github.com/graphcommerce-org/graphcommerce/pull/1930) [`c8d023e9e`](https://github.com/graphcommerce-org/graphcommerce/commit/c8d023e9e874131cd9f8fe192b1fca5fe1a26ee3) - Fix the close menu on search and add the option to secondary menu items ([@StefanAngenent](https://github.com/StefanAngenent))
|
|
8
|
+
|
|
9
|
+
## 6.2.0-canary.15
|
|
10
|
+
|
|
3
11
|
## 6.2.0-canary.14
|
|
4
12
|
|
|
5
13
|
## 6.2.0-canary.13
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ListItemButton, ListItemIcon, ListItemText, SxProps, Theme } from '@mui/material'
|
|
2
2
|
import { useRouter } from 'next/router'
|
|
3
|
-
import React from 'react'
|
|
3
|
+
import React, { MouseEventHandler } from 'react'
|
|
4
4
|
import { extendableComponent } from '../Styles'
|
|
5
5
|
import { NextLink } from '../Theme'
|
|
6
6
|
|
|
@@ -9,6 +9,7 @@ export type FabMenuSecondaryItemProps = {
|
|
|
9
9
|
children: React.ReactNode
|
|
10
10
|
icon: React.ReactNode
|
|
11
11
|
sx?: SxProps<Theme>
|
|
12
|
+
onClick?: MouseEventHandler<HTMLElement>
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
const compName = 'MenuFabSecondaryItem' as const
|
|
@@ -16,12 +17,18 @@ const parts = ['root', 'icon', 'text'] as const
|
|
|
16
17
|
const { classes } = extendableComponent(compName, parts)
|
|
17
18
|
|
|
18
19
|
export function MenuFabSecondaryItem(props: FabMenuSecondaryItemProps) {
|
|
19
|
-
const { href, children, icon, sx = [] } = props
|
|
20
|
+
const { href, children, onClick, icon, sx = [] } = props
|
|
20
21
|
const router = useRouter()
|
|
21
22
|
|
|
23
|
+
const handleClick: MouseEventHandler<HTMLElement> = (e) => {
|
|
24
|
+
e.preventDefault()
|
|
25
|
+
onClick?.(e)
|
|
26
|
+
return router.push(href)
|
|
27
|
+
}
|
|
28
|
+
|
|
22
29
|
return (
|
|
23
30
|
<ListItemButton
|
|
24
|
-
|
|
31
|
+
onClick={handleClick}
|
|
25
32
|
component={NextLink}
|
|
26
33
|
className={classes.root}
|
|
27
34
|
sx={[{}, ...(Array.isArray(sx) ? sx : [sx])]}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/next-ui",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "6.2.0-canary.
|
|
5
|
+
"version": "6.2.0-canary.16",
|
|
6
6
|
"author": "",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"sideEffects": false,
|
|
@@ -18,18 +18,18 @@
|
|
|
18
18
|
"@emotion/react": "^11.10.6",
|
|
19
19
|
"@emotion/server": "^11.4.0",
|
|
20
20
|
"@emotion/styled": "^11.10.6",
|
|
21
|
-
"@graphcommerce/framer-next-pages": "6.2.0-canary.
|
|
22
|
-
"@graphcommerce/framer-scroller": "6.2.0-canary.
|
|
23
|
-
"@graphcommerce/framer-utils": "6.2.0-canary.
|
|
24
|
-
"@graphcommerce/image": "6.2.0-canary.
|
|
21
|
+
"@graphcommerce/framer-next-pages": "6.2.0-canary.16",
|
|
22
|
+
"@graphcommerce/framer-scroller": "6.2.0-canary.16",
|
|
23
|
+
"@graphcommerce/framer-utils": "6.2.0-canary.16",
|
|
24
|
+
"@graphcommerce/image": "6.2.0-canary.16",
|
|
25
25
|
"cookie": "^0.5.0",
|
|
26
26
|
"react-is": "^18.2.0",
|
|
27
27
|
"schema-dts": "^1.1.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@graphcommerce/eslint-config-pwa": "6.2.0-canary.
|
|
31
|
-
"@graphcommerce/prettier-config-pwa": "6.2.0-canary.
|
|
32
|
-
"@graphcommerce/typescript-config-pwa": "6.2.0-canary.
|
|
30
|
+
"@graphcommerce/eslint-config-pwa": "6.2.0-canary.16",
|
|
31
|
+
"@graphcommerce/prettier-config-pwa": "6.2.0-canary.16",
|
|
32
|
+
"@graphcommerce/typescript-config-pwa": "6.2.0-canary.16",
|
|
33
33
|
"@types/cookie": "^0.5.1",
|
|
34
34
|
"@types/react-is": "^17.0.3",
|
|
35
35
|
"typescript": "4.9.5"
|