@graphcommerce/magento-store 5.2.0-canary.2 → 5.2.0-canary.3
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
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable spaced-comment */
|
|
2
|
-
import { extendableComponent, FlagAvatar } from '@graphcommerce/next-ui'
|
|
2
|
+
import { extendableComponent, FlagAvatar, NextLink } from '@graphcommerce/next-ui'
|
|
3
3
|
import {
|
|
4
4
|
List,
|
|
5
5
|
ListItem,
|
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
ListItemAvatar,
|
|
9
9
|
SxProps,
|
|
10
10
|
Theme,
|
|
11
|
+
ListItemButton,
|
|
11
12
|
} from '@mui/material'
|
|
12
|
-
import PageLink from 'next/link'
|
|
13
13
|
import React from 'react'
|
|
14
14
|
import { localeToStore, storeToLocale } from '../../localeToStore'
|
|
15
15
|
import { StoreSwitcherListQuery } from './StoreSwitcherList.gql'
|
|
@@ -46,76 +46,67 @@ export function StoreSwitcherList(props: StoreSwitcherListProps) {
|
|
|
46
46
|
<List className={classes.list} sx={sx}>
|
|
47
47
|
{groupedStores.map(([code, group]) => (
|
|
48
48
|
<React.Fragment key={code}>
|
|
49
|
-
<
|
|
49
|
+
<ListItemButton
|
|
50
|
+
disabled={!storeToLocale(group.stores[0].store_code)}
|
|
51
|
+
component={NextLink}
|
|
50
52
|
key={group.stores[0].locale}
|
|
51
53
|
href='/switch-stores'
|
|
52
54
|
locale={storeToLocale(group.stores[0].store_code)}
|
|
53
55
|
replace
|
|
54
|
-
|
|
56
|
+
selected={
|
|
57
|
+
group.stores.length <= 1 && localeToStore(locale) === group.stores[0].store_code
|
|
58
|
+
}
|
|
59
|
+
color='inherit'
|
|
60
|
+
className={classes.listItem}
|
|
61
|
+
sx={(theme) => ({
|
|
62
|
+
borderTop: `1px solid ${theme.palette.divider}`,
|
|
63
|
+
cursor: 'pointer',
|
|
64
|
+
})}
|
|
55
65
|
>
|
|
56
|
-
<
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
className={classes.avatar}
|
|
74
|
-
sx={{ width: 30, height: 30 }}
|
|
75
|
-
/>
|
|
76
|
-
</ListItemAvatar>
|
|
77
|
-
<ListItemText>
|
|
78
|
-
{group.name}
|
|
79
|
-
{group.stores.length <= 1 && ` — ${group.stores[0].store_name}`}
|
|
66
|
+
<ListItemAvatar>
|
|
67
|
+
<FlagAvatar
|
|
68
|
+
country={code}
|
|
69
|
+
className={classes.avatar}
|
|
70
|
+
sx={{ width: 30, height: 30 }}
|
|
71
|
+
/>
|
|
72
|
+
</ListItemAvatar>
|
|
73
|
+
<ListItemText>
|
|
74
|
+
{group.name}
|
|
75
|
+
{group.stores.length <= 1 && ` — ${group.stores[0].store_name}`}
|
|
76
|
+
|
|
77
|
+
{process.env.NODE_ENV !== 'production' &&
|
|
78
|
+
!storeToLocale(group.stores[0].store_code) && (
|
|
79
|
+
<> 🚨 Could not find configuration in .env</>
|
|
80
|
+
)}
|
|
81
|
+
</ListItemText>
|
|
82
|
+
</ListItemButton>
|
|
80
83
|
|
|
81
|
-
{process.env.NODE_ENV !== 'production' &&
|
|
82
|
-
!storeToLocale(group.stores[0].store_code) && (
|
|
83
|
-
<> 🚨 Could not find configuration in .env</>
|
|
84
|
-
)}
|
|
85
|
-
</ListItemText>
|
|
86
|
-
</ListItem>
|
|
87
|
-
</PageLink>
|
|
88
84
|
{group.stores.length > 1 && (
|
|
89
85
|
<Collapse in timeout='auto'>
|
|
90
86
|
{group.stores.map((store) => (
|
|
91
|
-
<
|
|
87
|
+
<ListItemButton
|
|
92
88
|
key={store.locale}
|
|
93
89
|
href='/switch-stores'
|
|
94
90
|
locale={storeToLocale(store.store_code)}
|
|
95
91
|
replace
|
|
96
|
-
|
|
92
|
+
disabled={!localeToStore(locale)}
|
|
93
|
+
component={NextLink}
|
|
94
|
+
selected={localeToStore(locale) === store.store_code}
|
|
95
|
+
color='inherit'
|
|
96
|
+
className={classes.listItemIndented}
|
|
97
|
+
sx={{
|
|
98
|
+
paddingLeft: '30px',
|
|
99
|
+
cursor: 'pointer',
|
|
100
|
+
}}
|
|
97
101
|
>
|
|
98
|
-
<
|
|
99
|
-
|
|
100
|
-
button
|
|
101
|
-
component='a'
|
|
102
|
-
selected={localeToStore(locale) === store.store_code}
|
|
103
|
-
color='inherit'
|
|
104
|
-
className={classes.listItemIndented}
|
|
105
|
-
sx={{
|
|
106
|
-
paddingLeft: '30px',
|
|
107
|
-
cursor: 'pointer',
|
|
108
|
-
}}
|
|
109
|
-
>
|
|
110
|
-
<ListItemText inset>
|
|
111
|
-
{store.store_name}
|
|
102
|
+
<ListItemText inset>
|
|
103
|
+
{store.store_name}
|
|
112
104
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
</PageLink>
|
|
105
|
+
{process.env.NODE_ENV !== 'production' && !localeToStore(locale) && (
|
|
106
|
+
<> 🚨 Could not find configuration in .env</>
|
|
107
|
+
)}
|
|
108
|
+
</ListItemText>
|
|
109
|
+
</ListItemButton>
|
|
119
110
|
))}
|
|
120
111
|
</Collapse>
|
|
121
112
|
)}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/magento-store",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "5.2.0-canary.
|
|
5
|
+
"version": "5.2.0-canary.3",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,21 +12,21 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@graphcommerce/eslint-config-pwa": "5.2.0-canary.
|
|
16
|
-
"@graphcommerce/prettier-config-pwa": "5.2.0-canary.
|
|
17
|
-
"@graphcommerce/typescript-config-pwa": "5.2.0-canary.
|
|
15
|
+
"@graphcommerce/eslint-config-pwa": "5.2.0-canary.3",
|
|
16
|
+
"@graphcommerce/prettier-config-pwa": "5.2.0-canary.3",
|
|
17
|
+
"@graphcommerce/typescript-config-pwa": "5.2.0-canary.3"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@graphcommerce/graphql": "5.2.0-canary.
|
|
21
|
-
"@graphcommerce/graphql-mesh": "5.2.0-canary.
|
|
22
|
-
"@graphcommerce/image": "5.2.0-canary.
|
|
23
|
-
"@graphcommerce/next-ui": "5.2.0-canary.
|
|
20
|
+
"@graphcommerce/graphql": "5.2.0-canary.3",
|
|
21
|
+
"@graphcommerce/graphql-mesh": "5.2.0-canary.3",
|
|
22
|
+
"@graphcommerce/image": "5.2.0-canary.3",
|
|
23
|
+
"@graphcommerce/next-ui": "5.2.0-canary.3"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"@lingui/react": "^3.13.2",
|
|
27
27
|
"@lingui/core": "^3.13.2",
|
|
28
28
|
"@mui/material": "^5.10.16",
|
|
29
|
-
"next": "^
|
|
29
|
+
"next": "^13.1.1",
|
|
30
30
|
"react": "^18.2.0",
|
|
31
31
|
"react-dom": "^18.2.0"
|
|
32
32
|
}
|