@graphcommerce/magento-wishlist 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 +2 -0
- package/components/ProductWishlistChip/ProductWishlistChipBase.tsx +10 -12
- package/components/WishlistFab/WishlistFab.tsx +20 -22
- package/components/WishlistItem/ProductAddToCart.tsx +10 -12
- package/components/WishlistItem/WishlistItemBase.tsx +46 -49
- package/package.json +14 -14
package/CHANGELOG.md
CHANGED
|
@@ -17,7 +17,6 @@ import {
|
|
|
17
17
|
import { i18n } from '@lingui/core'
|
|
18
18
|
import { Trans } from '@lingui/react'
|
|
19
19
|
import { SxProps, Theme, IconButton, Box, IconButtonProps } from '@mui/material'
|
|
20
|
-
import PageLink from 'next/link'
|
|
21
20
|
import { useState, useEffect } from 'react'
|
|
22
21
|
import { useWishlistEnabled } from '../../hooks'
|
|
23
22
|
import { AddProductToWishlistDocument } from '../../queries/AddProductToWishlist.gql'
|
|
@@ -210,17 +209,16 @@ export function ProductWishlistChipBase(props: ProductWishlistChipProps) {
|
|
|
210
209
|
onClose={() => setDisplayMessageBar(false)}
|
|
211
210
|
variant='pill'
|
|
212
211
|
action={
|
|
213
|
-
<
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
</PageLink>
|
|
212
|
+
<Button
|
|
213
|
+
href='/wishlist'
|
|
214
|
+
id='view-wishlist-button'
|
|
215
|
+
size='medium'
|
|
216
|
+
variant='pill'
|
|
217
|
+
color='secondary'
|
|
218
|
+
endIcon={<IconSvg src={iconChevronRight} />}
|
|
219
|
+
>
|
|
220
|
+
<Trans id='View wishlist' />
|
|
221
|
+
</Button>
|
|
224
222
|
}
|
|
225
223
|
>
|
|
226
224
|
<Trans
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
import { iconHeart, DesktopHeaderBadge, IconSvg, extendableComponent } from '@graphcommerce/next-ui'
|
|
7
7
|
import { i18n } from '@lingui/core'
|
|
8
8
|
import { Fab, FabProps as FabPropsType, NoSsr, SxProps, Theme } from '@mui/material'
|
|
9
|
-
import PageLink from 'next/link'
|
|
10
9
|
import React from 'react'
|
|
11
10
|
import { useWishlistEnabled } from '../../hooks'
|
|
12
11
|
import { GetIsInWishlistsDocument } from '../../queries/GetIsInWishlists.gql'
|
|
@@ -31,27 +30,26 @@ function WishlistFabContent(props: WishlistFabContentProps) {
|
|
|
31
30
|
const wishlistIcon = icon ?? <IconSvg src={iconHeart} size='large' />
|
|
32
31
|
|
|
33
32
|
return (
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
</PageLink>
|
|
33
|
+
<Fab
|
|
34
|
+
href='/wishlist'
|
|
35
|
+
color='inherit'
|
|
36
|
+
data-test-id='wishlist-fab'
|
|
37
|
+
aria-label={i18n._(/* i18n */ 'Wishlist')}
|
|
38
|
+
size='large'
|
|
39
|
+
className={classes.root}
|
|
40
|
+
{...FabProps}
|
|
41
|
+
sx={sx}
|
|
42
|
+
>
|
|
43
|
+
<NoSsr fallback={wishlistIcon}>
|
|
44
|
+
{activeWishlist ? (
|
|
45
|
+
<DesktopHeaderBadge color='primary' variant='dot' overlap='circular'>
|
|
46
|
+
{wishlistIcon}
|
|
47
|
+
</DesktopHeaderBadge>
|
|
48
|
+
) : (
|
|
49
|
+
wishlistIcon
|
|
50
|
+
)}
|
|
51
|
+
</NoSsr>
|
|
52
|
+
</Fab>
|
|
55
53
|
)
|
|
56
54
|
}
|
|
57
55
|
|
|
@@ -15,7 +15,6 @@ import {
|
|
|
15
15
|
} from '@graphcommerce/next-ui'
|
|
16
16
|
import { Trans } from '@lingui/react'
|
|
17
17
|
import { ButtonProps, Box, Alert } from '@mui/material'
|
|
18
|
-
import PageLink from 'next/link'
|
|
19
18
|
import React from 'react'
|
|
20
19
|
|
|
21
20
|
const { classes, selectors } = extendableComponent('ProductAddToCart', [
|
|
@@ -109,17 +108,16 @@ export function ProductAddToCart(
|
|
|
109
108
|
variant='pill'
|
|
110
109
|
autoHide
|
|
111
110
|
action={
|
|
112
|
-
<
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
</PageLink>
|
|
111
|
+
<Button
|
|
112
|
+
href='/cart'
|
|
113
|
+
id='view-shopping-cart-button'
|
|
114
|
+
size='medium'
|
|
115
|
+
variant='pill'
|
|
116
|
+
color='secondary'
|
|
117
|
+
endIcon={<IconSvg src={iconChevronRight} />}
|
|
118
|
+
>
|
|
119
|
+
<Trans id='View shopping cart' />
|
|
120
|
+
</Button>
|
|
123
121
|
}
|
|
124
122
|
>
|
|
125
123
|
<Trans
|
|
@@ -9,7 +9,6 @@ import { Badge, Box, Link, SxProps, Theme, Typography } from '@mui/material'
|
|
|
9
9
|
import IconButton from '@mui/material/IconButton'
|
|
10
10
|
import Menu from '@mui/material/Menu'
|
|
11
11
|
import MenuItem from '@mui/material/MenuItem'
|
|
12
|
-
import PageLink from 'next/link'
|
|
13
12
|
import { useState } from 'react'
|
|
14
13
|
import { GetIsInWishlistsDocument } from '../../queries/GetIsInWishlists.gql'
|
|
15
14
|
import { RemoveProductFromWishlistDocument } from '../../queries/RemoveProductFromWishlist.gql'
|
|
@@ -176,56 +175,54 @@ export function WishlistItemBase(props: WishlistItemBaseProps) {
|
|
|
176
175
|
alignSelf: 'flex-start',
|
|
177
176
|
})}
|
|
178
177
|
>
|
|
179
|
-
<
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
</PageLink>
|
|
178
|
+
<Box
|
|
179
|
+
href={productLink}
|
|
180
|
+
component='a'
|
|
181
|
+
className={classes.productLink}
|
|
182
|
+
sx={{ display: 'block', width: '100%', overflow: 'hidden' }}
|
|
183
|
+
>
|
|
184
|
+
{small_image?.url && (
|
|
185
|
+
<Image
|
|
186
|
+
src={small_image.url ?? ''}
|
|
187
|
+
layout='fill'
|
|
188
|
+
alt={small_image.label ?? name ?? ''}
|
|
189
|
+
sizes={responsiveVal(70, 125)}
|
|
190
|
+
className={classes.image}
|
|
191
|
+
sx={(theme) => ({
|
|
192
|
+
gridColumn: 1,
|
|
193
|
+
backgroundColor: theme.palette.background.image,
|
|
194
|
+
objectFit: 'cover',
|
|
195
|
+
display: 'block',
|
|
196
|
+
width: '110% !important',
|
|
197
|
+
height: '110% !important',
|
|
198
|
+
marginLeft: '-5%',
|
|
199
|
+
marginTop: '-5%',
|
|
200
|
+
})}
|
|
201
|
+
/>
|
|
202
|
+
)}
|
|
203
|
+
</Box>
|
|
206
204
|
</Badge>
|
|
207
205
|
|
|
208
|
-
<
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
</PageLink>
|
|
206
|
+
<Link
|
|
207
|
+
href={productLink}
|
|
208
|
+
variant='body1'
|
|
209
|
+
className={classes.itemName}
|
|
210
|
+
underline='hover'
|
|
211
|
+
sx={(theme) => ({
|
|
212
|
+
typgrapht: 'subtitle1',
|
|
213
|
+
fontWeight: theme.typography.fontWeightBold,
|
|
214
|
+
gridArea: 'itemName',
|
|
215
|
+
color: theme.palette.text.primary,
|
|
216
|
+
textDecoration: 'none',
|
|
217
|
+
flexWrap: 'nowrap',
|
|
218
|
+
maxWidth: 'max-content',
|
|
219
|
+
'&:not(.withOptions)': {
|
|
220
|
+
alignSelf: 'flex-start',
|
|
221
|
+
},
|
|
222
|
+
})}
|
|
223
|
+
>
|
|
224
|
+
{name}
|
|
225
|
+
</Link>
|
|
229
226
|
|
|
230
227
|
<Typography
|
|
231
228
|
component='div'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphcommerce/magento-wishlist",
|
|
3
|
-
"version": "5.2.0-canary.
|
|
3
|
+
"version": "5.2.0-canary.3",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
6
6
|
"browserslist": [
|
|
@@ -13,27 +13,27 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@graphcommerce/eslint-config-pwa": "5.2.0-canary.
|
|
17
|
-
"@graphcommerce/prettier-config-pwa": "5.2.0-canary.
|
|
18
|
-
"@graphcommerce/typescript-config-pwa": "5.2.0-canary.
|
|
16
|
+
"@graphcommerce/eslint-config-pwa": "5.2.0-canary.3",
|
|
17
|
+
"@graphcommerce/prettier-config-pwa": "5.2.0-canary.3",
|
|
18
|
+
"@graphcommerce/typescript-config-pwa": "5.2.0-canary.3"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@graphcommerce/graphql": "5.2.0-canary.
|
|
22
|
-
"@graphcommerce/graphql-mesh": "5.2.0-canary.
|
|
23
|
-
"@graphcommerce/image": "5.2.0-canary.
|
|
24
|
-
"@graphcommerce/magento-cart": "5.2.0-canary.
|
|
25
|
-
"@graphcommerce/magento-customer": "5.2.0-canary.
|
|
26
|
-
"@graphcommerce/magento-product": "5.2.0-canary.
|
|
27
|
-
"@graphcommerce/magento-product-configurable": "5.2.0-canary.
|
|
28
|
-
"@graphcommerce/magento-store": "5.2.0-canary.
|
|
29
|
-
"@graphcommerce/next-ui": "5.2.0-canary.
|
|
21
|
+
"@graphcommerce/graphql": "5.2.0-canary.3",
|
|
22
|
+
"@graphcommerce/graphql-mesh": "5.2.0-canary.3",
|
|
23
|
+
"@graphcommerce/image": "5.2.0-canary.3",
|
|
24
|
+
"@graphcommerce/magento-cart": "5.2.0-canary.3",
|
|
25
|
+
"@graphcommerce/magento-customer": "5.2.0-canary.3",
|
|
26
|
+
"@graphcommerce/magento-product": "5.2.0-canary.3",
|
|
27
|
+
"@graphcommerce/magento-product-configurable": "5.2.0-canary.3",
|
|
28
|
+
"@graphcommerce/magento-store": "5.2.0-canary.3",
|
|
29
|
+
"@graphcommerce/next-ui": "5.2.0-canary.3"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"@lingui/react": "^3.13.2",
|
|
33
33
|
"@lingui/core": "^3.13.2",
|
|
34
34
|
"@mui/material": "^5.10.16",
|
|
35
35
|
"framer-motion": "^7.0.0",
|
|
36
|
-
"next": "^
|
|
36
|
+
"next": "^13.1.1",
|
|
37
37
|
"react": "^18.2.0",
|
|
38
38
|
"react-dom": "^18.2.0"
|
|
39
39
|
}
|