@graphcommerce/magento-store 3.3.10 → 3.3.14
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 +11 -0
- package/package.json +11 -11
- package/switcher/StoreSwitcherButton.tsx +1 -1
- package/switcher/StoreSwitcherList.tsx +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.3.11](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/magento-store@3.3.10...@graphcommerce/magento-store@3.3.11) (2021-12-06)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* use Locale to set storeSwitcher icons ([65ea397](https://github.com/ho-nl/m2-pwa/commit/65ea397ec53aa27f545b43feda8e35227e119ebe))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [3.3.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/magento-store@3.2.20...@graphcommerce/magento-store@3.3.0) (2021-11-12)
|
|
7
18
|
|
|
8
19
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphcommerce/magento-store",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.14",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
6
6
|
"browserslist": [
|
|
@@ -14,23 +14,23 @@
|
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@graphcommerce/browserslist-config-pwa": "^3.0.2",
|
|
17
|
-
"@graphcommerce/eslint-config-pwa": "^3.1.
|
|
17
|
+
"@graphcommerce/eslint-config-pwa": "^3.1.7",
|
|
18
18
|
"@graphcommerce/prettier-config-pwa": "^3.0.4",
|
|
19
19
|
"@graphcommerce/typescript-config-pwa": "^3.1.1",
|
|
20
|
-
"@playwright/test": "^1.
|
|
20
|
+
"@playwright/test": "^1.17.1"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@apollo/client": "^3.
|
|
24
|
-
"@graphcommerce/graphql": "^2.105.
|
|
25
|
-
"@graphcommerce/image": "^2.105.
|
|
26
|
-
"@graphcommerce/next-ui": "^3.20.
|
|
27
|
-
"@lingui/macro": "^3.
|
|
23
|
+
"@apollo/client": "^3.5.6",
|
|
24
|
+
"@graphcommerce/graphql": "^2.105.7",
|
|
25
|
+
"@graphcommerce/image": "^2.105.7",
|
|
26
|
+
"@graphcommerce/next-ui": "^3.20.7",
|
|
27
|
+
"@lingui/macro": "^3.13.0",
|
|
28
28
|
"@material-ui/core": "^4.12.3",
|
|
29
29
|
"@material-ui/lab": "^4.0.0-alpha.60",
|
|
30
|
-
"next": "^12.0.
|
|
30
|
+
"next": "^12.0.7",
|
|
31
31
|
"react": "^17.0.2",
|
|
32
32
|
"react-dom": "^17.0.2",
|
|
33
|
-
"type-fest": "^2.
|
|
33
|
+
"type-fest": "^2.8.0"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "f8974380ace982793000e5b181b5bb314a1945fb"
|
|
36
36
|
}
|
|
@@ -20,7 +20,7 @@ export type StoreSwitcherButtonProps = UseStyles<typeof useStyles>
|
|
|
20
20
|
|
|
21
21
|
export default function StoreSwitcherButton(props) {
|
|
22
22
|
const config = useQuery(StoreConfigDocument)
|
|
23
|
-
const country = config.data?.storeConfig?.
|
|
23
|
+
const country = config.data?.storeConfig?.locale?.split('_')?.[1]?.toLowerCase() ?? ''
|
|
24
24
|
|
|
25
25
|
const classes = useStyles(props)
|
|
26
26
|
return (
|
|
@@ -51,7 +51,7 @@ export default function StoreSwitcherList(props: StoreSwitcherListProps) {
|
|
|
51
51
|
(availableStores ?? []).reduce<{
|
|
52
52
|
[group: string]: { name: Store['store_group_name']; stores: Store[] }
|
|
53
53
|
}>((storesGrouped, store) => {
|
|
54
|
-
const code = store?.
|
|
54
|
+
const code = store?.locale?.split('_')[1].toLowerCase()
|
|
55
55
|
if (!store?.store_group_code || !code) return storesGrouped
|
|
56
56
|
|
|
57
57
|
if (!storesGrouped[code]) storesGrouped[code] = { name: store.store_group_name, stores: [] }
|
|
@@ -66,9 +66,9 @@ export default function StoreSwitcherList(props: StoreSwitcherListProps) {
|
|
|
66
66
|
{groupedStores.map(([code, group]) => (
|
|
67
67
|
<React.Fragment key={code}>
|
|
68
68
|
<PageLink
|
|
69
|
-
key={group.stores[0].
|
|
69
|
+
key={group.stores[0].locale}
|
|
70
70
|
href='/switch-stores'
|
|
71
|
-
locale={storeToLocale(group.stores[0].
|
|
71
|
+
locale={storeToLocale(group.stores[0].locale)}
|
|
72
72
|
replace
|
|
73
73
|
passHref
|
|
74
74
|
>
|
|
@@ -76,7 +76,7 @@ export default function StoreSwitcherList(props: StoreSwitcherListProps) {
|
|
|
76
76
|
button
|
|
77
77
|
component='a'
|
|
78
78
|
selected={
|
|
79
|
-
group.stores.length <= 1 && localeToStore(locale) === group.stores[0].
|
|
79
|
+
group.stores.length <= 1 && localeToStore(locale) === group.stores[0].locale
|
|
80
80
|
}
|
|
81
81
|
color='inherit'
|
|
82
82
|
className={classes.listItem}
|
|
@@ -94,16 +94,16 @@ export default function StoreSwitcherList(props: StoreSwitcherListProps) {
|
|
|
94
94
|
<Collapse in timeout='auto'>
|
|
95
95
|
{group.stores.map((store) => (
|
|
96
96
|
<PageLink
|
|
97
|
-
key={store.
|
|
97
|
+
key={store.locale}
|
|
98
98
|
href='/switch-stores'
|
|
99
|
-
locale={storeToLocale(store.
|
|
99
|
+
locale={storeToLocale(store.locale)}
|
|
100
100
|
replace
|
|
101
101
|
passHref
|
|
102
102
|
>
|
|
103
103
|
<ListItem
|
|
104
104
|
button
|
|
105
105
|
component='a'
|
|
106
|
-
selected={localeToStore(locale) === store.
|
|
106
|
+
selected={localeToStore(locale) === store.locale}
|
|
107
107
|
color='inherit'
|
|
108
108
|
className={classes.listItemIndented}
|
|
109
109
|
>
|