@riosst100/pwa-marketplace 1.8.8 → 1.9.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.
Files changed (260) hide show
  1. package/i18n/en_US.json +9 -9
  2. package/package.json +1 -2
  3. package/src/componentOverrideMapping.js +15 -1
  4. package/src/components/AccountLayout/accountlayout.module.css +3 -0
  5. package/src/components/AccountLayout/index.js +147 -0
  6. package/src/components/BecomeSeller/becomeSeller.js +304 -178
  7. package/src/components/BecomeSeller/becomeSeller.module.css +3 -3
  8. package/src/components/BecomeSellerPage/becomeSellerPage.js +2 -1
  9. package/src/components/BecomeSellerPage/becomeSellerPage.module.css +2 -10
  10. package/src/components/LegoSets/legoSets.js +48 -18
  11. package/src/components/LiveChat/chatContent.js +39 -0
  12. package/src/components/LiveChat/index.js +52 -0
  13. package/src/components/LiveChat/liveChat.js +160 -0
  14. package/src/components/NonSportCardsSets/nonSportCardsSets.js +15 -2
  15. package/src/components/SellerCountry/sellerCountry.js +1 -1
  16. package/src/components/SellerDetail/sellerDetail.js +34 -3
  17. package/src/components/ShopBy/shopBy.js +99 -4
  18. package/src/components/ShopBy/shopBy.module.css +22 -0
  19. package/src/components/ShopByVehicles/index.js +2 -0
  20. package/src/components/ShopByVehicles/shopByVehicles.js +327 -0
  21. package/src/components/ShopByVehicles/shopByVehicles.module.css +76 -0
  22. package/src/components/ShopByVehicles/shopByVehicles.shimmer.js +50 -0
  23. package/src/components/SocialLogin/img/facebook.svg +3 -0
  24. package/src/components/SocialLogin/img/google.svg +6 -0
  25. package/src/components/SocialLogin/img/instagram.svg +27 -0
  26. package/src/components/SocialLogin/img/wechat.svg +15 -0
  27. package/src/components/SocialLogin/img/weibo.svg +7 -0
  28. package/src/components/SocialLogin/index.js +10 -0
  29. package/src/components/SocialLogin/socialLogin.js +70 -0
  30. package/src/components/SportCardsSets/sportCardsSets.js +6 -1
  31. package/src/components/TrainsSets/index.js +2 -0
  32. package/src/components/TrainsSets/trainsSets.js +331 -0
  33. package/src/components/TrainsSets/trainsSets.module.css +76 -0
  34. package/src/components/TrainsSets/trainsSets.shimmer.js +49 -0
  35. package/src/overwrites/venia-ui/lib/RootComponents/Category/category.js +5 -0
  36. package/src/overwrites/venia-ui/lib/RootComponents/Category/categoryContent.js +4 -0
  37. package/src/overwrites/venia-ui/lib/components/AccountInformationPage/accountInformationPage.gql.js +48 -0
  38. package/src/overwrites/venia-ui/lib/components/AccountInformationPage/accountInformationPage.js +147 -0
  39. package/src/overwrites/venia-ui/lib/components/AccountInformationPage/accountInformationPage.module.css +52 -0
  40. package/src/overwrites/venia-ui/lib/components/AccountInformationPage/accountInformationPageFragment.gql.js +10 -0
  41. package/src/overwrites/venia-ui/lib/components/AccountInformationPage/editForm.js +206 -0
  42. package/src/overwrites/venia-ui/lib/components/AccountInformationPage/editForm.module.css +40 -0
  43. package/src/overwrites/venia-ui/lib/components/AccountInformationPage/editModal.js +107 -0
  44. package/src/overwrites/venia-ui/lib/components/AccountInformationPage/editModal.module.css +3 -0
  45. package/src/overwrites/venia-ui/lib/components/AccountInformationPage/index.js +14 -0
  46. package/src/overwrites/venia-ui/lib/components/AccountMenu/accountMenu.js +107 -0
  47. package/src/overwrites/venia-ui/lib/components/AccountMenu/accountMenu.module.css +73 -0
  48. package/src/overwrites/venia-ui/lib/components/AccountMenu/accountMenuItems.js +58 -0
  49. package/src/overwrites/venia-ui/lib/components/AccountMenu/accountMenuItems.module.css +31 -0
  50. package/src/overwrites/venia-ui/lib/components/AccountMenu/index.js +1 -0
  51. package/src/overwrites/venia-ui/lib/components/Button/button.js +1 -1
  52. package/src/overwrites/venia-ui/lib/components/CartPage/GiftCards/giftCard.js +50 -0
  53. package/src/overwrites/venia-ui/lib/components/CartPage/GiftCards/giftCard.module.css +11 -0
  54. package/src/overwrites/venia-ui/lib/components/CartPage/GiftCards/giftCards.js +238 -0
  55. package/src/overwrites/venia-ui/lib/components/CartPage/GiftCards/giftCards.module.css +98 -0
  56. package/src/overwrites/venia-ui/lib/components/CartPage/GiftCards/index.js +1 -0
  57. package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/CouponCode/couponCode.js +178 -0
  58. package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/CouponCode/couponCode.module.css +52 -0
  59. package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/CouponCode/index.js +1 -0
  60. package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/GiftOptions/giftOptions.js +321 -0
  61. package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/GiftOptions/giftOptions.module.css +61 -0
  62. package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/GiftOptions/index.js +1 -0
  63. package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/index.js +1 -0
  64. package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingForm.js +103 -0
  65. package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingForm.module.css +36 -0
  66. package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingMethods.js +103 -0
  67. package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingMethods.module.css +33 -0
  68. package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingRadio.js +37 -0
  69. package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingRadio.module.css +3 -0
  70. package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingRadios.js +106 -0
  71. package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingRadios.module.css +10 -0
  72. package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/giftCardSection.ce.js +7 -0
  73. package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/giftCardSection.ee.js +28 -0
  74. package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/giftOptionsSection.ce.js +7 -0
  75. package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/giftOptionsSection.ee.js +38 -0
  76. package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/index.js +1 -0
  77. package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/priceAdjustments.js +95 -0
  78. package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/priceAdjustments.module.css +2 -0
  79. package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/discountSummary.js +123 -0
  80. package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/discountSummary.module.css +40 -0
  81. package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/giftCardSummary.ce.js +1 -0
  82. package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/giftCardSummary.ee.js +60 -0
  83. package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/giftOptionsSummary.ce.js +5 -0
  84. package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/giftOptionsSummary.ee.js +40 -0
  85. package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/index.js +1 -0
  86. package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/priceSummary.js +210 -0
  87. package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/priceSummary.module.css +51 -0
  88. package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/shippingSummary.js +58 -0
  89. package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/taxSummary.js +57 -0
  90. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/EditModal/editModal.js +41 -0
  91. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/EditModal/index.js +1 -0
  92. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/EditModal/productDetail.js +80 -0
  93. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/EditModal/productDetail.module.css +33 -0
  94. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/EditModal/productForm.js +153 -0
  95. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/EditModal/productForm.module.css +52 -0
  96. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/errorMessage.js +31 -0
  97. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/errorMessage.module.css +13 -0
  98. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/index.js +1 -0
  99. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/product.js +271 -0
  100. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/product.module.css +156 -0
  101. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/productListing.js +94 -0
  102. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/productListing.module.css +11 -0
  103. package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/quantity.js +40 -0
  104. package/src/overwrites/venia-ui/lib/components/CartPage/cartPage.js +126 -0
  105. package/src/overwrites/venia-ui/lib/components/CartPage/cartPage.module.css +64 -0
  106. package/src/overwrites/venia-ui/lib/components/CartPage/index.js +1 -0
  107. package/src/overwrites/venia-ui/lib/components/CheckoutPage/AddressBook/addressBook.js +190 -0
  108. package/src/overwrites/venia-ui/lib/components/CheckoutPage/AddressBook/addressBook.module.css +78 -0
  109. package/src/overwrites/venia-ui/lib/components/CheckoutPage/AddressBook/addressCard.js +125 -0
  110. package/src/overwrites/venia-ui/lib/components/CheckoutPage/AddressBook/addressCard.module.css +94 -0
  111. package/src/overwrites/venia-ui/lib/components/CheckoutPage/AddressBook/index.js +1 -0
  112. package/src/overwrites/venia-ui/lib/components/CheckoutPage/BillingAddress/billingAddress.js +213 -0
  113. package/src/overwrites/venia-ui/lib/components/CheckoutPage/BillingAddress/billingAddress.module.css +36 -0
  114. package/src/overwrites/venia-ui/lib/components/CheckoutPage/BillingAddress/index.js +1 -0
  115. package/src/overwrites/venia-ui/lib/components/CheckoutPage/GuestSignIn/guestSignIn.js +93 -0
  116. package/src/overwrites/venia-ui/lib/components/CheckoutPage/GuestSignIn/guestSignIn.module.css +55 -0
  117. package/src/overwrites/venia-ui/lib/components/CheckoutPage/GuestSignIn/index.js +1 -0
  118. package/src/overwrites/venia-ui/lib/components/CheckoutPage/ItemsReview/__fixtures__/cartItems.js +102 -0
  119. package/src/overwrites/venia-ui/lib/components/CheckoutPage/ItemsReview/index.js +1 -0
  120. package/src/overwrites/venia-ui/lib/components/CheckoutPage/ItemsReview/item.js +54 -0
  121. package/src/overwrites/venia-ui/lib/components/CheckoutPage/ItemsReview/item.module.css +60 -0
  122. package/src/overwrites/venia-ui/lib/components/CheckoutPage/ItemsReview/itemsReview.js +84 -0
  123. package/src/overwrites/venia-ui/lib/components/CheckoutPage/ItemsReview/itemsReview.module.css +20 -0
  124. package/src/overwrites/venia-ui/lib/components/CheckoutPage/ItemsReview/showAllButton.js +38 -0
  125. package/src/overwrites/venia-ui/lib/components/CheckoutPage/ItemsReview/showAllButton.module.css +28 -0
  126. package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderConfirmationPage/createAccount.js +213 -0
  127. package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderConfirmationPage/createAccount.module.css +24 -0
  128. package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderConfirmationPage/index.js +1 -0
  129. package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderConfirmationPage/orderConfirmationPage.js +162 -0
  130. package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderConfirmationPage/orderConfirmationPage.module.css +70 -0
  131. package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderSummary/index.js +1 -0
  132. package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderSummary/orderSummary.js +34 -0
  133. package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderSummary/orderSummary.module.css +17 -0
  134. package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/brainTreeDropIn.js +196 -0
  135. package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/braintreeDropin.module.css +26 -0
  136. package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/braintreeSummary.js +160 -0
  137. package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/braintreeSummary.module.css +62 -0
  138. package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/creditCard.js +348 -0
  139. package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/creditCard.module.css +58 -0
  140. package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/editCard.js +44 -0
  141. package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/editCard.module.css +5 -0
  142. package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/editModal.js +88 -0
  143. package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/editablePaymentCollection.js +23 -0
  144. package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/index.js +1 -0
  145. package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/paymentInformation.js +99 -0
  146. package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/paymentInformation.module.css +23 -0
  147. package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/paymentMethodCollection.js +23 -0
  148. package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/paymentMethods.js +121 -0
  149. package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/paymentMethods.module.css +34 -0
  150. package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/summary.js +71 -0
  151. package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/summary.module.css +23 -0
  152. package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/summaryPaymentCollection.js +23 -0
  153. package/src/overwrites/venia-ui/lib/components/CheckoutPage/PriceAdjustments/index.js +1 -0
  154. package/src/overwrites/venia-ui/lib/components/CheckoutPage/PriceAdjustments/priceAdjustments.js +63 -0
  155. package/src/overwrites/venia-ui/lib/components/CheckoutPage/PriceAdjustments/priceAdjustments.module.css +2 -0
  156. package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/AddressForm/addressForm.js +18 -0
  157. package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/AddressForm/customerForm.js +401 -0
  158. package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/AddressForm/customerForm.module.css +58 -0
  159. package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/AddressForm/guestForm.js +455 -0
  160. package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/AddressForm/guestForm.module.css +52 -0
  161. package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/AddressForm/index.js +3 -0
  162. package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/card.js +66 -0
  163. package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/card.module.css +12 -0
  164. package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/editModal.js +65 -0
  165. package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/editModal.module.css +90 -0
  166. package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/index.js +1 -0
  167. package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/shippingInformation.js +149 -0
  168. package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/shippingInformation.module.css +88 -0
  169. package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/completedView.js +114 -0
  170. package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/completedView.module.css +48 -0
  171. package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/index.js +1 -0
  172. package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/shippingMethod.js +154 -0
  173. package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/shippingMethod.module.css +27 -0
  174. package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/shippingRadios.js +80 -0
  175. package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/shippingRadios.module.css +22 -0
  176. package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/updateModal.js +85 -0
  177. package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/updateModal.module.css +3 -0
  178. package/src/overwrites/venia-ui/lib/components/CheckoutPage/checkoutPage.js +472 -0
  179. package/src/overwrites/venia-ui/lib/components/CheckoutPage/checkoutPage.module.css +186 -0
  180. package/src/overwrites/venia-ui/lib/components/CheckoutPage/index.js +1 -0
  181. package/src/overwrites/venia-ui/lib/components/CreateAccount/createAccount.js +323 -0
  182. package/src/overwrites/venia-ui/lib/components/CreateAccount/createAccount.module.css +52 -0
  183. package/src/overwrites/venia-ui/lib/components/CreateAccount/index.js +1 -0
  184. package/src/overwrites/venia-ui/lib/components/CreateAccountPage/createAccountPage.js +48 -0
  185. package/src/overwrites/venia-ui/lib/components/CreateAccountPage/createAccountPage.module.css +21 -0
  186. package/src/overwrites/venia-ui/lib/components/CreateAccountPage/index.js +1 -0
  187. package/src/overwrites/venia-ui/lib/components/Dialog/dialog.js +198 -0
  188. package/src/overwrites/venia-ui/lib/components/Dialog/dialog.module.css +189 -0
  189. package/src/overwrites/venia-ui/lib/components/Dialog/index.js +1 -0
  190. package/src/overwrites/venia-ui/lib/components/FilterSidebar/filterSidebar.js +8 -7
  191. package/src/overwrites/venia-ui/lib/components/Gallery/item.js +12 -4
  192. package/src/overwrites/venia-ui/lib/components/Gallery/item.module.css +2 -2
  193. package/src/overwrites/venia-ui/lib/components/Header/header.js +37 -2
  194. package/src/overwrites/venia-ui/lib/components/Main/main.js +1 -1
  195. package/src/overwrites/venia-ui/lib/components/MegaMenu/shopByColumn.js +3 -2
  196. package/src/overwrites/venia-ui/lib/components/MegaMenu/submenu.js +1 -1
  197. package/src/overwrites/venia-ui/lib/components/MyAccount/ResetPassword/index.js +1 -0
  198. package/src/overwrites/venia-ui/lib/components/MyAccount/ResetPassword/resetPassword.gql.js +22 -0
  199. package/src/overwrites/venia-ui/lib/components/MyAccount/ResetPassword/resetPassword.js +143 -0
  200. package/src/overwrites/venia-ui/lib/components/MyAccount/ResetPassword/resetPassword.module.css +53 -0
  201. package/src/overwrites/venia-ui/lib/components/MyAccount/accountLink.js +42 -0
  202. package/src/overwrites/venia-ui/lib/components/MyAccount/accountLink.module.css +33 -0
  203. package/src/overwrites/venia-ui/lib/components/MyAccount/index.js +1 -0
  204. package/src/overwrites/venia-ui/lib/components/MyAccount/myAccount.js +38 -0
  205. package/src/overwrites/venia-ui/lib/components/MyAccount/myAccount.module.css +5 -0
  206. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/billingInformation.js +71 -0
  207. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/billingInformation.module.css +9 -0
  208. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/index.js +1 -0
  209. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/item.js +121 -0
  210. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/item.module.css +35 -0
  211. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/items.js +70 -0
  212. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/items.module.css +16 -0
  213. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/orderDetails.js +207 -0
  214. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/orderDetails.module.css +102 -0
  215. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/orderTotal.js +159 -0
  216. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/orderTotal.module.css +50 -0
  217. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/paymentMethod.js +45 -0
  218. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/paymentMethod.module.css +14 -0
  219. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/shippingInformation.js +90 -0
  220. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/shippingInformation.module.css +9 -0
  221. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/shippingMethod.js +86 -0
  222. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/shippingMethod.module.css +19 -0
  223. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/collapsedImageGallery.js +63 -0
  224. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/collapsedImageGallery.module.css +16 -0
  225. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/index.js +15 -0
  226. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderHistoryPage.js +227 -0
  227. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderHistoryPage.module.css +70 -0
  228. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderProgressBar.js +70 -0
  229. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderProgressBar.module.css +14 -0
  230. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderRow.js +324 -0
  231. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderRow.module.css +146 -0
  232. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/resetButton.js +41 -0
  233. package/src/overwrites/venia-ui/lib/components/Password/index.js +1 -0
  234. package/src/overwrites/venia-ui/lib/components/Password/password.js +102 -0
  235. package/src/overwrites/venia-ui/lib/components/Password/password.module.css +26 -0
  236. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/productFullDetail.js +30 -15
  237. package/src/overwrites/venia-ui/lib/components/Select/index.js +1 -0
  238. package/src/overwrites/venia-ui/lib/components/Select/option.js +28 -0
  239. package/src/overwrites/venia-ui/lib/components/Select/select.js +74 -0
  240. package/src/overwrites/venia-ui/lib/components/Select/select.module.css +25 -0
  241. package/src/overwrites/venia-ui/lib/components/SignIn/index.js +1 -0
  242. package/src/overwrites/venia-ui/lib/components/SignIn/signIn.gql.js +50 -0
  243. package/src/overwrites/venia-ui/lib/components/SignIn/signIn.js +224 -0
  244. package/src/overwrites/venia-ui/lib/components/SignIn/signIn.module.css +65 -0
  245. package/src/overwrites/venia-ui/lib/components/SignInPage/index.js +1 -0
  246. package/src/overwrites/venia-ui/lib/components/SignInPage/signInPage.js +50 -0
  247. package/src/overwrites/venia-ui/lib/components/SignInPage/signInPage.module.css +17 -0
  248. package/src/overwrites/venia-ui/lib/components/TextInput/textInput.js +1 -1
  249. package/src/talons/Header/logo.gql.js +19 -0
  250. package/src/talons/Header/useLogo.js +19 -0
  251. package/src/talons/LegoSets/legoSets.gql.js +2 -2
  252. package/src/talons/LegoSets/useLegoSets.js +4 -2
  253. package/src/talons/NonSportCardsSets/useNonSportCardsSets.js +1 -1
  254. package/src/talons/ShopBy/shopBy.gql.js +2 -2
  255. package/src/talons/ShopBy/useShopBy.js +20 -9
  256. package/src/talons/ShopByVehicles/shopByVehicles.gql.js +60 -0
  257. package/src/talons/ShopByVehicles/useShopByVehicles.js +222 -0
  258. package/src/talons/SportCardsSets/useSportCardsSets.js +1 -1
  259. package/src/talons/TrainsSets/trainsSets.gql.js +60 -0
  260. package/src/talons/TrainsSets/useTrainsSets.js +223 -0
@@ -0,0 +1,348 @@
1
+ import React, { useMemo, useCallback } from 'react';
2
+ import { useIntl } from 'react-intl';
3
+ import { bool, func, shape, string } from 'prop-types';
4
+ import { useCreditCard } from '@magento/peregrine/lib/talons/CheckoutPage/PaymentInformation/useCreditCard';
5
+
6
+ import { isRequired } from '@magento/venia-ui/lib/util/formValidators';
7
+ import Country from '@magento/venia-ui/lib/components/Country';
8
+ import Region from '@magento/venia-ui/lib/components/Region';
9
+ import Postcode from '@magento/venia-ui/lib/components/Postcode';
10
+ import Checkbox from '@magento/venia-ui/lib/components/Checkbox';
11
+ import Field from '@magento/venia-ui/lib/components/Field';
12
+ import TextInput from '@magento/venia-ui/lib/components/TextInput';
13
+ import BrainTreeDropin from './brainTreeDropIn';
14
+ import LoadingIndicator from '@magento/venia-ui/lib/components/LoadingIndicator';
15
+ import { useStyle } from '@magento/venia-ui/lib/classify';
16
+
17
+ import defaultClasses from './creditCard.module.css';
18
+ import FormError from '@magento/venia-ui/lib/components/FormError';
19
+ import GoogleReCaptcha from '@magento/venia-ui/lib/components/GoogleReCaptcha';
20
+
21
+ const STEP_DESCRIPTIONS = [
22
+ { defaultMessage: 'Loading Payment', id: 'checkoutPage.step0' },
23
+ {
24
+ defaultMessage: 'Checking Credit Card Information',
25
+ id: 'checkoutPage.step1'
26
+ },
27
+ {
28
+ defaultMessage: 'Checking Credit Card Information',
29
+ id: 'checkoutPage.step2'
30
+ },
31
+ {
32
+ defaultMessage: 'Checking Credit Card Information',
33
+ id: 'checkoutPage.step3'
34
+ },
35
+ {
36
+ defaultMessage: 'Saved Credit Card Information Successfully',
37
+ id: 'checkoutPage.step4'
38
+ }
39
+ ];
40
+
41
+ /**
42
+ * The initial view for the Braintree payment method.
43
+ */
44
+ const CreditCard = props => {
45
+ const {
46
+ classes: propClasses,
47
+ onPaymentSuccess: onSuccess,
48
+ onPaymentReady: onReady,
49
+ onPaymentError: onError,
50
+ resetShouldSubmit,
51
+ shouldSubmit
52
+ } = props;
53
+ const { formatMessage } = useIntl();
54
+
55
+ const classes = useStyle(defaultClasses, propClasses);
56
+
57
+ const talonProps = useCreditCard({
58
+ onSuccess,
59
+ onReady,
60
+ onError,
61
+ shouldSubmit,
62
+ resetShouldSubmit
63
+ });
64
+
65
+ const {
66
+ errors,
67
+ shouldRequestPaymentNonce,
68
+ onPaymentError,
69
+ onPaymentSuccess,
70
+ onPaymentReady,
71
+ isBillingAddressSame,
72
+ isLoading,
73
+ /**
74
+ * `stepNumber` depicts the state of the process flow in credit card
75
+ * payment flow.
76
+ *
77
+ * `0` No call made yet
78
+ * `1` Billing address mutation intiated
79
+ * `2` Braintree nonce requsted
80
+ * `3` Payment information mutation intiated
81
+ * `4` All mutations done
82
+ */
83
+ stepNumber,
84
+ initialValues,
85
+ shippingAddressCountry,
86
+ shouldTeardownDropin,
87
+ resetShouldTeardownDropin,
88
+ recaptchaWidgetProps
89
+ } = talonProps;
90
+
91
+ const creditCardComponentClassName = isLoading
92
+ ? classes.credit_card_root_hidden
93
+ : classes.credit_card_root;
94
+
95
+ const billingAddressFieldsClassName = isBillingAddressSame
96
+ ? classes.billing_address_fields_root_hidden
97
+ : classes.billing_address_fields_root;
98
+
99
+ /**
100
+ * Instead of defining classes={root: classes.FIELD_NAME}
101
+ * we are using useMemo to only do it once (hopefully).
102
+ */
103
+ const fieldClasses = useMemo(() => {
104
+ return [
105
+ 'first_name',
106
+ 'last_name',
107
+ 'country',
108
+ 'street1',
109
+ 'street2',
110
+ 'city',
111
+ 'region',
112
+ 'postal_code',
113
+ 'phone_number'
114
+ ].reduce((acc, fieldName) => {
115
+ acc[fieldName] = { root: classes[fieldName] };
116
+
117
+ return acc;
118
+ }, {});
119
+ }, [classes]);
120
+
121
+ /**
122
+ * These 2 functions are wrappers around the `isRequired` function
123
+ * of `formValidators`. They perform validations only if the
124
+ * billing address is different from shipping address.
125
+ *
126
+ * We write this function in `venia-ui` and not in the `peregrine` talon
127
+ * because it references `isRequired` which is a `venia-ui` function.
128
+ */
129
+ const isFieldRequired = useCallback((value, { isBillingAddressSame }) => {
130
+ if (isBillingAddressSame) {
131
+ /**
132
+ * Informed validator functions return `undefined` if
133
+ * validation is `true`
134
+ */
135
+ return undefined;
136
+ } else {
137
+ return isRequired(value);
138
+ }
139
+ }, []);
140
+
141
+ const stepTitle = STEP_DESCRIPTIONS[stepNumber].defaultMessage
142
+ ? formatMessage({
143
+ id: STEP_DESCRIPTIONS[stepNumber].id,
144
+ defaultMessage: STEP_DESCRIPTIONS[stepNumber].defaultMessage
145
+ })
146
+ : formatMessage({
147
+ id: 'checkoutPage.loadingPayment',
148
+ defaultMessage: 'Loading Payment'
149
+ });
150
+
151
+ const loadingIndicator = isLoading ? (
152
+ <LoadingIndicator>{stepTitle}</LoadingIndicator>
153
+ ) : null;
154
+
155
+ return (
156
+ <div className={classes.root} data-cy="CreditCard-root">
157
+ <div className={creditCardComponentClassName}>
158
+ <FormError
159
+ allowErrorMessages
160
+ classes={{ root: classes.formErrorContainer }}
161
+ errors={Array.from(errors.values())}
162
+ />
163
+ <div className={classes.dropin_root}>
164
+ <BrainTreeDropin
165
+ onError={onPaymentError}
166
+ onReady={onPaymentReady}
167
+ onSuccess={onPaymentSuccess}
168
+ shouldRequestPaymentNonce={shouldRequestPaymentNonce}
169
+ shouldTeardownDropin={shouldTeardownDropin}
170
+ resetShouldTeardownDropin={resetShouldTeardownDropin}
171
+ />
172
+ </div>
173
+ <div
174
+ data-cy="CreditCard-AddressCheck-root"
175
+ className={classes.address_check}
176
+ >
177
+ <Checkbox
178
+ data-cy="PaymentInformation-billingAddressSame"
179
+ field="isBillingAddressSame"
180
+ label={formatMessage({
181
+ id: 'checkoutPage.billingAddressSame',
182
+ defaultMessage:
183
+ 'Billing address same as shipping address'
184
+ })}
185
+ initialValue={initialValues.isBillingAddressSame}
186
+ />
187
+ </div>
188
+ <div
189
+ data-cy="CreditCard-billingAddressFields"
190
+ className={billingAddressFieldsClassName}
191
+ >
192
+ <Field
193
+ id="firstName"
194
+ classes={fieldClasses.first_name}
195
+ label={formatMessage({
196
+ id: 'global.firstName',
197
+ defaultMessage: 'First Name'
198
+ })}
199
+ >
200
+ <TextInput
201
+ data-cy="CreditCard-billingAddress-firstname"
202
+ id="firstName"
203
+ field="firstName"
204
+ validate={isFieldRequired}
205
+ initialValue={initialValues.firstName}
206
+ />
207
+ </Field>
208
+ <Field
209
+ id="lastName"
210
+ classes={fieldClasses.last_name}
211
+ label={formatMessage({
212
+ id: 'global.lastName',
213
+ defaultMessage: 'Last Name'
214
+ })}
215
+ >
216
+ <TextInput
217
+ data-cy="CreditCard-billingAddress-lastname"
218
+ id="lastName"
219
+ field="lastName"
220
+ validate={isFieldRequired}
221
+ initialValue={initialValues.lastName}
222
+ />
223
+ </Field>
224
+ <Country
225
+ data-cy="CreditCard-billingAddress-country"
226
+ classes={fieldClasses.country}
227
+ validate={isFieldRequired}
228
+ initialValue={
229
+ /**
230
+ * If there is no initial value to start with
231
+ * use the country from shipping address.
232
+ */
233
+ initialValues.country || shippingAddressCountry
234
+ }
235
+ />
236
+ <Field
237
+ id="street1"
238
+ classes={fieldClasses.street1}
239
+ label={formatMessage({
240
+ id: 'global.streetAddress',
241
+ defaultMessage: 'Street Address'
242
+ })}
243
+ >
244
+ <TextInput
245
+ data-cy="CreditCard-billingAddress-street1"
246
+ id="street1"
247
+ field="street1"
248
+ validate={isFieldRequired}
249
+ initialValue={initialValues.street1}
250
+ />
251
+ </Field>
252
+ <Field
253
+ id="street2"
254
+ classes={fieldClasses.street2}
255
+ label={formatMessage({
256
+ id: 'global.streetAddress2',
257
+ defaultMessage: 'Street Address 2'
258
+ })}
259
+ optional={true}
260
+ >
261
+ <TextInput
262
+ data-cy="CreditCard-billingAddress-street2"
263
+ id="street2"
264
+ field="street2"
265
+ initialValue={initialValues.street2}
266
+ />
267
+ </Field>
268
+ <Field
269
+ id="city"
270
+ classes={fieldClasses.city}
271
+ label={formatMessage({
272
+ id: 'global.city',
273
+ defaultMessage: 'City'
274
+ })}
275
+ >
276
+ <TextInput
277
+ data-cy="CreditCard-billingAddress-city"
278
+ id="city"
279
+ field="city"
280
+ validate={isFieldRequired}
281
+ initialValue={initialValues.city}
282
+ />
283
+ </Field>
284
+ <Region
285
+ data-cy="CreditCard-billingAddress-region"
286
+ classes={fieldClasses.region}
287
+ initialValue={initialValues.region}
288
+ validate={isFieldRequired}
289
+ fieldInput={'region[label]'}
290
+ fieldSelect={'region[region_id]'}
291
+ optionValueKey={'id'}
292
+ />
293
+ <Postcode
294
+ data-cy="CreditCard-billingAddress-postcode"
295
+ classes={fieldClasses.postal_code}
296
+ validate={isFieldRequired}
297
+ initialValue={initialValues.postcode}
298
+ />
299
+ <Field
300
+ id="phoneNumber"
301
+ classes={fieldClasses.phone_number}
302
+ label={formatMessage({
303
+ id: 'global.phoneNumber',
304
+ defaultMessage: 'Phone Number'
305
+ })}
306
+ >
307
+ <TextInput
308
+ data-cy="CreditCard-billingAddress-phoneNumber"
309
+ id="phoneNumber"
310
+ field="phoneNumber"
311
+ validate={isFieldRequired}
312
+ initialValue={initialValues.phoneNumber}
313
+ />
314
+ </Field>
315
+ </div>
316
+ <GoogleReCaptcha {...recaptchaWidgetProps} />
317
+ </div>
318
+ {loadingIndicator}
319
+ </div>
320
+ );
321
+ };
322
+
323
+ export default CreditCard;
324
+
325
+ CreditCard.propTypes = {
326
+ classes: shape({
327
+ root: string,
328
+ dropin_root: string,
329
+ billing_address_fields_root: string,
330
+ first_name: string,
331
+ last_name: string,
332
+ city: string,
333
+ region: string,
334
+ postal_code: string,
335
+ phone_number: string,
336
+ country: string,
337
+ street1: string,
338
+ street2: string,
339
+ address_check: string,
340
+ credit_card_root: string,
341
+ credit_card_root_hidden: string
342
+ }),
343
+ shouldSubmit: bool.isRequired,
344
+ onPaymentSuccess: func,
345
+ onPaymentReady: func,
346
+ onPaymentError: func,
347
+ resetShouldSubmit: func.isRequired
348
+ };
@@ -0,0 +1,58 @@
1
+ .root {
2
+ }
3
+
4
+ .credit_card_root {
5
+ composes: visible from global;
6
+ composes: opacity-100 from global;
7
+ transition-delay: 64ms;
8
+ transition-duration: 384ms;
9
+ transition-property: opacity, visbility;
10
+ transition-timing-function: var(--venia-global-anim-standard);
11
+ }
12
+
13
+ .credit_card_root_hidden {
14
+ composes: h-0 from global;
15
+ composes: invisible from global;
16
+ composes: opacity-0 from global;
17
+ composes: overflow-hidden from global;
18
+ }
19
+
20
+ .dropin_root {
21
+ }
22
+
23
+ .billing_address_fields_root {
24
+ composes: gap-x-xs from global;
25
+ composes: gap-y-sm from global;
26
+ composes: grid from global;
27
+ composes: px-0 from global;
28
+ composes: py-xs from global;
29
+ }
30
+
31
+ .billing_address_fields_root_hidden {
32
+ composes: h-0 from global;
33
+ composes: invisible from global;
34
+ composes: opacity-0 from global;
35
+ composes: overflow-hidden from global;
36
+ }
37
+
38
+ .formErrorContainer {
39
+ composes: pt-sm from global;
40
+ }
41
+
42
+ .first_name,
43
+ .last_name {
44
+ composes: col-end-span2 from global;
45
+
46
+ composes: lg_col-end-span1 from global;
47
+ }
48
+
49
+ .country,
50
+ .street1,
51
+ .street2,
52
+ .address_check,
53
+ .city,
54
+ .region,
55
+ .postal_code,
56
+ .phone_number {
57
+ composes: col-end-span2 from global;
58
+ }
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ import { shape, string, bool, func } from 'prop-types';
3
+ import defaultClasses from './editCard.module.css';
4
+ import { useStyle } from '@magento/venia-ui/lib/classify';
5
+ import CreditCard from './creditCard';
6
+
7
+ /**
8
+ * The edit view for the Braintree payment method.
9
+ */
10
+ const EditCard = props => {
11
+ const classes = useStyle(defaultClasses, props.classes);
12
+ const {
13
+ onPaymentReady,
14
+ onPaymentSuccess,
15
+ onPaymentError,
16
+ resetShouldSubmit,
17
+ shouldSubmit
18
+ } = props;
19
+
20
+ return (
21
+ <div className={classes.root} data-cy="EditCard">
22
+ <CreditCard
23
+ onPaymentReady={onPaymentReady}
24
+ onPaymentSuccess={onPaymentSuccess}
25
+ onPaymentError={onPaymentError}
26
+ resetShouldSubmit={resetShouldSubmit}
27
+ shouldSubmit={shouldSubmit}
28
+ />
29
+ </div>
30
+ );
31
+ };
32
+
33
+ EditCard.propTypes = {
34
+ classes: shape({
35
+ root: string
36
+ }),
37
+ onPaymentReady: func.isRequired,
38
+ onPaymentSuccess: func.isRequired,
39
+ onPaymentError: func.isRequired,
40
+ resetShouldSubmit: func.isRequired,
41
+ shouldSubmit: bool
42
+ };
43
+
44
+ export default EditCard;
@@ -0,0 +1,5 @@
1
+ .root {
2
+ composes: overflow-auto from global;
3
+ composes: px-xs from global;
4
+ composes: py-2xs from global;
5
+ }
@@ -0,0 +1,88 @@
1
+ import React, { useMemo } from 'react';
2
+ import { FormattedMessage, useIntl } from 'react-intl';
3
+ import { bool, func } from 'prop-types';
4
+
5
+ import { useEditModal } from '@magento/peregrine/lib/talons/CheckoutPage/PaymentInformation/useEditModal';
6
+ import Dialog from '@magento/venia-ui/lib/components/Dialog';
7
+ import editablePayments from './editablePaymentCollection';
8
+
9
+ const EditModal = props => {
10
+ const { onClose, isOpen } = props;
11
+ const { formatMessage } = useIntl();
12
+
13
+ const talonProps = useEditModal({ onClose });
14
+
15
+ const {
16
+ selectedPaymentMethod,
17
+ handleUpdate,
18
+ handleClose,
19
+ handlePaymentSuccess,
20
+ handlePaymentReady,
21
+ updateButtonClicked,
22
+ resetUpdateButtonClicked,
23
+ handlePaymentError
24
+ } = talonProps;
25
+
26
+ const paymentMethodComponent = useMemo(() => {
27
+ const isEditable = Object.keys(editablePayments).includes(
28
+ selectedPaymentMethod
29
+ );
30
+ if (isEditable) {
31
+ const PaymentMethodComponent =
32
+ editablePayments[selectedPaymentMethod];
33
+ return (
34
+ <PaymentMethodComponent
35
+ onPaymentReady={handlePaymentReady}
36
+ onPaymentSuccess={handlePaymentSuccess}
37
+ onPaymentError={handlePaymentError}
38
+ resetShouldSubmit={resetUpdateButtonClicked}
39
+ shouldSubmit={updateButtonClicked}
40
+ />
41
+ );
42
+ } else {
43
+ return (
44
+ <div>
45
+ <FormattedMessage
46
+ id={'checkoutPage.paymentMethodStatus'}
47
+ defaultMessage={
48
+ '{selectedPaymentMethod} is not supported for editing.'
49
+ }
50
+ values={{ selectedPaymentMethod }}
51
+ />
52
+ </div>
53
+ );
54
+ }
55
+ }, [
56
+ handlePaymentError,
57
+ handlePaymentReady,
58
+ handlePaymentSuccess,
59
+ resetUpdateButtonClicked,
60
+ selectedPaymentMethod,
61
+ updateButtonClicked
62
+ ]);
63
+
64
+ return (
65
+ <Dialog
66
+ confirmText={'Update'}
67
+ confirmTranslationId={'global.updateButton'}
68
+ isOpen={isOpen}
69
+ onCancel={handleClose}
70
+ onConfirm={handleUpdate}
71
+ shouldDisableAllButtons={updateButtonClicked}
72
+ shouldDisableConfirmButton={updateButtonClicked}
73
+ title={formatMessage({
74
+ id: 'checkoutPage.editPaymentInformation',
75
+ defaultMessage: 'Edit Payment Information'
76
+ })}
77
+ >
78
+ {paymentMethodComponent}
79
+ </Dialog>
80
+ );
81
+ };
82
+
83
+ export default EditModal;
84
+
85
+ EditModal.propTypes = {
86
+ onClose: func.isRequired,
87
+ isOpen: bool
88
+ };
@@ -0,0 +1,23 @@
1
+ /**
2
+ * This file is augmented at build time using the @magento/venia-ui build
3
+ * target "checkoutPagePaymentTypes", which allows third-party modules to
4
+ * add new payment component mappings for the checkout page.
5
+ *
6
+ * @see [Payment definition object]{@link PaymentDefinition}
7
+ */
8
+ export default {};
9
+
10
+ /**
11
+ * A payment definition object that describes a payment in your storefront.
12
+ *
13
+ * @typedef {Object} PaymentDefinition
14
+ * @property {string} paymentCode is use to map your payment
15
+ * @property {string} importPath Resolvable path to the component the
16
+ * Route component will render
17
+ *
18
+ * @example <caption>A custom payment method</caption>
19
+ * const myCustomPayment = {
20
+ * paymentCode: 'cc',
21
+ * importPath: '@partner/module/path_to_your_component'
22
+ * }
23
+ */
@@ -0,0 +1 @@
1
+ export { default } from './paymentInformation';
@@ -0,0 +1,99 @@
1
+ import React, { Suspense } from 'react';
2
+ import { FormattedMessage } from 'react-intl';
3
+ import { Form } from 'informed';
4
+ import { shape, func, string, bool, instanceOf } from 'prop-types';
5
+
6
+ import { usePaymentInformation } from '@magento/peregrine/lib/talons/CheckoutPage/PaymentInformation/usePaymentInformation';
7
+ import CheckoutError from '@magento/peregrine/lib/talons/CheckoutPage/CheckoutError';
8
+
9
+ import { useStyle } from '@magento/venia-ui/lib/classify';
10
+ import defaultClasses from './paymentInformation.module.css';
11
+ import LoadingIndicator from '@magento/venia-ui/lib/components/LoadingIndicator';
12
+
13
+ const PaymentMethods = React.lazy(() => import('./paymentMethods'));
14
+ const EditModal = React.lazy(() => import('./editModal'));
15
+ const Summary = React.lazy(() => import('./summary'));
16
+
17
+ const PaymentInformation = props => {
18
+ const {
19
+ classes: propClasses,
20
+ onSave,
21
+ resetShouldSubmit,
22
+ setCheckoutStep,
23
+ shouldSubmit,
24
+ checkoutError
25
+ } = props;
26
+
27
+ const classes = useStyle(defaultClasses, propClasses);
28
+
29
+ const talonProps = usePaymentInformation({
30
+ onSave,
31
+ checkoutError,
32
+ resetShouldSubmit,
33
+ setCheckoutStep,
34
+ shouldSubmit
35
+ });
36
+
37
+ const {
38
+ doneEditing,
39
+ handlePaymentError,
40
+ handlePaymentSuccess,
41
+ hideEditModal,
42
+ isLoading,
43
+ isEditModalActive,
44
+ showEditModal
45
+ } = talonProps;
46
+
47
+ if (isLoading) {
48
+ return (
49
+ <LoadingIndicator classes={{ root: classes.loading }}>
50
+ <FormattedMessage
51
+ id={'checkoutPage.loadingPaymentInformation'}
52
+ defaultMessage={'Fetching Payment Information'}
53
+ />
54
+ </LoadingIndicator>
55
+ );
56
+ }
57
+
58
+ const paymentInformation = doneEditing ? (
59
+ <Summary onEdit={showEditModal} />
60
+ ) : (
61
+ <Form>
62
+ <PaymentMethods
63
+ onPaymentError={handlePaymentError}
64
+ onPaymentSuccess={handlePaymentSuccess}
65
+ resetShouldSubmit={resetShouldSubmit}
66
+ shouldSubmit={shouldSubmit}
67
+ />
68
+ </Form>
69
+ );
70
+
71
+ const editModal = doneEditing ? (
72
+ <Suspense fallback={null}>
73
+ <EditModal onClose={hideEditModal} isOpen={isEditModalActive} />
74
+ </Suspense>
75
+ ) : null;
76
+
77
+ return (
78
+ <div className={classes.root} data-cy="PaymentInformation-root">
79
+ <div className={classes.payment_info_container}>
80
+ <Suspense fallback={null}>{paymentInformation}</Suspense>
81
+ </div>
82
+ {editModal}
83
+ </div>
84
+ );
85
+ };
86
+
87
+ export default PaymentInformation;
88
+
89
+ PaymentInformation.propTypes = {
90
+ classes: shape({
91
+ container: string,
92
+ payment_info_container: string,
93
+ review_order_button: string
94
+ }),
95
+ onSave: func.isRequired,
96
+ checkoutError: instanceOf(CheckoutError),
97
+ resetShouldSubmit: func.isRequired,
98
+ shouldSubmit: bool
99
+ };
@@ -0,0 +1,23 @@
1
+ .root {
2
+ composes: gap-xs from global;
3
+ composes: grid from global;
4
+ composes: grid-cols-1 from global;
5
+ }
6
+
7
+ .payment_info_container {
8
+ composes: border from global;
9
+ composes: border-gray-100 from global;
10
+ composes: rounded-md from global;
11
+ }
12
+
13
+ .loading {
14
+ composes: root from '@magento/venia-ui/lib/components/LoadingIndicator/indicator.module.css';
15
+
16
+ composes: text-center from global;
17
+ }
18
+
19
+ .heading {
20
+ composes: border-0 from global;
21
+
22
+ composes: lg_border from global;
23
+ }