@graphcommerce/magento-search 7.0.0-canary.12 → 7.0.0-canary.21
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 +23 -1
- package/components/SearchLink/SearchLink.tsx +10 -6
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
@@ -1,6 +1,28 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
## 7.0.0-canary.
|
3
|
+
## 7.0.0-canary.21
|
4
|
+
|
5
|
+
## 6.2.0-canary.20
|
6
|
+
|
7
|
+
## 6.2.0-canary.19
|
8
|
+
|
9
|
+
## 6.2.0-canary.18
|
10
|
+
|
11
|
+
## 6.2.0-canary.17
|
12
|
+
|
13
|
+
## 6.2.0-canary.16
|
14
|
+
|
15
|
+
### Patch Changes
|
16
|
+
|
17
|
+
- [#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))
|
18
|
+
|
19
|
+
## 6.2.0-canary.15
|
20
|
+
|
21
|
+
## 6.2.0-canary.14
|
22
|
+
|
23
|
+
## 6.2.0-canary.13
|
24
|
+
|
25
|
+
## 6.2.0-canary.12
|
4
26
|
|
5
27
|
## 6.2.0-canary.11
|
6
28
|
|
@@ -7,12 +7,13 @@ import {
|
|
7
7
|
} from '@graphcommerce/next-ui'
|
8
8
|
import { Breakpoint, Fab, FabProps, Link, LinkProps } from '@mui/material'
|
9
9
|
import { useRouter } from 'next/router'
|
10
|
+
import { MouseEventHandler } from 'react'
|
10
11
|
import type { SetRequired } from 'type-fest'
|
11
12
|
|
12
13
|
export type SearchLinkProps = {
|
13
14
|
breakpoint?: Breakpoint
|
14
15
|
fab?: FabProps
|
15
|
-
} & SetRequired<Pick<LinkProps
|
16
|
+
} & SetRequired<Pick<LinkProps<'button'>, 'href' | 'sx' | 'children' | 'onClick'>, 'href'>
|
16
17
|
|
17
18
|
const name = 'SearchLink' as const
|
18
19
|
const parts = ['root', 'text', 'svg'] as const
|
@@ -26,21 +27,24 @@ const { classes } = extendableComponent(name, parts)
|
|
26
27
|
* ```
|
27
28
|
*/
|
28
29
|
export function SearchLink(props: SearchLinkProps) {
|
29
|
-
const { href, sx = [], children, breakpoint, fab, ...linkProps } = props
|
30
|
+
const { href, sx = [], children, breakpoint, fab, onClick, ...linkProps } = props
|
30
31
|
const router = useRouter()
|
31
32
|
const fabSize = useFabSize('responsive')
|
32
33
|
const { sx: fabSx = [], size, color, ...fabProps } = fab ?? {}
|
33
34
|
|
35
|
+
const handleClick: MouseEventHandler<HTMLElement> = (e) => {
|
36
|
+
e.preventDefault()
|
37
|
+
onClick?.(e)
|
38
|
+
return router.push(href)
|
39
|
+
}
|
40
|
+
|
34
41
|
return (
|
35
42
|
<>
|
36
43
|
<Link
|
37
44
|
component='button'
|
38
45
|
className={classes.root}
|
39
46
|
underline='none'
|
40
|
-
onClick={
|
41
|
-
e.preventDefault()
|
42
|
-
return router.push(href)
|
43
|
-
}}
|
47
|
+
onClick={handleClick}
|
44
48
|
sx={[
|
45
49
|
(theme) => ({
|
46
50
|
justifySelf: 'center',
|
package/package.json
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
"name": "@graphcommerce/magento-search",
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
5
|
-
"version": "7.0.0-canary.
|
5
|
+
"version": "7.0.0-canary.21",
|
6
6
|
"sideEffects": false,
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
8
8
|
"eslintConfig": {
|
@@ -12,16 +12,16 @@
|
|
12
12
|
}
|
13
13
|
},
|
14
14
|
"devDependencies": {
|
15
|
-
"@graphcommerce/eslint-config-pwa": "7.0.0-canary.
|
16
|
-
"@graphcommerce/prettier-config-pwa": "7.0.0-canary.
|
17
|
-
"@graphcommerce/typescript-config-pwa": "7.0.0-canary.
|
15
|
+
"@graphcommerce/eslint-config-pwa": "7.0.0-canary.21",
|
16
|
+
"@graphcommerce/prettier-config-pwa": "7.0.0-canary.21",
|
17
|
+
"@graphcommerce/typescript-config-pwa": "7.0.0-canary.21"
|
18
18
|
},
|
19
19
|
"dependencies": {
|
20
|
-
"@graphcommerce/ecommerce-ui": "7.0.0-canary.
|
21
|
-
"@graphcommerce/graphql": "7.0.0-canary.
|
22
|
-
"@graphcommerce/image": "7.0.0-canary.
|
23
|
-
"@graphcommerce/next-ui": "7.0.0-canary.
|
24
|
-
"@graphcommerce/react-hook-form": "7.0.0-canary.
|
20
|
+
"@graphcommerce/ecommerce-ui": "7.0.0-canary.21",
|
21
|
+
"@graphcommerce/graphql": "7.0.0-canary.21",
|
22
|
+
"@graphcommerce/image": "7.0.0-canary.21",
|
23
|
+
"@graphcommerce/next-ui": "7.0.0-canary.21",
|
24
|
+
"@graphcommerce/react-hook-form": "7.0.0-canary.21"
|
25
25
|
},
|
26
26
|
"peerDependencies": {
|
27
27
|
"@lingui/react": "^3.13.2",
|