@magento/venia-ui 9.2.0-beta.1 → 9.3.0-beta.1

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.
Files changed (167) hide show
  1. package/i18n/en_US.json +17 -3
  2. package/lib/RootComponents/CMS/__tests__/__snapshots__/cms.spec.js.snap +19 -0
  3. package/lib/RootComponents/CMS/__tests__/cms.spec.js +4 -9
  4. package/lib/RootComponents/CMS/cms.js +5 -4
  5. package/lib/RootComponents/CMS/cms.shimmer.js +18 -0
  6. package/lib/RootComponents/Category/__tests__/__snapshots__/categoryContent.shimmer.spec.js.snap +12 -0
  7. package/lib/RootComponents/Category/categoryContent.js +4 -1
  8. package/lib/components/AccountChip/accountChip.js +3 -1
  9. package/lib/components/AccountInformationPage/accountInformationPage.js +3 -1
  10. package/lib/components/AccountInformationPage/editModal.js +9 -2
  11. package/lib/components/AccountMenu/accountMenuItems.js +8 -3
  12. package/lib/components/CartPage/GiftCards/giftCards.js +1 -1
  13. package/lib/components/CartPage/PriceAdjustments/CouponCode/couponCode.js +5 -1
  14. package/lib/components/CartPage/PriceAdjustments/GiftOptions/__tests__/__snapshots__/giftOptions.spec.js.snap +1018 -78
  15. package/lib/components/CartPage/PriceAdjustments/GiftOptions/__tests__/giftOptions.spec.js +221 -35
  16. package/lib/components/CartPage/PriceAdjustments/GiftOptions/giftOptions.js +287 -40
  17. package/lib/components/CartPage/PriceAdjustments/GiftOptions/giftOptions.module.css +56 -1
  18. package/lib/components/CartPage/PriceAdjustments/__tests__/__snapshots__/giftCardSection.ee.spec.js.snap +12 -0
  19. package/lib/components/CartPage/PriceAdjustments/__tests__/__snapshots__/giftOptionsSection.ce.spec.js.snap +3 -0
  20. package/lib/components/CartPage/PriceAdjustments/__tests__/__snapshots__/giftOptionsSection.ee.spec.js.snap +16 -0
  21. package/lib/components/CartPage/PriceAdjustments/__tests__/__snapshots__/priceAdjustments.spec.js.snap +1 -32
  22. package/lib/components/CartPage/PriceAdjustments/__tests__/giftCardSection.ce.spec.js +17 -0
  23. package/lib/components/CartPage/PriceAdjustments/__tests__/giftCardSection.ee.spec.js +36 -0
  24. package/lib/components/CartPage/PriceAdjustments/__tests__/giftOptionsSection.ce.spec.js +17 -0
  25. package/lib/components/CartPage/PriceAdjustments/__tests__/giftOptionsSection.ee.spec.js +54 -0
  26. package/lib/components/CartPage/PriceAdjustments/__tests__/priceAdjustments.spec.js +1 -1
  27. package/lib/components/CartPage/PriceAdjustments/{giftCardSection.js → giftCardSection.ce.js} +0 -0
  28. package/lib/components/CartPage/PriceAdjustments/giftOptionsSection.ce.js +7 -0
  29. package/lib/components/CartPage/PriceAdjustments/giftOptionsSection.ee.js +38 -0
  30. package/lib/components/CartPage/PriceAdjustments/priceAdjustments.js +2 -14
  31. package/lib/components/CartPage/PriceSummary/__tests__/__snapshots__/discountSummary.spec.js.snap +496 -42
  32. package/lib/components/CartPage/PriceSummary/__tests__/__snapshots__/giftCardSummary.ce.spec.js.snap +3 -0
  33. package/lib/components/CartPage/PriceSummary/__tests__/__snapshots__/{giftCardSummary.spec.js.snap → giftCardSummary.ee.spec.js.snap} +4 -4
  34. package/lib/components/CartPage/PriceSummary/__tests__/__snapshots__/giftOptionsSummary.ce.spec.js.snap +3 -0
  35. package/lib/components/CartPage/PriceSummary/__tests__/__snapshots__/giftOptionsSummary.ee.spec.js.snap +63 -0
  36. package/lib/components/CartPage/PriceSummary/__tests__/__snapshots__/priceSummary.spec.js.snap +201 -141
  37. package/lib/components/CartPage/PriceSummary/__tests__/discountSummary.spec.js +41 -1
  38. package/lib/components/CartPage/PriceSummary/__tests__/giftCardSummary.ce.spec.js +17 -0
  39. package/lib/components/CartPage/PriceSummary/__tests__/giftCardSummary.ee.spec.js +84 -0
  40. package/lib/components/CartPage/PriceSummary/__tests__/giftOptionsSummary.ce.spec.js +17 -0
  41. package/lib/components/CartPage/PriceSummary/__tests__/giftOptionsSummary.ee.spec.js +69 -0
  42. package/lib/components/CartPage/PriceSummary/__tests__/priceSummary.spec.js +2 -0
  43. package/lib/components/CartPage/PriceSummary/discountSummary.js +99 -49
  44. package/lib/components/CartPage/PriceSummary/discountSummary.module.css +40 -0
  45. package/lib/components/CartPage/PriceSummary/giftOptionsSummary.ce.js +5 -0
  46. package/lib/components/CartPage/PriceSummary/giftOptionsSummary.ee.js +40 -0
  47. package/lib/components/CartPage/PriceSummary/priceSummary.js +95 -53
  48. package/lib/components/CartPage/PriceSummary/priceSummary.module.css +2 -0
  49. package/lib/components/CartPage/ProductListing/EditModal/__tests__/__snapshots__/productDetail.spec.js.snap +57 -0
  50. package/lib/components/CartPage/ProductListing/EditModal/__tests__/__snapshots__/productForm.spec.js.snap +22 -0
  51. package/lib/components/CartPage/ProductListing/EditModal/__tests__/productDetail.spec.js +42 -3
  52. package/lib/components/CartPage/ProductListing/EditModal/productDetail.js +13 -10
  53. package/lib/components/CartPage/ProductListing/EditModal/productForm.js +7 -2
  54. package/lib/components/CartPage/ProductListing/product.js +1 -0
  55. package/lib/components/CartPage/ProductListing/productListing.js +1 -1
  56. package/lib/components/CartPage/cartPage.js +1 -1
  57. package/lib/components/Checkbox/checkbox.js +6 -1
  58. package/lib/components/Checkbox/checkbox.module.css +1 -0
  59. package/lib/components/CheckoutPage/ItemsReview/__tests__/__snapshots__/item.spec.js.snap +2 -2
  60. package/lib/components/CheckoutPage/ItemsReview/__tests__/__snapshots__/itemsReview.spec.js.snap +33 -0
  61. package/lib/components/CheckoutPage/ItemsReview/__tests__/item.spec.js +2 -2
  62. package/lib/components/CheckoutPage/ItemsReview/itemsReview.js +4 -1
  63. package/lib/components/CheckoutPage/OrderConfirmationPage/__tests__/createAccount.spec.js +4 -0
  64. package/lib/components/CheckoutPage/OrderConfirmationPage/createAccount.js +9 -1
  65. package/lib/components/CheckoutPage/OrderConfirmationPage/orderConfirmationPage.js +12 -3
  66. package/lib/components/CheckoutPage/PaymentInformation/__tests__/__snapshots__/creditCard.spec.js.snap +1 -0
  67. package/lib/components/CheckoutPage/PaymentInformation/__tests__/creditCard.spec.js +2 -1
  68. package/lib/components/CheckoutPage/PaymentInformation/brainTreeDropIn.js +2 -18
  69. package/lib/components/CheckoutPage/PaymentInformation/creditCard.js +13 -3
  70. package/lib/components/CheckoutPage/PriceAdjustments/__tests__/__snapshots__/priceAdjustments.spec.js.snap +1 -6
  71. package/lib/components/CheckoutPage/PriceAdjustments/__tests__/priceAdjustments.spec.js +2 -2
  72. package/lib/components/CheckoutPage/PriceAdjustments/priceAdjustments.js +8 -12
  73. package/lib/components/CheckoutPage/ShippingInformation/AddressForm/customerForm.js +1 -1
  74. package/lib/components/CheckoutPage/ShippingInformation/shippingInformation.js +4 -1
  75. package/lib/components/CheckoutPage/ShippingMethod/shippingMethod.js +5 -2
  76. package/lib/components/CheckoutPage/__tests__/__snapshots__/checkoutPage.spec.js.snap +3 -3
  77. package/lib/components/CheckoutPage/__tests__/checkoutPage.spec.js +5 -0
  78. package/lib/components/CheckoutPage/checkoutPage.js +25 -4
  79. package/lib/components/CheckoutPage/checkoutPage.module.css +8 -1
  80. package/lib/components/CmsDynamicBlock/__tests__/__snapshots__/cmsDynamicBlock.ce.spec.js.snap +3 -0
  81. package/lib/components/CmsDynamicBlock/__tests__/__snapshots__/cmsDynamicBlock.ee.spec.js.snap +61 -0
  82. package/lib/components/CmsDynamicBlock/__tests__/__snapshots__/dynamicBlock.spec.js.snap +7 -0
  83. package/lib/components/CmsDynamicBlock/__tests__/cmsDynamicBlock.ce.spec.js +17 -0
  84. package/lib/components/CmsDynamicBlock/__tests__/cmsDynamicBlock.ee.spec.js +211 -0
  85. package/lib/components/CmsDynamicBlock/__tests__/constants.spec.js +37 -0
  86. package/lib/components/CmsDynamicBlock/__tests__/dynamicBlock.spec.js +33 -0
  87. package/lib/components/CmsDynamicBlock/cmsDynamicBlock.ce.js +5 -0
  88. package/lib/components/CmsDynamicBlock/cmsDynamicBlock.ee.js +73 -0
  89. package/lib/components/CmsDynamicBlock/constants.js +6 -0
  90. package/lib/components/CmsDynamicBlock/dynamicBlock.js +32 -0
  91. package/lib/components/CmsDynamicBlock/index.js +2 -0
  92. package/lib/components/CreateAccount/__tests__/createAccount.spec.js +6 -1
  93. package/lib/components/CreateAccount/createAccount.js +7 -2
  94. package/lib/components/Field/field.module.css +6 -0
  95. package/lib/components/FilterSidebar/filterSidebar.js +4 -1
  96. package/lib/components/Footer/__tests__/__snapshots__/footer.spec.js.snap +8 -2
  97. package/lib/components/Footer/footer.js +16 -9
  98. package/lib/components/Footer/footer.module.css +7 -2
  99. package/lib/components/ForgotPassword/ForgotPasswordForm/__tests__/__snapshots__/forgotPasswordForm.spec.js.snap +109 -1
  100. package/lib/components/ForgotPassword/ForgotPasswordForm/__tests__/forgotPasswordForm.spec.js +22 -3
  101. package/lib/components/ForgotPassword/ForgotPasswordForm/forgotPasswordForm.js +13 -3
  102. package/lib/components/ForgotPassword/ForgotPasswordForm/forgotPasswordForm.module.css +1 -1
  103. package/lib/components/ForgotPassword/__tests__/__snapshots__/forgotPassword.spec.js.snap +5 -6
  104. package/lib/components/ForgotPassword/__tests__/forgotPassword.spec.js +41 -28
  105. package/lib/components/ForgotPassword/forgotPassword.js +10 -3
  106. package/lib/components/ForgotPassword/forgotPassword.module.css +2 -2
  107. package/lib/components/Gallery/__tests__/__snapshots__/gallery.spec.js.snap +22 -0
  108. package/lib/components/Gallery/__tests__/__snapshots__/item.spec.js.snap +17 -0
  109. package/lib/components/Gallery/addToCartButton.js +2 -0
  110. package/lib/components/Gallery/gallery.js +6 -1
  111. package/lib/components/Gallery/item.js +7 -2
  112. package/lib/components/GoogleReCaptcha/googleReCaptcha.js +49 -0
  113. package/lib/components/GoogleReCaptcha/googleReCaptcha.module.css +3 -0
  114. package/lib/components/GoogleReCaptcha/index.js +1 -0
  115. package/lib/components/Header/currencySwitcher.js +2 -1
  116. package/lib/components/Header/header.js +1 -1
  117. package/lib/components/Header/header.module.css +2 -2
  118. package/lib/components/Header/searchTrigger.js +3 -1
  119. package/lib/components/Header/storeSwitcher.js +18 -4
  120. package/lib/components/Header/switcherItem.js +4 -1
  121. package/lib/components/HomePage/homePage.module.css +12 -0
  122. package/lib/components/Image/resourceImage.js +8 -1
  123. package/lib/components/Image/simpleImage.js +8 -1
  124. package/lib/components/Link/link.js +15 -13
  125. package/lib/components/LoadingIndicator/spinner.js +5 -7
  126. package/lib/components/LoadingIndicator/spinner.module.css +4 -17
  127. package/lib/components/MiniCart/ProductList/__tests__/__snapshots__/item.spec.js.snap +44 -0
  128. package/lib/components/MiniCart/ProductList/__tests__/item.spec.js +2 -2
  129. package/lib/components/MiniCart/ProductList/item.js +3 -2
  130. package/lib/components/MiniCart/miniCart.js +6 -3
  131. package/lib/components/MyAccount/ResetPassword/__tests__/__snapshots__/resetPassword.spec.js.snap +274 -254
  132. package/lib/components/MyAccount/ResetPassword/__tests__/resetPassword.spec.js +10 -5
  133. package/lib/components/MyAccount/ResetPassword/resetPassword.js +55 -55
  134. package/lib/components/MyAccount/ResetPassword/resetPassword.module.css +27 -79
  135. package/lib/components/Newsletter/newsletter.js +6 -2
  136. package/lib/components/OrderHistoryPage/OrderDetails/__tests__/__snapshots__/item.spec.js.snap +11 -0
  137. package/lib/components/ProductFullDetail/productFullDetail.js +12 -3
  138. package/lib/components/ProductImageCarousel/__tests__/__snapshots__/carousel.spec.js.snap +61 -0
  139. package/lib/components/ProductImageCarousel/__tests__/__snapshots__/thumbnail.spec.js.snap +26 -0
  140. package/lib/components/ProductOptions/__tests__/options.spec.js +1 -1
  141. package/lib/components/ProductOptions/__tests__/swatch.spec.js +1 -1
  142. package/lib/components/ProductOptions/__tests__/swatchList.spec.js +1 -1
  143. package/lib/components/ProductOptions/__tests__/tile.spec.js +1 -1
  144. package/lib/components/ProductOptions/__tests__/tileList.spec.js +1 -1
  145. package/lib/components/ProductOptions/option.js +4 -1
  146. package/lib/components/ProductSort/productSort.js +22 -14
  147. package/lib/components/Rating/rating.js +1 -1
  148. package/lib/components/SearchBar/__tests__/__snapshots__/suggestedProduct.spec.js.snap +11 -0
  149. package/lib/components/SearchBar/autocomplete.js +4 -2
  150. package/lib/components/SearchBar/suggestedProduct.js +1 -1
  151. package/lib/components/SearchBar/suggestions.js +1 -1
  152. package/lib/components/SignIn/__tests__/signIn.spec.js +11 -20
  153. package/lib/components/SignIn/signIn.js +6 -16
  154. package/lib/components/TextInput/textInput.module.css +0 -4
  155. package/lib/components/Wishlist/WishlistDialog/WishlistLineItem/__tests__/__snapshots__/wishlistLineItem.spec.js.snap +5 -1
  156. package/lib/components/Wishlist/WishlistDialog/WishlistLineItem/wishlistLineItem.js +7 -1
  157. package/lib/components/Wishlist/WishlistDialog/WishlistLineItem/wishlistLineItem.module.css +7 -0
  158. package/lib/components/Wishlist/WishlistDialog/__tests__/__snapshots__/wishlistDialog.spec.js.snap +6 -1
  159. package/lib/components/WishlistPage/__tests__/__snapshots__/wishlist.spec.js.snap +4 -0
  160. package/lib/components/WishlistPage/__tests__/__snapshots__/wishlistItem.spec.js.snap +22 -0
  161. package/lib/components/WishlistPage/__tests__/__snapshots__/wishlistPage.spec.js.snap +9 -3
  162. package/lib/components/WishlistPage/createWishlist.ee.js +3 -1
  163. package/lib/components/WishlistPage/wishlist.js +1 -1
  164. package/lib/components/WishlistPage/wishlist.module.css +3 -0
  165. package/lib/components/WishlistPage/wishlistPage.js +1 -1
  166. package/package.json +5 -4
  167. package/lib/components/CartPage/PriceSummary/__tests__/giftCardSummary.spec.js +0 -84
@@ -0,0 +1,12 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`#GiftCardSection EE renders 1`] = `
4
+ <mock-Section
5
+ id="gift_card"
6
+ title="Apply Gift Card"
7
+ >
8
+ <require('../GiftCards')
9
+ setIsCartUpdating={false}
10
+ />
11
+ </mock-Section>
12
+ `;
@@ -0,0 +1,3 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`#GiftOptionsSection CE renders 1`] = `null`;
@@ -0,0 +1,16 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`#GiftOptionsSection EE renders loading 1`] = `null`;
4
+
5
+ exports[`#GiftOptionsSection EE renders not loading and not visible 1`] = `null`;
6
+
7
+ exports[`#GiftOptionsSection EE renders not loading and visible 1`] = `
8
+ <mock-Section
9
+ id="gift_options"
10
+ title="See Gift Options"
11
+ >
12
+ <require('./GiftOptions')
13
+ giftOptionsConfigData={Object {}}
14
+ />
15
+ </mock-Section>
16
+ `;
@@ -68,38 +68,7 @@ exports[`it renders Venia price adjustments 1`] = `
68
68
  </div>
69
69
  </div>
70
70
  <GiftCardSection />
71
- <div>
72
- <button
73
- onClick={[Function]}
74
- type="button"
75
- >
76
- <span>
77
- <span>
78
- See Gift Options
79
- </span>
80
- <span>
81
- <svg
82
- fill="none"
83
- height={24}
84
- stroke="currentColor"
85
- strokeLinecap="round"
86
- strokeLinejoin="round"
87
- strokeWidth="2"
88
- viewBox="0 0 24 24"
89
- width={24}
90
- xmlns="http://www.w3.org/2000/svg"
91
- >
92
- <polyline
93
- points="6 9 12 15 18 9"
94
- />
95
- </svg>
96
- </span>
97
- </span>
98
- </button>
99
- <div>
100
- <require('./GiftOptions') />
101
- </div>
102
- </div>
71
+ <GiftOptionsSection />
103
72
  </div>
104
73
  </div>
105
74
  `;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+
3
+ import { createTestInstance } from '@magento/peregrine';
4
+
5
+ import GiftCardSection from '../giftCardSection.ce';
6
+
7
+ const Component = () => {
8
+ return <GiftCardSection />;
9
+ };
10
+
11
+ describe('#GiftCardSection CE', () => {
12
+ it('renders', () => {
13
+ const tree = createTestInstance(<Component />);
14
+
15
+ expect(tree.toJSON()).toBe(null);
16
+ });
17
+ });
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+
3
+ import { createTestInstance } from '@magento/peregrine';
4
+
5
+ import GiftCardSection from '../giftCardSection.ee';
6
+
7
+ jest.mock('../../../Accordion', () => ({
8
+ Section: ({ children, ...rest }) => (
9
+ <mock-Section {...rest}>{children}</mock-Section>
10
+ )
11
+ }));
12
+ jest.mock('../../GiftCards', () => props => <mock-GiftCards {...props} />);
13
+
14
+ let inputProps = {};
15
+
16
+ const Component = () => {
17
+ return <GiftCardSection {...inputProps} />;
18
+ };
19
+
20
+ const givenDefaultValues = () => {
21
+ inputProps = {
22
+ setIsCartUpdating: false
23
+ };
24
+ };
25
+
26
+ describe('#GiftCardSection EE', () => {
27
+ beforeEach(() => {
28
+ givenDefaultValues();
29
+ });
30
+
31
+ it('renders', () => {
32
+ const tree = createTestInstance(<Component />);
33
+
34
+ expect(tree.toJSON()).toMatchSnapshot();
35
+ });
36
+ });
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+
3
+ import { createTestInstance } from '@magento/peregrine';
4
+
5
+ import GiftOptionsSection from '../giftOptionsSection.ce';
6
+
7
+ const Component = () => {
8
+ return <GiftOptionsSection />;
9
+ };
10
+
11
+ describe('#GiftOptionsSection CE', () => {
12
+ it('renders', () => {
13
+ const tree = createTestInstance(<Component />);
14
+
15
+ expect(tree.toJSON()).toMatchSnapshot();
16
+ });
17
+ });
@@ -0,0 +1,54 @@
1
+ import React from 'react';
2
+
3
+ import { createTestInstance } from '@magento/peregrine';
4
+ import { useGiftOptionsSection } from '@magento/peregrine/lib/talons/CartPage/PriceAdjustments/useGiftOptionsSection';
5
+
6
+ import GiftOptionsSection from '../giftOptionsSection.ee';
7
+
8
+ jest.mock(
9
+ '@magento/peregrine/lib/talons/CartPage/PriceAdjustments/useGiftOptionsSection'
10
+ );
11
+ jest.mock('../../../Accordion', () => ({
12
+ Section: ({ children, ...rest }) => (
13
+ <mock-Section {...rest}>{children}</mock-Section>
14
+ )
15
+ }));
16
+
17
+ const Component = () => {
18
+ return <GiftOptionsSection />;
19
+ };
20
+
21
+ describe('#GiftOptionsSection EE', () => {
22
+ it('renders loading', () => {
23
+ useGiftOptionsSection.mockReturnValueOnce({
24
+ giftOptionsConfigData: {},
25
+ isLoading: true,
26
+ isVisible: false
27
+ });
28
+
29
+ const tree = createTestInstance(<Component />);
30
+ expect(tree.toJSON()).toMatchSnapshot();
31
+ });
32
+
33
+ it('renders not loading and not visible', () => {
34
+ useGiftOptionsSection.mockReturnValueOnce({
35
+ giftOptionsConfigData: {},
36
+ isLoading: false,
37
+ isVisible: false
38
+ });
39
+
40
+ const tree = createTestInstance(<Component />);
41
+ expect(tree.toJSON()).toMatchSnapshot();
42
+ });
43
+
44
+ it('renders not loading and visible', () => {
45
+ useGiftOptionsSection.mockReturnValueOnce({
46
+ giftOptionsConfigData: {},
47
+ isLoading: false,
48
+ isVisible: true
49
+ });
50
+
51
+ const tree = createTestInstance(<Component />);
52
+ expect(tree.toJSON()).toMatchSnapshot();
53
+ });
54
+ });
@@ -6,7 +6,7 @@ import PriceAdjustments from '../priceAdjustments';
6
6
  jest.mock('../ShippingMethods', () => 'ShippingMethods');
7
7
  jest.mock('../CouponCode', () => 'CouponCode');
8
8
  jest.mock('../giftCardSection', () => 'GiftCardSection');
9
- jest.mock('../GiftOptions', () => 'GiftOptions');
9
+ jest.mock('../giftOptionsSection', () => 'GiftOptionsSection');
10
10
 
11
11
  test('it renders Venia price adjustments', () => {
12
12
  // Act.
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Gift Options support is an EE-only feature for now.
3
+ * Here in CE, don't render the Accordion section at all.
4
+ */
5
+ export default () => {
6
+ return null;
7
+ };
@@ -0,0 +1,38 @@
1
+ import React, { Suspense } from 'react';
2
+ import { useIntl } from 'react-intl';
3
+
4
+ import LoadingIndicator from '@magento/venia-ui/lib/components/LoadingIndicator';
5
+ import { Section } from '@magento/venia-ui/lib/components/Accordion';
6
+ import { useGiftOptionsSection } from '@magento/peregrine/lib/talons/CartPage/PriceAdjustments/useGiftOptionsSection';
7
+
8
+ const GiftOptions = React.lazy(() => import('./GiftOptions'));
9
+
10
+ const GiftOptionsSection = () => {
11
+ const { formatMessage } = useIntl();
12
+ const {
13
+ giftOptionsConfigData,
14
+ isLoading,
15
+ isVisible
16
+ } = useGiftOptionsSection();
17
+
18
+ if (isLoading || !isVisible) {
19
+ return null;
20
+ }
21
+
22
+ return (
23
+ <Section
24
+ id={'gift_options'}
25
+ data-cy="PriceAdjustments-giftOptionsSection"
26
+ title={formatMessage({
27
+ id: 'priceAdjustments.giftOptions',
28
+ defaultMessage: 'See Gift Options'
29
+ })}
30
+ >
31
+ <Suspense fallback={<LoadingIndicator />}>
32
+ <GiftOptions giftOptionsConfigData={giftOptionsConfigData} />
33
+ </Suspense>
34
+ </Section>
35
+ );
36
+ };
37
+
38
+ export default GiftOptionsSection;
@@ -6,11 +6,10 @@ import LoadingIndicator from '@magento/venia-ui/lib/components/LoadingIndicator'
6
6
  import { useStyle } from '../../../classify';
7
7
  import { Accordion, Section } from '../../Accordion';
8
8
  import GiftCardSection from './giftCardSection';
9
-
9
+ import GiftOptionsSection from './giftOptionsSection';
10
10
  import defaultClasses from './priceAdjustments.module.css';
11
11
 
12
12
  const CouponCode = React.lazy(() => import('./CouponCode'));
13
- const GiftOptions = React.lazy(() => import('./GiftOptions'));
14
13
  const ShippingMethods = React.lazy(() => import('./ShippingMethods'));
15
14
 
16
15
  /**
@@ -65,18 +64,7 @@ const PriceAdjustments = props => {
65
64
  </Suspense>
66
65
  </Section>
67
66
  <GiftCardSection setIsCartUpdating={setIsCartUpdating} />
68
- <Section
69
- id={'gift_options'}
70
- data-cy="PriceAdjustments-giftOptionsSection"
71
- title={formatMessage({
72
- id: 'priceAdjustments.giftOptions',
73
- defaultMessage: 'See Gift Options'
74
- })}
75
- >
76
- <Suspense fallback={<LoadingIndicator />}>
77
- <GiftOptions />
78
- </Suspense>
79
- </Section>
67
+ <GiftOptionsSection />
80
68
  </Accordion>
81
69
  </div>
82
70
  );