@riosst100/pwa-marketplace 2.0.8 → 2.1.0
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/.github/workflows/dependabot.yml +28 -28
- package/i18n/en_US.json +508 -509
- package/i18n/id_ID.json +508 -509
- package/package.json +18 -22
- package/src/componentOverrideMapping.js +1 -0
- package/src/components/AccountLayout/index.js +15 -0
- package/src/components/OrderDetail/components/itemsOrdered.js +128 -0
- package/src/components/OrderDetail/components/rmaList.js +114 -0
- package/src/components/OrderDetail/orderDetail.js +204 -0
- package/src/components/OrderDetail/orderDetailPage.js +14 -0
- package/src/components/RMAPage/RMACreate.js +238 -0
- package/src/components/RMAPage/RMACreatePage.js +14 -0
- package/src/components/RMAPage/RMADetail.js +318 -0
- package/src/components/RMAPage/RMADetailPage.js +14 -0
- package/src/components/RMAPage/RMAList.js +241 -0
- package/src/components/RMAPage/RMASelect.js +36 -0
- package/src/components/RMAPage/RMASelectPage.js +13 -0
- package/src/components/RMAPage/components/productItem.js +114 -0
- package/src/components/RMAPage/components/rmaList.js +250 -0
- package/src/components/RMAPage/index.js +14 -0
- package/src/components/RMAPage/orderRow.js +318 -0
- package/src/components/commons/Checkbox/index.js +57 -0
- package/src/components/commons/Collapsible/index.js +51 -0
- package/src/components/commons/Select/index.js +29 -0
- package/src/components/commons/Textfield/index.js +20 -0
- package/src/intercept.js +35 -0
- package/src/overwrites/venia-ui/lib/components/AccountMenu/accountMenu.js +2 -1
- package/src/overwrites/venia-ui/lib/components/Breadcrumbs/breadcrumbs.module.css +38 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/product.js +9 -2
- package/src/overwrites/venia-ui/lib/components/Footer/footer.js +1 -1
- package/src/overwrites/venia-ui/lib/components/Header/header.js +12 -1
- package/src/overwrites/venia-ui/lib/components/Newsletter/newsletter.js +1 -1
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderRow.js +11 -3
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/productFullDetail.js +34 -3
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/productFullDetail.module.css +9 -0
- package/src/overwrites/venia-ui/lib/components/ProductImageCarousel/carousel.module.css +1 -1
- package/src/overwrites/venia-ui/lib/components/WishlistPage/actionMenu.ee.js +54 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/actionMenu.js +7 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/createWishlist.ee.js +129 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/createWishlist.js +3 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/createWishlist.module.css +63 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/index.js +14 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlist.js +193 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlist.module.css +78 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistConfirmRemoveProductDialog.js +84 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistConfirmRemoveProductDialog.module.css +20 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistEditFavoritesListDialog.js +96 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistEditFavoritesListDialog.module.css +22 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistItem.js +138 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistItem.module.css +78 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistItems.js +45 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistItems.module.css +9 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistListActionsDialog.js +61 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistMoreActionsDialog.js +84 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistMoreActionsDialog.module.css +19 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistPage.js +120 -0
- package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistPage.module.css +31 -0
package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistConfirmRemoveProductDialog.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { bool, func, shape, string } from 'prop-types';
|
|
3
|
+
import { FormattedMessage, useIntl } from 'react-intl';
|
|
4
|
+
|
|
5
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
6
|
+
import Dialog from '@magento/venia-ui/lib/components/Dialog';
|
|
7
|
+
import defaultClasses from './wishlistConfirmRemoveProductDialog.module.css';
|
|
8
|
+
|
|
9
|
+
const WishlistConfirmRemoveProductDialog = props => {
|
|
10
|
+
const {
|
|
11
|
+
hasError,
|
|
12
|
+
isOpen,
|
|
13
|
+
isRemovalInProgress,
|
|
14
|
+
onCancel,
|
|
15
|
+
onConfirm
|
|
16
|
+
} = props;
|
|
17
|
+
|
|
18
|
+
const { formatMessage } = useIntl();
|
|
19
|
+
|
|
20
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
21
|
+
|
|
22
|
+
const dialogTitle = formatMessage({
|
|
23
|
+
id: 'wishlistConfirmRemoveProductDialog.title',
|
|
24
|
+
defaultMessage: 'Remove Product from Wishlist'
|
|
25
|
+
});
|
|
26
|
+
const dialogClasses = {
|
|
27
|
+
confirmButton: classes.confirmButton
|
|
28
|
+
};
|
|
29
|
+
const maybeError = hasError ? (
|
|
30
|
+
<p className={classes.errorMessage}>
|
|
31
|
+
<FormattedMessage
|
|
32
|
+
id={'wishlistConfirmRemoveProductDialog.errorMessage'}
|
|
33
|
+
defaultMessage={
|
|
34
|
+
'There was an error deleting this product. Please try again later.'
|
|
35
|
+
}
|
|
36
|
+
/>
|
|
37
|
+
</p>
|
|
38
|
+
) : null;
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<Dialog
|
|
42
|
+
classes={dialogClasses}
|
|
43
|
+
confirmTranslationId={
|
|
44
|
+
'wishlistConfirmRemoveProductDialog.confirmButton'
|
|
45
|
+
}
|
|
46
|
+
isModal={true}
|
|
47
|
+
isOpen={isOpen}
|
|
48
|
+
onCancel={onCancel}
|
|
49
|
+
onConfirm={onConfirm}
|
|
50
|
+
shouldDisableAllButtons={isRemovalInProgress}
|
|
51
|
+
title={dialogTitle}
|
|
52
|
+
>
|
|
53
|
+
<div className={classes.root}>
|
|
54
|
+
{maybeError}
|
|
55
|
+
<span className={classes.prompt}>
|
|
56
|
+
<FormattedMessage
|
|
57
|
+
id={
|
|
58
|
+
'wishlistConfirmRemoveProductDialog.confirmationPrompt'
|
|
59
|
+
}
|
|
60
|
+
defaultMessage={
|
|
61
|
+
'Are you sure you want to delete this product from the list?'
|
|
62
|
+
}
|
|
63
|
+
/>
|
|
64
|
+
</span>
|
|
65
|
+
</div>
|
|
66
|
+
</Dialog>
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export default WishlistConfirmRemoveProductDialog;
|
|
71
|
+
|
|
72
|
+
WishlistConfirmRemoveProductDialog.propTypes = {
|
|
73
|
+
classes: shape({
|
|
74
|
+
confirmButton: string,
|
|
75
|
+
errorMessage: string,
|
|
76
|
+
prompt: string,
|
|
77
|
+
root: string
|
|
78
|
+
}),
|
|
79
|
+
hasError: bool,
|
|
80
|
+
isOpen: bool,
|
|
81
|
+
isRemovalInProgress: bool,
|
|
82
|
+
onCancel: func,
|
|
83
|
+
onConfirm: func
|
|
84
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
composes: p-xs from global;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.confirmButton {
|
|
6
|
+
composes: confirmButton from '@magento/venia-ui/lib/components/Dialog/dialog.module.css';
|
|
7
|
+
composes: root_highPriorityNegative from '@magento/venia-ui/lib/components/Button/button.module.css';
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.errorMessage {
|
|
11
|
+
composes: font-semibold from global;
|
|
12
|
+
composes: leading-normal from global;
|
|
13
|
+
composes: pb-xs from global;
|
|
14
|
+
composes: text-error from global;
|
|
15
|
+
composes: text-sm from global;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.prompt {
|
|
19
|
+
composes: font-semibold from global;
|
|
20
|
+
}
|
package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistEditFavoritesListDialog.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { array, bool, func, object, shape, string } from 'prop-types';
|
|
3
|
+
import { useIntl } from 'react-intl';
|
|
4
|
+
|
|
5
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
6
|
+
import Dialog from '@magento/venia-ui/lib/components/Dialog';
|
|
7
|
+
import defaultClasses from './wishlistEditFavoritesListDialog.module.css';
|
|
8
|
+
import TextInput from '@magento/venia-ui/lib/components/TextInput';
|
|
9
|
+
import { isRequired } from '@magento/venia-ui/lib/util/formValidators';
|
|
10
|
+
import Field from '@magento/venia-ui/lib/components/Field';
|
|
11
|
+
import FormError from '@magento/venia-ui/lib/components/FormError';
|
|
12
|
+
|
|
13
|
+
const WishlistEditFavoritesListDialog = props => {
|
|
14
|
+
const {
|
|
15
|
+
formErrors,
|
|
16
|
+
formProps,
|
|
17
|
+
isOpen,
|
|
18
|
+
isEditInProgress,
|
|
19
|
+
onCancel,
|
|
20
|
+
onConfirm
|
|
21
|
+
} = props;
|
|
22
|
+
|
|
23
|
+
const { formatMessage } = useIntl();
|
|
24
|
+
|
|
25
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
26
|
+
|
|
27
|
+
const dialogTitle = formatMessage({
|
|
28
|
+
id: 'wishlistEditFavoritesListDialog.title',
|
|
29
|
+
defaultMessage: 'Edit Favorites List'
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const dialogClasses = {
|
|
33
|
+
cancelButton: classes.cancelButton,
|
|
34
|
+
confirmButton: classes.confirmButton
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const listName = formatMessage({
|
|
38
|
+
id: 'createWishlist.listName',
|
|
39
|
+
defaultMessage: 'List Name'
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<Dialog
|
|
44
|
+
classes={dialogClasses}
|
|
45
|
+
confirmTranslationId={'global.save'}
|
|
46
|
+
confirmText={'Save'}
|
|
47
|
+
cancelTranslationId={'global.cancelButton'}
|
|
48
|
+
cancelText={'Cancel'}
|
|
49
|
+
formProps={formProps}
|
|
50
|
+
isModal={true}
|
|
51
|
+
isOpen={isOpen}
|
|
52
|
+
onCancel={onCancel}
|
|
53
|
+
onConfirm={onConfirm}
|
|
54
|
+
shouldDisableAllButtons={isEditInProgress}
|
|
55
|
+
title={dialogTitle}
|
|
56
|
+
>
|
|
57
|
+
<div className={classes.root}>
|
|
58
|
+
<FormError
|
|
59
|
+
classes={{ root: classes.errorMessage }}
|
|
60
|
+
errors={formErrors}
|
|
61
|
+
/>
|
|
62
|
+
<div className={classes.form}>
|
|
63
|
+
<Field
|
|
64
|
+
classes={{ root: classes.listName }}
|
|
65
|
+
label={listName}
|
|
66
|
+
>
|
|
67
|
+
<TextInput
|
|
68
|
+
field="name"
|
|
69
|
+
validate={isRequired}
|
|
70
|
+
validateOnBlur
|
|
71
|
+
/>
|
|
72
|
+
</Field>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
</Dialog>
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export default WishlistEditFavoritesListDialog;
|
|
80
|
+
|
|
81
|
+
WishlistEditFavoritesListDialog.propTypes = {
|
|
82
|
+
classes: shape({
|
|
83
|
+
cancelButton: string,
|
|
84
|
+
confirmButton: string,
|
|
85
|
+
errorMessage: string,
|
|
86
|
+
form: string,
|
|
87
|
+
|
|
88
|
+
root: string
|
|
89
|
+
}),
|
|
90
|
+
formErrors: array,
|
|
91
|
+
formProps: object,
|
|
92
|
+
isOpen: bool,
|
|
93
|
+
isEditInProgress: bool,
|
|
94
|
+
onCancel: func,
|
|
95
|
+
onConfirm: func
|
|
96
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
composes: p-xs from global;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.cancelButton {
|
|
6
|
+
composes: root_lowPriority from '@magento/venia-ui/lib/components/Button/button.module.css';
|
|
7
|
+
|
|
8
|
+
composes: min-w-[9rem] from global;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.confirmButton {
|
|
12
|
+
composes: confirmButton from '@magento/venia-ui/lib/components/Dialog/dialog.module.css';
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.errorMessage {
|
|
16
|
+
composes: errorMessage from './wishlistConfirmRemoveProductDialog.module.css';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.form {
|
|
20
|
+
composes: gap-sm from global;
|
|
21
|
+
composes: grid from global;
|
|
22
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import React, { useEffect, useMemo } from 'react';
|
|
2
|
+
import { Trash2 } from 'react-feather';
|
|
3
|
+
import { useIntl } from 'react-intl';
|
|
4
|
+
import { useToasts } from '@magento/peregrine';
|
|
5
|
+
import { useWishlistItem } from '@magento/peregrine/lib/talons/WishlistPage/useWishlistItem';
|
|
6
|
+
|
|
7
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
8
|
+
import Icon from '@magento/venia-ui/lib/components/Icon';
|
|
9
|
+
import Image from '@magento/venia-ui/lib/components/Image';
|
|
10
|
+
import Price from '@magento/venia-ui/lib/components/Price';
|
|
11
|
+
|
|
12
|
+
import defaultClasses from './wishlistItem.module.css';
|
|
13
|
+
|
|
14
|
+
const WishlistItem = props => {
|
|
15
|
+
const { item } = props;
|
|
16
|
+
|
|
17
|
+
const { configurable_options: configurableOptions = [], product } = item;
|
|
18
|
+
const {
|
|
19
|
+
name,
|
|
20
|
+
price_range: priceRange,
|
|
21
|
+
stock_status: stockStatus
|
|
22
|
+
} = product;
|
|
23
|
+
|
|
24
|
+
const { maximum_price: maximumPrice } = priceRange;
|
|
25
|
+
const { final_price: finalPrice } = maximumPrice;
|
|
26
|
+
const { currency, value: unitPrice } = finalPrice;
|
|
27
|
+
|
|
28
|
+
const talonProps = useWishlistItem(props);
|
|
29
|
+
const {
|
|
30
|
+
addToCartButtonProps,
|
|
31
|
+
handleRemoveProductFromWishlist,
|
|
32
|
+
hasError,
|
|
33
|
+
isRemovalInProgress,
|
|
34
|
+
isSupportedProductType
|
|
35
|
+
} = talonProps;
|
|
36
|
+
|
|
37
|
+
const { formatMessage } = useIntl();
|
|
38
|
+
const [, { addToast }] = useToasts();
|
|
39
|
+
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (hasError) {
|
|
42
|
+
addToast({
|
|
43
|
+
type: 'error',
|
|
44
|
+
message: formatMessage({
|
|
45
|
+
id: 'wishlistItem.addToCartError',
|
|
46
|
+
defaultMessage:
|
|
47
|
+
'Something went wrong. Please refresh and try again.'
|
|
48
|
+
}),
|
|
49
|
+
timeout: 5000
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}, [addToast, formatMessage, hasError]);
|
|
53
|
+
|
|
54
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
55
|
+
|
|
56
|
+
const optionElements = useMemo(() => {
|
|
57
|
+
return configurableOptions.map(option => {
|
|
58
|
+
const {
|
|
59
|
+
id,
|
|
60
|
+
option_label: optionLabel,
|
|
61
|
+
value_label: valueLabel
|
|
62
|
+
} = option;
|
|
63
|
+
|
|
64
|
+
const optionString = `${optionLabel} : ${valueLabel}`;
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<span className={classes.option} key={id}>
|
|
68
|
+
{optionString}
|
|
69
|
+
</span>
|
|
70
|
+
);
|
|
71
|
+
});
|
|
72
|
+
}, [classes.option, configurableOptions]);
|
|
73
|
+
|
|
74
|
+
const imageProps = {
|
|
75
|
+
classes: {
|
|
76
|
+
image:
|
|
77
|
+
stockStatus === 'OUT_OF_STOCK'
|
|
78
|
+
? classes.image_disabled
|
|
79
|
+
: classes.image
|
|
80
|
+
},
|
|
81
|
+
...talonProps.imageProps
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const removeProductAriaLabel = formatMessage({
|
|
85
|
+
id: 'wishlistItem.removeAriaLabel',
|
|
86
|
+
defaultMessage: 'Remove Product from wishlist'
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
const rootClass = isRemovalInProgress
|
|
90
|
+
? classes.root_disabled
|
|
91
|
+
: classes.root;
|
|
92
|
+
|
|
93
|
+
const addToCart = isSupportedProductType ? (
|
|
94
|
+
<button
|
|
95
|
+
className={classes.addToCart}
|
|
96
|
+
{...addToCartButtonProps}
|
|
97
|
+
data-cy="wishlistItem-addToCart"
|
|
98
|
+
>
|
|
99
|
+
{formatMessage({
|
|
100
|
+
id: 'wishlistItem.addToCart',
|
|
101
|
+
defaultMessage: 'Add to Cart'
|
|
102
|
+
})}
|
|
103
|
+
</button>
|
|
104
|
+
) : null;
|
|
105
|
+
|
|
106
|
+
return (
|
|
107
|
+
<div className={rootClass} data-cy="wishlistItem-root">
|
|
108
|
+
<Image {...imageProps} />
|
|
109
|
+
|
|
110
|
+
<div className={classes.actionWrap}>
|
|
111
|
+
<span
|
|
112
|
+
className={classes.name}
|
|
113
|
+
data-cy="wishlistItem-productName"
|
|
114
|
+
>
|
|
115
|
+
{name}
|
|
116
|
+
</span>{' '}
|
|
117
|
+
<button
|
|
118
|
+
className={classes.deleteItem}
|
|
119
|
+
onClick={handleRemoveProductFromWishlist}
|
|
120
|
+
aria-label={removeProductAriaLabel}
|
|
121
|
+
data-cy="wishlistItem-deleteItem"
|
|
122
|
+
>
|
|
123
|
+
<Icon size={16} src={Trash2} />
|
|
124
|
+
</button>
|
|
125
|
+
</div>
|
|
126
|
+
<div
|
|
127
|
+
className={classes.priceContainer}
|
|
128
|
+
data-cy="wishlistItem-priceContainer"
|
|
129
|
+
>
|
|
130
|
+
<Price currencyCode={currency} value={unitPrice} />
|
|
131
|
+
</div>
|
|
132
|
+
{optionElements}
|
|
133
|
+
{addToCart}
|
|
134
|
+
</div>
|
|
135
|
+
);
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
export default WishlistItem;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
composes: content-start from global;
|
|
3
|
+
composes: grid from global;
|
|
4
|
+
composes: gap-y-2xs from global;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.root_disabled {
|
|
8
|
+
composes: root;
|
|
9
|
+
|
|
10
|
+
composes: opacity-50 from global;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.name {
|
|
14
|
+
composes: font-semibold from global;
|
|
15
|
+
composes: text-colorDefault from global;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.detail {
|
|
19
|
+
composes: text-sm from global;
|
|
20
|
+
composes: text-subtle from global;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.option {
|
|
24
|
+
composes: detail;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.outOfStock {
|
|
28
|
+
composes: text-sm from global;
|
|
29
|
+
composes: text-error from global;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.priceContainer {
|
|
33
|
+
composes: text-colorDefault from global;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.image {
|
|
37
|
+
composes: h-full from global;
|
|
38
|
+
composes: object-contain from global;
|
|
39
|
+
composes: w-full from global;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.image_disabled {
|
|
43
|
+
composes: image;
|
|
44
|
+
composes: opacity-50 from global;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.addToCart {
|
|
48
|
+
composes: root_highPriority from '@magento/venia-ui/lib/components/Button/button.module.css';
|
|
49
|
+
|
|
50
|
+
composes: justify-self-start from global;
|
|
51
|
+
composes: min-w-full from global;
|
|
52
|
+
composes: mt-1 from global;
|
|
53
|
+
|
|
54
|
+
composes: xs_min-w-auto from global;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.deleteItem {
|
|
58
|
+
composes: mt-0 from global;
|
|
59
|
+
composes: mr-2 from global;
|
|
60
|
+
composes: mb-0 from global;
|
|
61
|
+
composes: ml-xs from global;
|
|
62
|
+
composes: justify-self-end from global;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.actionWrap {
|
|
66
|
+
composes: flex from global;
|
|
67
|
+
composes: items-start from global;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.moreActions {
|
|
71
|
+
composes: bg-gray-100 from global;
|
|
72
|
+
composes: hidden from global;
|
|
73
|
+
/* Hide actions menu until PWA-1683 */
|
|
74
|
+
/* composes: inline-flex from global; */
|
|
75
|
+
composes: items-center from global;
|
|
76
|
+
composes: p-0.5 from global;
|
|
77
|
+
composes: rounded-full from global;
|
|
78
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React, { Fragment, useMemo } from 'react';
|
|
2
|
+
import { useWishlistItems } from '@magento/peregrine/lib/talons/WishlistPage/useWishlistItems';
|
|
3
|
+
|
|
4
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
5
|
+
import defaultClasses from './wishlistItems.module.css';
|
|
6
|
+
import WishlistItem from './wishlistItem';
|
|
7
|
+
import AddToCartDialog from '@magento/venia-ui/lib/components/AddToCartDialog';
|
|
8
|
+
|
|
9
|
+
const WishlistItems = props => {
|
|
10
|
+
const { items, wishlistId } = props;
|
|
11
|
+
|
|
12
|
+
const talonProps = useWishlistItems();
|
|
13
|
+
const {
|
|
14
|
+
activeAddToCartItem,
|
|
15
|
+
handleCloseAddToCartDialog,
|
|
16
|
+
handleOpenAddToCartDialog
|
|
17
|
+
} = talonProps;
|
|
18
|
+
|
|
19
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
20
|
+
|
|
21
|
+
const itemElements = useMemo(() => {
|
|
22
|
+
return items.map(item => {
|
|
23
|
+
return (
|
|
24
|
+
<WishlistItem
|
|
25
|
+
key={item.id}
|
|
26
|
+
item={item}
|
|
27
|
+
onOpenAddToCartDialog={handleOpenAddToCartDialog}
|
|
28
|
+
wishlistId={wishlistId}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
});
|
|
32
|
+
}, [handleOpenAddToCartDialog, items, wishlistId]);
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<Fragment>
|
|
36
|
+
<div className={classes.root}>{itemElements}</div>
|
|
37
|
+
<AddToCartDialog
|
|
38
|
+
item={activeAddToCartItem}
|
|
39
|
+
onClose={handleCloseAddToCartDialog}
|
|
40
|
+
/>
|
|
41
|
+
</Fragment>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export default WishlistItems;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { bool, func, shape, string } from 'prop-types';
|
|
3
|
+
import { ChevronRight, Edit2 } from 'react-feather';
|
|
4
|
+
import { FormattedMessage, useIntl } from 'react-intl';
|
|
5
|
+
|
|
6
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
7
|
+
import Dialog from '@magento/venia-ui/lib/components/Dialog';
|
|
8
|
+
import Icon from '@magento/venia-ui/lib/components/Icon';
|
|
9
|
+
import defaultClasses from './wishlistMoreActionsDialog.module.css';
|
|
10
|
+
|
|
11
|
+
const WishlistListActionsDialog = props => {
|
|
12
|
+
const { isOpen, onCancel, onEdit } = props;
|
|
13
|
+
|
|
14
|
+
const { formatMessage } = useIntl();
|
|
15
|
+
|
|
16
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
17
|
+
|
|
18
|
+
const dialogTitle = formatMessage({
|
|
19
|
+
id: 'wishlistListActionsDialog.title_initial',
|
|
20
|
+
defaultMessage: 'List Actions'
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<Dialog
|
|
25
|
+
isOpen={isOpen}
|
|
26
|
+
onCancel={onCancel}
|
|
27
|
+
shouldShowButtons={false}
|
|
28
|
+
shouldUnmountOnHide={false}
|
|
29
|
+
title={dialogTitle}
|
|
30
|
+
>
|
|
31
|
+
<div className={classes.root}>
|
|
32
|
+
<button className={classes.rowButton} onClick={onEdit}>
|
|
33
|
+
<span className={classes.row}>
|
|
34
|
+
<Icon size={16} src={Edit2} />
|
|
35
|
+
<span className={classes.text}>
|
|
36
|
+
<FormattedMessage
|
|
37
|
+
id={'wishlistListActionsDialog.edit'}
|
|
38
|
+
defaultMessage={'Edit List'}
|
|
39
|
+
/>
|
|
40
|
+
</span>
|
|
41
|
+
<Icon size={16} src={ChevronRight} />
|
|
42
|
+
</span>
|
|
43
|
+
</button>
|
|
44
|
+
</div>
|
|
45
|
+
</Dialog>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export default WishlistListActionsDialog;
|
|
50
|
+
|
|
51
|
+
WishlistListActionsDialog.propTypes = {
|
|
52
|
+
classes: shape({
|
|
53
|
+
root: string,
|
|
54
|
+
rowButton: string,
|
|
55
|
+
row: string,
|
|
56
|
+
text: string
|
|
57
|
+
}),
|
|
58
|
+
isOpen: bool,
|
|
59
|
+
onCancel: func,
|
|
60
|
+
onEdit: func
|
|
61
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { bool, func, shape, string } from 'prop-types';
|
|
3
|
+
import { ChevronRight, Copy, Move, Trash2 } from 'react-feather';
|
|
4
|
+
import { FormattedMessage, useIntl } from 'react-intl';
|
|
5
|
+
|
|
6
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
7
|
+
import Dialog from '@magento/venia-ui/lib/components/Dialog';
|
|
8
|
+
import Icon from '@magento/venia-ui/lib/components/Icon';
|
|
9
|
+
import defaultClasses from './wishlistMoreActionsDialog.module.css';
|
|
10
|
+
|
|
11
|
+
const WishlistMoreActionsDialog = props => {
|
|
12
|
+
const { isOpen, onCancel, onRemove } = props;
|
|
13
|
+
|
|
14
|
+
const { formatMessage } = useIntl();
|
|
15
|
+
|
|
16
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
17
|
+
|
|
18
|
+
const dialogTitle = formatMessage({
|
|
19
|
+
id: 'wishlistMoreActionsDialog.title_initial',
|
|
20
|
+
defaultMessage: 'Actions'
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<Dialog
|
|
25
|
+
isOpen={isOpen}
|
|
26
|
+
onCancel={onCancel}
|
|
27
|
+
shouldShowButtons={false}
|
|
28
|
+
shouldUnmountOnHide={false}
|
|
29
|
+
title={dialogTitle}
|
|
30
|
+
>
|
|
31
|
+
<div className={classes.root}>
|
|
32
|
+
<button className={classes.rowButton}>
|
|
33
|
+
<span className={classes.row}>
|
|
34
|
+
<Icon size={16} src={Move} />
|
|
35
|
+
<span className={classes.text}>
|
|
36
|
+
<FormattedMessage
|
|
37
|
+
id={'wishlistMoreActionsDialog.move'}
|
|
38
|
+
defaultMessage={'Move to'}
|
|
39
|
+
/>
|
|
40
|
+
</span>
|
|
41
|
+
<Icon size={16} src={ChevronRight} />
|
|
42
|
+
</span>
|
|
43
|
+
</button>
|
|
44
|
+
<button className={classes.rowButton}>
|
|
45
|
+
<span className={classes.row}>
|
|
46
|
+
<Icon size={16} src={Copy} />
|
|
47
|
+
<span className={classes.text}>
|
|
48
|
+
<FormattedMessage
|
|
49
|
+
id={'wishlistMoreActionsDialog.copy'}
|
|
50
|
+
defaultMessage={'Copy to'}
|
|
51
|
+
/>
|
|
52
|
+
</span>
|
|
53
|
+
<Icon size={16} src={ChevronRight} />
|
|
54
|
+
</span>
|
|
55
|
+
</button>
|
|
56
|
+
<button className={classes.rowButton} onClick={onRemove}>
|
|
57
|
+
<span className={classes.row}>
|
|
58
|
+
<Icon size={16} src={Trash2} />
|
|
59
|
+
<span className={classes.text}>
|
|
60
|
+
<FormattedMessage
|
|
61
|
+
id={'wishlistMoreActionsDialog.delete'}
|
|
62
|
+
defaultMessage={'Remove'}
|
|
63
|
+
/>
|
|
64
|
+
</span>
|
|
65
|
+
</span>
|
|
66
|
+
</button>
|
|
67
|
+
</div>
|
|
68
|
+
</Dialog>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export default WishlistMoreActionsDialog;
|
|
73
|
+
|
|
74
|
+
WishlistMoreActionsDialog.propTypes = {
|
|
75
|
+
classes: shape({
|
|
76
|
+
root: string,
|
|
77
|
+
rowButton: string,
|
|
78
|
+
row: string,
|
|
79
|
+
text: string
|
|
80
|
+
}),
|
|
81
|
+
isOpen: bool,
|
|
82
|
+
onCancel: func,
|
|
83
|
+
onRemove: func
|
|
84
|
+
};
|
package/src/overwrites/venia-ui/lib/components/WishlistPage/wishlistMoreActionsDialog.module.css
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
composes: grid from global;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.row {
|
|
6
|
+
composes: gap-md from global;
|
|
7
|
+
composes: grid from global;
|
|
8
|
+
composes: items-center from global;
|
|
9
|
+
composes: p-xs from global;
|
|
10
|
+
composes: text-left from global;
|
|
11
|
+
grid-template-columns: auto 1fr auto;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.rowButton {
|
|
15
|
+
composes: even_border-bottom-2 from global;
|
|
16
|
+
composes: even_border-light from global;
|
|
17
|
+
composes: even_border-solid from global;
|
|
18
|
+
composes: even_border-top-2 from global;
|
|
19
|
+
}
|