@graphcommerce/magento-customer 5.2.0-canary.2 → 5.2.0-canary.4
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 +4 -0
- package/components/AccountAddress/AccountAddress.tsx +3 -6
- package/components/AccountAddresses/AccountAddresses.tsx +17 -21
- package/components/AccountMenuItem/AccountMenuItem.tsx +2 -10
- package/components/AccountOrders/AccountOrders.tsx +7 -6
- package/components/AccountSignInUpForm/AccountSignInUpForm.tsx +3 -6
- package/components/ApolloCustomerError/ApolloCustomerErrorAlert.tsx +3 -6
- package/components/ApolloCustomerError/ApolloCustomerErrorFullPage.tsx +3 -6
- package/components/ApolloCustomerError/ApolloCustomerErrorSnackbar.tsx +3 -6
- package/components/CustomerFab/CustomerFab.tsx +18 -20
- package/components/OrderCard/OrderCard.tsx +78 -80
- package/components/OrderItem/OrderItem.tsx +56 -59
- package/components/SignInForm/SignInForm.tsx +3 -6
- package/components/SignInForm/SignInFormInline.tsx +9 -11
- package/components/WaitForCustomer/WaitForCustomer.tsx +7 -10
- package/package.json +14 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { extendableComponent } from '@graphcommerce/next-ui'
|
|
2
2
|
import { Trans } from '@lingui/react'
|
|
3
3
|
import { Box, Link, SxProps, Theme } from '@mui/material'
|
|
4
|
-
import PageLink from 'next/link'
|
|
5
4
|
import { AddressMultiLine } from '../AddressMultiLine/AddressMultiLine'
|
|
6
5
|
import { DeleteCustomerAddressForm } from '../DeleteCustomerAddressForm/DeleteCustomerAddressForm'
|
|
7
6
|
import { UpdateDefaultAddressForm } from '../UpdateDefaultAddressForm/UpdateDefaultAddressForm'
|
|
@@ -46,11 +45,9 @@ export function AccountAddress(props: AccountAddressProps) {
|
|
|
46
45
|
textAlign: 'right',
|
|
47
46
|
}}
|
|
48
47
|
>
|
|
49
|
-
<
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
</Link>
|
|
53
|
-
</PageLink>
|
|
48
|
+
<Link href={`/account/addresses/edit?addressId=${id}`} color='primary' underline='hover'>
|
|
49
|
+
<Trans id='Edit' />
|
|
50
|
+
</Link>
|
|
54
51
|
<DeleteCustomerAddressForm addressId={id ?? undefined} />
|
|
55
52
|
</Box>
|
|
56
53
|
</Box>
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
} from '@graphcommerce/next-ui'
|
|
8
8
|
import { Trans } from '@lingui/react'
|
|
9
9
|
import { Skeleton, Button, Box, Theme, SxProps } from '@mui/material'
|
|
10
|
-
import Link from 'next/link'
|
|
11
10
|
import { AccountAddress } from '../AccountAddress/AccountAddress'
|
|
12
11
|
import { AccountAddressesFragment } from './AccountAddresses.gql'
|
|
13
12
|
|
|
@@ -59,11 +58,9 @@ export function AccountAddresses(props: AccountAddressesProps) {
|
|
|
59
58
|
title={<Trans id='You have no addresses saved yet' />}
|
|
60
59
|
icon={<IconSvg src={iconHome} size='xxl' />}
|
|
61
60
|
button={
|
|
62
|
-
<
|
|
63
|
-
<
|
|
64
|
-
|
|
65
|
-
</Button>
|
|
66
|
-
</Link>
|
|
61
|
+
<Button href='/account/addresses/add' size='large' variant='pill' color='primary'>
|
|
62
|
+
<Trans id='Add new address' />
|
|
63
|
+
</Button>
|
|
67
64
|
}
|
|
68
65
|
/>
|
|
69
66
|
)}
|
|
@@ -79,21 +76,20 @@ export function AccountAddresses(props: AccountAddressesProps) {
|
|
|
79
76
|
))}
|
|
80
77
|
</Box>
|
|
81
78
|
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
</Link>
|
|
79
|
+
<Button
|
|
80
|
+
href='/account/addresses/add'
|
|
81
|
+
className={classes.button}
|
|
82
|
+
variant='pill'
|
|
83
|
+
color='primary'
|
|
84
|
+
size='large'
|
|
85
|
+
sx={(theme) => ({
|
|
86
|
+
display: 'block',
|
|
87
|
+
maxWidth: 'max-content',
|
|
88
|
+
margin: `${theme.spacings.md} auto`,
|
|
89
|
+
})}
|
|
90
|
+
>
|
|
91
|
+
<Trans id='Add new address' />
|
|
92
|
+
</Button>
|
|
97
93
|
</SectionContainer>
|
|
98
94
|
)}
|
|
99
95
|
</>
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
extendableComponent,
|
|
9
9
|
} from '@graphcommerce/next-ui'
|
|
10
10
|
import { ListItem, ListItemIcon, ListItemText, SxProps, Theme } from '@mui/material'
|
|
11
|
-
import PageLink from 'next/link'
|
|
12
11
|
import React from 'react'
|
|
13
12
|
|
|
14
13
|
export type AccountMenuItemProps = {
|
|
@@ -39,8 +38,9 @@ export function AccountMenuItem(props: AccountMenuItemProps) {
|
|
|
39
38
|
} = props
|
|
40
39
|
const classes = withState({ noBorderBottom })
|
|
41
40
|
|
|
42
|
-
|
|
41
|
+
return (
|
|
43
42
|
<Button
|
|
43
|
+
href={href}
|
|
44
44
|
disabled={disabled}
|
|
45
45
|
className={classes.root}
|
|
46
46
|
sx={[
|
|
@@ -94,12 +94,4 @@ export function AccountMenuItem(props: AccountMenuItemProps) {
|
|
|
94
94
|
</ListItem>
|
|
95
95
|
</Button>
|
|
96
96
|
)
|
|
97
|
-
|
|
98
|
-
return href ? (
|
|
99
|
-
<PageLink href={href} passHref>
|
|
100
|
-
{button}
|
|
101
|
-
</PageLink>
|
|
102
|
-
) : (
|
|
103
|
-
button
|
|
104
|
-
)
|
|
105
97
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Pagination, SectionContainer, extendableComponent } from '@graphcommerce/next-ui'
|
|
2
2
|
import { Trans } from '@lingui/react'
|
|
3
3
|
import { Box, Link, SxProps, Theme } from '@mui/material'
|
|
4
|
-
import PageLink from 'next/link'
|
|
5
4
|
import React from 'react'
|
|
6
5
|
import useOrderCardItemImages from '../../hooks/useOrderCardItemImages'
|
|
7
6
|
import { NoOrdersFound } from '../NoOrdersFound/NoOrdersFound'
|
|
@@ -76,11 +75,13 @@ export function AccountOrders(props: AccountOrdersProps) {
|
|
|
76
75
|
count={pageInfo?.total_pages ?? 1}
|
|
77
76
|
page={pageInfo?.current_page ?? 1}
|
|
78
77
|
renderLink={(p: number, icon: React.ReactNode) => (
|
|
79
|
-
<
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
78
|
+
<Link
|
|
79
|
+
href={p === 1 ? '/account/orders' : `/account/orders?page=${p}`}
|
|
80
|
+
color='primary'
|
|
81
|
+
underline='hover'
|
|
82
|
+
>
|
|
83
|
+
{icon}
|
|
84
|
+
</Link>
|
|
84
85
|
)}
|
|
85
86
|
/>
|
|
86
87
|
</Box>
|
|
@@ -17,7 +17,6 @@ import {
|
|
|
17
17
|
import { emailPattern } from '@graphcommerce/react-hook-form'
|
|
18
18
|
import { Trans } from '@lingui/react'
|
|
19
19
|
import { Box, CircularProgress, Link, SxProps, TextField, Theme, Typography } from '@mui/material'
|
|
20
|
-
import PageLink from 'next/link'
|
|
21
20
|
import router from 'next/router'
|
|
22
21
|
|
|
23
22
|
export type AccountSignInUpFormProps = { sx?: SxProps<Theme> }
|
|
@@ -80,11 +79,9 @@ export function AccountSignInUpForm(props: AccountSignInUpFormProps) {
|
|
|
80
79
|
<Trans id='Hi {firstname}! You’re now logged in!' values={{ firstname }} />
|
|
81
80
|
</LayoutTitle>
|
|
82
81
|
<Typography variant='h6' align='center'>
|
|
83
|
-
<
|
|
84
|
-
<
|
|
85
|
-
|
|
86
|
-
</Link>
|
|
87
|
-
</PageLink>
|
|
82
|
+
<Link href='/account' underline='hover' color='secondary'>
|
|
83
|
+
<Trans id='View your account' />
|
|
84
|
+
</Link>
|
|
88
85
|
</Typography>
|
|
89
86
|
|
|
90
87
|
<FormActions>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ApolloErrorAlert, ApolloErrorAlertProps } from '@graphcommerce/ecommerce-ui'
|
|
2
2
|
import { Trans } from '@lingui/react'
|
|
3
3
|
import { Link } from '@mui/material'
|
|
4
|
-
import NextLink from 'next/link'
|
|
5
4
|
import { useCustomerSession } from '../../hooks/useCustomerSession'
|
|
6
5
|
import { useAuthorizationErrorMasked } from './useAuthorizationErrorMasked'
|
|
7
6
|
|
|
@@ -18,11 +17,9 @@ export function ApolloCustomerErrorAlert(props: ApolloCustomerErrorAlertProps) {
|
|
|
18
17
|
error={newError}
|
|
19
18
|
graphqlErrorAlertProps={{
|
|
20
19
|
action: unauthorized ? (
|
|
21
|
-
<
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
</Link>
|
|
25
|
-
</NextLink>
|
|
20
|
+
<Link href='/account/signin' underline='hover'>
|
|
21
|
+
{token ? <Trans id='Sign in' /> : <Trans id='Create Account' />}
|
|
22
|
+
</Link>
|
|
26
23
|
) : (
|
|
27
24
|
graphqlErrorAlertProps?.action
|
|
28
25
|
),
|
|
@@ -2,7 +2,6 @@ import { ApolloErrorFullPage, ApolloErrorFullPageProps } from '@graphcommerce/ec
|
|
|
2
2
|
import { iconPerson, IconSvg } from '@graphcommerce/next-ui'
|
|
3
3
|
import { Trans } from '@lingui/react'
|
|
4
4
|
import { Button } from '@mui/material'
|
|
5
|
-
import PageLink from 'next/link'
|
|
6
5
|
import type { SetOptional } from 'type-fest'
|
|
7
6
|
import { useCustomerSession } from '../../hooks/useCustomerSession'
|
|
8
7
|
import { useAuthorizationErrorMasked } from './useAuthorizationErrorMasked'
|
|
@@ -26,11 +25,9 @@ export function ApolloCustomerErrorFullPage(props: ApolloCustomerErrorFullPagePr
|
|
|
26
25
|
error={newError}
|
|
27
26
|
button={
|
|
28
27
|
unauthorized ? (
|
|
29
|
-
<
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
</Button>
|
|
33
|
-
</PageLink>
|
|
28
|
+
<Button href='/account/signin' variant='pill' color='primary' size='large'>
|
|
29
|
+
{token ? <Trans id='Sign in' /> : <Trans id='Sign in or create an account!' />}
|
|
30
|
+
</Button>
|
|
34
31
|
) : (
|
|
35
32
|
button
|
|
36
33
|
)
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ApolloErrorSnackbar, ApolloErrorSnackbarProps } from '@graphcommerce/ecommerce-ui'
|
|
2
2
|
import { Trans } from '@lingui/react'
|
|
3
3
|
import { Button } from '@mui/material'
|
|
4
|
-
import NextLink from 'next/link'
|
|
5
4
|
import { useCustomerSession } from '../../hooks/useCustomerSession'
|
|
6
5
|
import { useAuthorizationErrorMasked } from './useAuthorizationErrorMasked'
|
|
7
6
|
|
|
@@ -18,11 +17,9 @@ export function ApolloCustomerErrorSnackbar(props: ApolloCustomerErrorSnackbarPr
|
|
|
18
17
|
error={newError}
|
|
19
18
|
action={
|
|
20
19
|
unauthorized ? (
|
|
21
|
-
<
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
</Button>
|
|
25
|
-
</NextLink>
|
|
20
|
+
<Button href='/account/signin' variant='pill' color='secondary'>
|
|
21
|
+
{token ? <Trans id='Sign in' /> : <Trans id='Create Account' />}
|
|
22
|
+
</Button>
|
|
26
23
|
) : (
|
|
27
24
|
action
|
|
28
25
|
)
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
} 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 { useCustomerSession, UseCustomerSessionReturn } from '../../hooks'
|
|
12
11
|
|
|
@@ -27,26 +26,25 @@ function CustomerFabContent(props: CustomerFabContentProps) {
|
|
|
27
26
|
const { session, icon, guestHref, authHref, FabProps, sx } = props
|
|
28
27
|
|
|
29
28
|
return (
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
29
|
+
<Fab
|
|
30
|
+
href={session?.requireAuth ? guestHref : authHref}
|
|
31
|
+
color='inherit'
|
|
32
|
+
id='account'
|
|
33
|
+
aria-label={i18n._(/* i18n */ 'Account')}
|
|
34
|
+
size='large'
|
|
35
|
+
className={classes.root}
|
|
36
|
+
{...FabProps}
|
|
37
|
+
sx={sx}
|
|
38
|
+
>
|
|
39
|
+
<DesktopHeaderBadge
|
|
40
|
+
badgeContent={session?.token ? 1 : 0}
|
|
41
|
+
color={session?.valid ? 'primary' : 'error'}
|
|
42
|
+
variant='dot'
|
|
43
|
+
overlap='circular'
|
|
39
44
|
>
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
variant='dot'
|
|
44
|
-
overlap='circular'
|
|
45
|
-
>
|
|
46
|
-
{icon ?? <IconSvg src={iconPerson} size='large' />}
|
|
47
|
-
</DesktopHeaderBadge>
|
|
48
|
-
</Fab>
|
|
49
|
-
</PageLink>
|
|
45
|
+
{icon ?? <IconSvg src={iconPerson} size='large' />}
|
|
46
|
+
</DesktopHeaderBadge>
|
|
47
|
+
</Fab>
|
|
50
48
|
)
|
|
51
49
|
}
|
|
52
50
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Money } from '@graphcommerce/magento-store'
|
|
2
2
|
import { extendableComponent, useDateTimeFormat } from '@graphcommerce/next-ui'
|
|
3
3
|
import { Box, styled, SxProps, Theme, Skeleton, ListItemButton } from '@mui/material'
|
|
4
|
-
import PageLink from 'next/link'
|
|
5
4
|
import { UseOrderCardItemImages } from '../../hooks/useOrderCardItemImages'
|
|
6
5
|
import { OrderCardItemImage } from '../OrderCardItemImage/OrderCardItemImage'
|
|
7
6
|
import { OrderStateLabel } from '../OrderStateLabel/OrderStateLabel'
|
|
@@ -75,86 +74,85 @@ export function OrderCard(props: OrderCardProps) {
|
|
|
75
74
|
}
|
|
76
75
|
|
|
77
76
|
return (
|
|
78
|
-
<
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
</Box>
|
|
97
|
-
<span>{dateFormatter.format(new Date(order_date ?? ''))}</span>
|
|
98
|
-
<span>#{number}</span>
|
|
99
|
-
</OrderRow>
|
|
100
|
-
<OrderRow>
|
|
101
|
-
<OrderStateLabel
|
|
102
|
-
items={items}
|
|
103
|
-
renderer={{
|
|
104
|
-
Ordered: () => <span>Your order is being processed</span>,
|
|
105
|
-
Invoiced: () => <span>Your order has been invoiced</span>,
|
|
106
|
-
Shipped: () => <span>Your order is on its way!</span>,
|
|
107
|
-
Refunded: () => <span>Your order has been refunded</span>,
|
|
108
|
-
Canceled: () => <span>Your order has been canceled</span>,
|
|
109
|
-
Returned: () => <span>Your order has been returned</span>,
|
|
110
|
-
Partial: () => <span>Your order has been partially processed</span>,
|
|
111
|
-
}}
|
|
112
|
-
/>
|
|
113
|
-
</OrderRow>
|
|
114
|
-
<Box className={classes.orderProducts}>
|
|
115
|
-
<Box
|
|
116
|
-
className={classes.images}
|
|
117
|
-
sx={(theme) => ({
|
|
118
|
-
display: 'grid',
|
|
119
|
-
gridAutoFlow: 'column',
|
|
120
|
-
gap: theme.spacings.xxs,
|
|
121
|
-
gridTemplateColumns: 'repeat(auto-fit, 88px)',
|
|
122
|
-
placeContent: 'center',
|
|
123
|
-
placeItems: 'center',
|
|
124
|
-
padding: theme.spacings.xxs,
|
|
125
|
-
})}
|
|
126
|
-
>
|
|
127
|
-
{items
|
|
128
|
-
?.slice(0, maxItemsInRow)
|
|
129
|
-
.map(
|
|
130
|
-
(item) =>
|
|
131
|
-
item?.product_url_key &&
|
|
132
|
-
images?.[item.product_url_key] && (
|
|
133
|
-
<OrderCardItemImage
|
|
134
|
-
key={item.product_url_key}
|
|
135
|
-
{...images[item.product_url_key]}
|
|
136
|
-
/>
|
|
137
|
-
),
|
|
138
|
-
)}
|
|
139
|
-
{totalItems > maxItemsInRow && (
|
|
140
|
-
<Box
|
|
141
|
-
className={classes.placeholder}
|
|
142
|
-
sx={{
|
|
143
|
-
display: 'flex',
|
|
144
|
-
justifyContent: 'center',
|
|
145
|
-
alignItems: 'center',
|
|
146
|
-
width: 88,
|
|
147
|
-
height: 88,
|
|
148
|
-
}}
|
|
149
|
-
>{`+${totalItems - maxItemsInRow}`}</Box>
|
|
150
|
-
)}
|
|
151
|
-
</Box>
|
|
77
|
+
<ListItemButton
|
|
78
|
+
href={`/account/orders/view?orderId=${number}`}
|
|
79
|
+
className={classes.buttonRoot}
|
|
80
|
+
sx={[
|
|
81
|
+
(theme) => ({
|
|
82
|
+
width: '100%',
|
|
83
|
+
boxShadow: 'none',
|
|
84
|
+
marginTop: theme.spacings.xxs,
|
|
85
|
+
borderBottom: `1px solid ${theme.palette.divider}`,
|
|
86
|
+
'&:hover': { background: 'none' },
|
|
87
|
+
}),
|
|
88
|
+
...(Array.isArray(sx) ? sx : [sx]),
|
|
89
|
+
]}
|
|
90
|
+
>
|
|
91
|
+
<OrderContainer className={classes.orderContainer}>
|
|
92
|
+
<OrderRow>
|
|
93
|
+
<Box component='span' className={classes.orderMoney} sx={{ fontWeight: 'bold' }}>
|
|
94
|
+
<Money {...total?.grand_total} />
|
|
152
95
|
</Box>
|
|
153
|
-
<
|
|
154
|
-
|
|
96
|
+
<span>{dateFormatter.format(new Date(order_date ?? ''))}</span>
|
|
97
|
+
<span>#{number}</span>
|
|
98
|
+
</OrderRow>
|
|
99
|
+
<OrderRow>
|
|
100
|
+
<OrderStateLabel
|
|
101
|
+
items={items}
|
|
102
|
+
renderer={{
|
|
103
|
+
Ordered: () => <span>Your order is being processed</span>,
|
|
104
|
+
Invoiced: () => <span>Your order has been invoiced</span>,
|
|
105
|
+
Shipped: () => <span>Your order is on its way!</span>,
|
|
106
|
+
Refunded: () => <span>Your order has been refunded</span>,
|
|
107
|
+
Canceled: () => <span>Your order has been canceled</span>,
|
|
108
|
+
Returned: () => <span>Your order has been returned</span>,
|
|
109
|
+
Partial: () => <span>Your order has been partially processed</span>,
|
|
110
|
+
}}
|
|
111
|
+
/>
|
|
112
|
+
</OrderRow>
|
|
113
|
+
<Box className={classes.orderProducts}>
|
|
114
|
+
<Box
|
|
115
|
+
className={classes.images}
|
|
116
|
+
sx={(theme) => ({
|
|
117
|
+
display: 'grid',
|
|
118
|
+
gridAutoFlow: 'column',
|
|
119
|
+
gap: theme.spacings.xxs,
|
|
120
|
+
gridTemplateColumns: 'repeat(auto-fit, 88px)',
|
|
121
|
+
placeContent: 'center',
|
|
122
|
+
placeItems: 'center',
|
|
123
|
+
padding: theme.spacings.xxs,
|
|
124
|
+
})}
|
|
125
|
+
>
|
|
126
|
+
{items
|
|
127
|
+
?.slice(0, maxItemsInRow)
|
|
128
|
+
.map(
|
|
129
|
+
(item) =>
|
|
130
|
+
item?.product_url_key &&
|
|
131
|
+
images?.[item.product_url_key] && (
|
|
132
|
+
<OrderCardItemImage
|
|
133
|
+
key={item.product_url_key}
|
|
134
|
+
{...images[item.product_url_key]}
|
|
135
|
+
/>
|
|
136
|
+
),
|
|
137
|
+
)}
|
|
138
|
+
{totalItems > maxItemsInRow && (
|
|
139
|
+
<Box
|
|
140
|
+
className={classes.placeholder}
|
|
141
|
+
sx={{
|
|
142
|
+
display: 'flex',
|
|
143
|
+
justifyContent: 'center',
|
|
144
|
+
alignItems: 'center',
|
|
145
|
+
width: 88,
|
|
146
|
+
height: 88,
|
|
147
|
+
}}
|
|
148
|
+
>{`+${totalItems - maxItemsInRow}`}</Box>
|
|
149
|
+
)}
|
|
155
150
|
</Box>
|
|
156
|
-
</
|
|
157
|
-
|
|
158
|
-
|
|
151
|
+
</Box>
|
|
152
|
+
<Box className={`${classes.orderRow} ${classes.tracking}`} sx={{ textAlign: 'center' }}>
|
|
153
|
+
{shipments?.[0]?.tracking?.[0] && <TrackingLink {...shipments?.[0].tracking?.[0]} />}
|
|
154
|
+
</Box>
|
|
155
|
+
</OrderContainer>
|
|
156
|
+
</ListItemButton>
|
|
159
157
|
)
|
|
160
158
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Image } from '@graphcommerce/image'
|
|
2
2
|
import { Money } from '@graphcommerce/magento-store'
|
|
3
|
-
import { responsiveVal, extendableComponent } from '@graphcommerce/next-ui'
|
|
3
|
+
import { responsiveVal, extendableComponent, NextLink } from '@graphcommerce/next-ui'
|
|
4
4
|
import { Box } from '@mui/material'
|
|
5
|
-
import PageLink from 'next/link'
|
|
6
5
|
import { OrderCardItemImageFragment } from '../../hooks/OrderCardItemImage.gql'
|
|
7
6
|
import { OrderItemFragment } from './OrderItem.gql'
|
|
8
7
|
|
|
@@ -99,68 +98,66 @@ export function OrderItem(props: OrderItemProps) {
|
|
|
99
98
|
borderRadius: '50%',
|
|
100
99
|
}}
|
|
101
100
|
>
|
|
102
|
-
<
|
|
101
|
+
<Box
|
|
102
|
+
href={productLink}
|
|
103
|
+
component={NextLink}
|
|
104
|
+
className={classes.productLink}
|
|
105
|
+
sx={{ display: 'block', width: '100%', height: '100%' }}
|
|
106
|
+
>
|
|
103
107
|
<Box
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
108
|
+
className={classes.pictureSpacing}
|
|
109
|
+
sx={() => ({
|
|
110
|
+
overflow: 'hidden',
|
|
111
|
+
width: '100%',
|
|
112
|
+
height: '100%',
|
|
113
|
+
display: 'flex',
|
|
114
|
+
position: 'relative',
|
|
115
|
+
alignItems: 'center',
|
|
116
|
+
flexShrink: 0,
|
|
117
|
+
userSelect: 'none',
|
|
118
|
+
borderRadius: '50%',
|
|
119
|
+
justifyContent: 'center',
|
|
120
|
+
})}
|
|
107
121
|
>
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
<Image
|
|
125
|
-
alt={thumbnail?.label ?? ''}
|
|
126
|
-
width={104}
|
|
127
|
-
height={86}
|
|
128
|
-
src={thumbnail?.url ?? ''}
|
|
129
|
-
className={classes.image}
|
|
130
|
-
sx={(theme) => ({
|
|
131
|
-
gridColumn: 1,
|
|
132
|
-
backgroundColor: theme.palette.background.image,
|
|
133
|
-
objectFit: 'cover',
|
|
134
|
-
display: 'block',
|
|
135
|
-
transform: 'scale(1.1)',
|
|
136
|
-
})}
|
|
137
|
-
/>
|
|
138
|
-
)}
|
|
139
|
-
</Box>
|
|
122
|
+
{thumbnail?.url && thumbnail?.label && (
|
|
123
|
+
<Image
|
|
124
|
+
alt={thumbnail?.label ?? ''}
|
|
125
|
+
width={104}
|
|
126
|
+
height={86}
|
|
127
|
+
src={thumbnail?.url ?? ''}
|
|
128
|
+
className={classes.image}
|
|
129
|
+
sx={(theme) => ({
|
|
130
|
+
gridColumn: 1,
|
|
131
|
+
backgroundColor: theme.palette.background.image,
|
|
132
|
+
objectFit: 'cover',
|
|
133
|
+
display: 'block',
|
|
134
|
+
transform: 'scale(1.1)',
|
|
135
|
+
})}
|
|
136
|
+
/>
|
|
137
|
+
)}
|
|
140
138
|
</Box>
|
|
141
|
-
</
|
|
139
|
+
</Box>
|
|
142
140
|
</Box>
|
|
143
141
|
|
|
144
|
-
<
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
</PageLink>
|
|
142
|
+
<Box
|
|
143
|
+
href={productLink}
|
|
144
|
+
component={NextLink}
|
|
145
|
+
className={classes.itemName}
|
|
146
|
+
sx={(theme) => ({
|
|
147
|
+
typography: 'h5',
|
|
148
|
+
fontWeight: 500,
|
|
149
|
+
gridArea: 'itemName',
|
|
150
|
+
color: theme.palette.text.primary,
|
|
151
|
+
textDecoration: 'none',
|
|
152
|
+
flexWrap: 'nowrap',
|
|
153
|
+
maxWidth: 'max-content',
|
|
154
|
+
'&.hasOptions': {
|
|
155
|
+
alignSelf: 'flex-end',
|
|
156
|
+
},
|
|
157
|
+
})}
|
|
158
|
+
>
|
|
159
|
+
{product_name}
|
|
160
|
+
</Box>
|
|
164
161
|
|
|
165
162
|
<Box
|
|
166
163
|
className={classes.itemPrice}
|
|
@@ -4,7 +4,6 @@ import { Button, FormRow, FormActions } from '@graphcommerce/next-ui'
|
|
|
4
4
|
import { useFormGqlMutation } from '@graphcommerce/react-hook-form'
|
|
5
5
|
import { Trans } from '@lingui/react'
|
|
6
6
|
import { Box, FormControl, Link, SxProps, TextField, Theme } from '@mui/material'
|
|
7
|
-
import PageLink from 'next/link'
|
|
8
7
|
import { CustomerDocument } from '../../hooks'
|
|
9
8
|
import { ApolloCustomerErrorAlert } from '../ApolloCustomerError/ApolloCustomerErrorAlert'
|
|
10
9
|
import { SignInDocument } from './SignIn.gql'
|
|
@@ -53,11 +52,9 @@ export function SignInForm(props: SignInFormProps) {
|
|
|
53
52
|
{...muiRegister('password', { required: required.password })}
|
|
54
53
|
InputProps={{
|
|
55
54
|
endAdornment: (
|
|
56
|
-
<
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
</Link>
|
|
60
|
-
</PageLink>
|
|
55
|
+
<Link href='/account/forgot-password' underline='hover' sx={{ whiteSpace: 'nowrap' }}>
|
|
56
|
+
<Trans id='Forgot password?' />
|
|
57
|
+
</Link>
|
|
61
58
|
),
|
|
62
59
|
}}
|
|
63
60
|
helperText={formState.errors.password?.message || authError?.message}
|
|
@@ -2,7 +2,6 @@ import { Button, extendableComponent } from '@graphcommerce/next-ui'
|
|
|
2
2
|
import { useFormGqlMutation } from '@graphcommerce/react-hook-form'
|
|
3
3
|
import { Trans } from '@lingui/react'
|
|
4
4
|
import { Box, SxProps, TextField, Theme } from '@mui/material'
|
|
5
|
-
import PageLink from 'next/link'
|
|
6
5
|
import { SignInDocument, SignInMutationVariables } from './SignIn.gql'
|
|
7
6
|
|
|
8
7
|
type InlineSignInFormProps = Omit<SignInMutationVariables, 'password'> & {
|
|
@@ -56,16 +55,15 @@ export function SignInFormInline(props: InlineSignInFormProps) {
|
|
|
56
55
|
disabled={formState.isSubmitting}
|
|
57
56
|
InputProps={{
|
|
58
57
|
endAdornment: (
|
|
59
|
-
<
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
</PageLink>
|
|
58
|
+
<Button
|
|
59
|
+
href='/account/forgot-password'
|
|
60
|
+
color='secondary'
|
|
61
|
+
variant='text'
|
|
62
|
+
className={classes.button}
|
|
63
|
+
sx={{ minWidth: 'max-content' }}
|
|
64
|
+
>
|
|
65
|
+
<Trans id='Forgot password?' />
|
|
66
|
+
</Button>
|
|
69
67
|
),
|
|
70
68
|
}}
|
|
71
69
|
/>
|
|
@@ -2,7 +2,6 @@ import { mergeErrors, WaitForQueries, WaitForQueriesProps } from '@graphcommerce
|
|
|
2
2
|
import { FullPageMessage, IconSvg, iconPerson } from '@graphcommerce/next-ui'
|
|
3
3
|
import { Trans } from '@lingui/react'
|
|
4
4
|
import { Button, CircularProgress } from '@mui/material'
|
|
5
|
-
import PageLink from 'next/link'
|
|
6
5
|
import React from 'react'
|
|
7
6
|
import { useCustomerSession } from '../../hooks/useCustomerSession'
|
|
8
7
|
import { ApolloCustomerErrorFullPage } from '../ApolloCustomerError/ApolloCustomerErrorFullPage'
|
|
@@ -65,15 +64,13 @@ export function WaitForCustomer(props: WaitForCustomerProps) {
|
|
|
65
64
|
icon={<IconSvg src={iconPerson} size='xxl' />}
|
|
66
65
|
title={<Trans id='You must sign in to continue' />}
|
|
67
66
|
button={
|
|
68
|
-
<
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
</Button>
|
|
76
|
-
</PageLink>
|
|
67
|
+
<Button href='/account/signin' variant='pill' color='secondary' size='large'>
|
|
68
|
+
{!session.valid ? (
|
|
69
|
+
<Trans id='Sign in' />
|
|
70
|
+
) : (
|
|
71
|
+
<Trans id='Sign in or create an account!' />
|
|
72
|
+
)}
|
|
73
|
+
</Button>
|
|
77
74
|
}
|
|
78
75
|
/>
|
|
79
76
|
))}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/magento-customer",
|
|
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.4",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,20 +12,20 @@
|
|
|
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.4",
|
|
16
|
+
"@graphcommerce/prettier-config-pwa": "5.2.0-canary.4",
|
|
17
|
+
"@graphcommerce/typescript-config-pwa": "5.2.0-canary.4"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@graphcommerce/ecommerce-ui": "5.2.0-canary.
|
|
21
|
-
"@graphcommerce/framer-utils": "5.2.0-canary.
|
|
22
|
-
"@graphcommerce/graphql": "5.2.0-canary.
|
|
23
|
-
"@graphcommerce/graphql-mesh": "5.2.0-canary.
|
|
24
|
-
"@graphcommerce/image": "5.2.0-canary.
|
|
25
|
-
"@graphcommerce/magento-graphql": "5.2.0-canary.
|
|
26
|
-
"@graphcommerce/magento-store": "5.2.0-canary.
|
|
27
|
-
"@graphcommerce/next-ui": "5.2.0-canary.
|
|
28
|
-
"@graphcommerce/react-hook-form": "5.2.0-canary.
|
|
20
|
+
"@graphcommerce/ecommerce-ui": "5.2.0-canary.4",
|
|
21
|
+
"@graphcommerce/framer-utils": "5.2.0-canary.4",
|
|
22
|
+
"@graphcommerce/graphql": "5.2.0-canary.4",
|
|
23
|
+
"@graphcommerce/graphql-mesh": "5.2.0-canary.4",
|
|
24
|
+
"@graphcommerce/image": "5.2.0-canary.4",
|
|
25
|
+
"@graphcommerce/magento-graphql": "5.2.0-canary.4",
|
|
26
|
+
"@graphcommerce/magento-store": "5.2.0-canary.4",
|
|
27
|
+
"@graphcommerce/next-ui": "5.2.0-canary.4",
|
|
28
|
+
"@graphcommerce/react-hook-form": "5.2.0-canary.4"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"@lingui/react": "^3.13.2",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@mui/material": "^5.10.16",
|
|
34
34
|
"framer-motion": "^7.0.0",
|
|
35
35
|
"graphql": "^16.0.0",
|
|
36
|
-
"next": "^
|
|
36
|
+
"next": "^13.1.1",
|
|
37
37
|
"react": "^18.2.0",
|
|
38
38
|
"react-dom": "^18.2.0"
|
|
39
39
|
}
|