@riosst100/pwa-marketplace 1.8.9 → 1.9.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.
- package/i18n/en_US.json +9 -9
- package/package.json +1 -1
- package/src/componentOverrideMapping.js +15 -1
- package/src/components/AccountLayout/accountlayout.module.css +3 -0
- package/src/components/AccountLayout/index.js +147 -0
- package/src/components/BecomeSeller/becomeSeller.js +304 -178
- package/src/components/BecomeSeller/becomeSeller.module.css +3 -3
- package/src/components/BecomeSellerPage/becomeSellerPage.js +2 -1
- package/src/components/BecomeSellerPage/becomeSellerPage.module.css +2 -10
- package/src/components/LegoSets/legoSets.js +1 -2
- package/src/components/LiveChat/chatContent.js +39 -0
- package/src/components/LiveChat/index.js +52 -0
- package/src/components/LiveChat/liveChat.js +160 -0
- package/src/components/SellerCountry/sellerCountry.js +1 -1
- package/src/components/SellerDetail/sellerDetail.js +34 -3
- package/src/components/ShopBy/shopBy.js +92 -4
- package/src/components/ShopBy/shopBy.module.css +22 -0
- package/src/components/ShopByVehicles/shopByVehicles.js +1 -2
- package/src/components/ShopByVehicles/shopByVehicles.module.css +76 -0
- package/src/components/SocialLogin/img/facebook.svg +3 -0
- package/src/components/SocialLogin/img/google.svg +6 -0
- package/src/components/SocialLogin/img/instagram.svg +27 -0
- package/src/components/SocialLogin/img/wechat.svg +15 -0
- package/src/components/SocialLogin/img/weibo.svg +7 -0
- package/src/components/SocialLogin/index.js +10 -0
- package/src/components/SocialLogin/socialLogin.js +70 -0
- package/src/components/TrainsSets/index.js +2 -0
- package/src/components/TrainsSets/trainsSets.js +331 -0
- package/src/components/TrainsSets/trainsSets.module.css +76 -0
- package/src/components/TrainsSets/trainsSets.shimmer.js +49 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/category.js +5 -0
- package/src/overwrites/venia-ui/lib/components/AccountInformationPage/accountInformationPage.gql.js +48 -0
- package/src/overwrites/venia-ui/lib/components/AccountInformationPage/accountInformationPage.js +147 -0
- package/src/overwrites/venia-ui/lib/components/AccountInformationPage/accountInformationPage.module.css +52 -0
- package/src/overwrites/venia-ui/lib/components/AccountInformationPage/accountInformationPageFragment.gql.js +10 -0
- package/src/overwrites/venia-ui/lib/components/AccountInformationPage/editForm.js +206 -0
- package/src/overwrites/venia-ui/lib/components/AccountInformationPage/editForm.module.css +40 -0
- package/src/overwrites/venia-ui/lib/components/AccountInformationPage/editModal.js +107 -0
- package/src/overwrites/venia-ui/lib/components/AccountInformationPage/editModal.module.css +3 -0
- package/src/overwrites/venia-ui/lib/components/AccountInformationPage/index.js +14 -0
- package/src/overwrites/venia-ui/lib/components/AccountMenu/accountMenu.js +107 -0
- package/src/overwrites/venia-ui/lib/components/AccountMenu/accountMenu.module.css +73 -0
- package/src/overwrites/venia-ui/lib/components/AccountMenu/accountMenuItems.js +58 -0
- package/src/overwrites/venia-ui/lib/components/AccountMenu/accountMenuItems.module.css +31 -0
- package/src/overwrites/venia-ui/lib/components/AccountMenu/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/Button/button.js +1 -1
- package/src/overwrites/venia-ui/lib/components/CartPage/GiftCards/giftCard.js +50 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/GiftCards/giftCard.module.css +11 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/GiftCards/giftCards.js +238 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/GiftCards/giftCards.module.css +98 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/GiftCards/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/CouponCode/couponCode.js +178 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/CouponCode/couponCode.module.css +52 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/CouponCode/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/GiftOptions/giftOptions.js +321 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/GiftOptions/giftOptions.module.css +61 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/GiftOptions/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingForm.js +103 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingForm.module.css +36 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingMethods.js +103 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingMethods.module.css +33 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingRadio.js +37 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingRadio.module.css +3 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingRadios.js +106 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingRadios.module.css +10 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/giftCardSection.ce.js +7 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/giftCardSection.ee.js +28 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/giftOptionsSection.ce.js +7 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/giftOptionsSection.ee.js +38 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/priceAdjustments.js +95 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/priceAdjustments.module.css +2 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/discountSummary.js +123 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/discountSummary.module.css +40 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/giftCardSummary.ce.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/giftCardSummary.ee.js +60 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/giftOptionsSummary.ce.js +5 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/giftOptionsSummary.ee.js +40 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/priceSummary.js +210 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/priceSummary.module.css +51 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/shippingSummary.js +58 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/taxSummary.js +57 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/EditModal/editModal.js +41 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/EditModal/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/EditModal/productDetail.js +80 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/EditModal/productDetail.module.css +33 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/EditModal/productForm.js +153 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/EditModal/productForm.module.css +52 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/errorMessage.js +31 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/errorMessage.module.css +13 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/product.js +271 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/product.module.css +156 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/productListing.js +94 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/productListing.module.css +11 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListing/quantity.js +40 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/cartPage.js +126 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/cartPage.module.css +64 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/AddressBook/addressBook.js +190 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/AddressBook/addressBook.module.css +78 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/AddressBook/addressCard.js +125 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/AddressBook/addressCard.module.css +94 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/AddressBook/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/BillingAddress/billingAddress.js +213 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/BillingAddress/billingAddress.module.css +36 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/BillingAddress/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/GuestSignIn/guestSignIn.js +93 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/GuestSignIn/guestSignIn.module.css +55 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/GuestSignIn/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ItemsReview/__fixtures__/cartItems.js +102 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ItemsReview/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ItemsReview/item.js +54 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ItemsReview/item.module.css +60 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ItemsReview/itemsReview.js +84 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ItemsReview/itemsReview.module.css +20 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ItemsReview/showAllButton.js +38 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ItemsReview/showAllButton.module.css +28 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderConfirmationPage/createAccount.js +213 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderConfirmationPage/createAccount.module.css +24 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderConfirmationPage/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderConfirmationPage/orderConfirmationPage.js +162 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderConfirmationPage/orderConfirmationPage.module.css +70 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderSummary/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderSummary/orderSummary.js +34 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderSummary/orderSummary.module.css +17 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/brainTreeDropIn.js +196 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/braintreeDropin.module.css +26 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/braintreeSummary.js +160 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/braintreeSummary.module.css +62 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/creditCard.js +348 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/creditCard.module.css +58 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/editCard.js +44 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/editCard.module.css +5 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/editModal.js +88 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/editablePaymentCollection.js +23 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/paymentInformation.js +99 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/paymentInformation.module.css +23 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/paymentMethodCollection.js +23 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/paymentMethods.js +121 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/paymentMethods.module.css +34 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/summary.js +71 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/summary.module.css +23 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/summaryPaymentCollection.js +23 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PriceAdjustments/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PriceAdjustments/priceAdjustments.js +63 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PriceAdjustments/priceAdjustments.module.css +2 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/AddressForm/addressForm.js +18 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/AddressForm/customerForm.js +401 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/AddressForm/customerForm.module.css +58 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/AddressForm/guestForm.js +455 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/AddressForm/guestForm.module.css +52 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/AddressForm/index.js +3 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/card.js +66 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/card.module.css +12 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/editModal.js +65 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/editModal.module.css +90 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/shippingInformation.js +149 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingInformation/shippingInformation.module.css +88 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/completedView.js +114 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/completedView.module.css +48 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/shippingMethod.js +154 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/shippingMethod.module.css +27 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/shippingRadios.js +80 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/shippingRadios.module.css +22 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/updateModal.js +85 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/updateModal.module.css +3 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/checkoutPage.js +472 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/checkoutPage.module.css +186 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CreateAccount/createAccount.js +323 -0
- package/src/overwrites/venia-ui/lib/components/CreateAccount/createAccount.module.css +52 -0
- package/src/overwrites/venia-ui/lib/components/CreateAccount/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CreateAccountPage/createAccountPage.js +48 -0
- package/src/overwrites/venia-ui/lib/components/CreateAccountPage/createAccountPage.module.css +21 -0
- package/src/overwrites/venia-ui/lib/components/CreateAccountPage/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/Dialog/dialog.js +198 -0
- package/src/overwrites/venia-ui/lib/components/Dialog/dialog.module.css +189 -0
- package/src/overwrites/venia-ui/lib/components/Dialog/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/FilterSidebar/filterSidebar.js +8 -7
- package/src/overwrites/venia-ui/lib/components/Gallery/item.js +12 -4
- package/src/overwrites/venia-ui/lib/components/Gallery/item.module.css +2 -2
- package/src/overwrites/venia-ui/lib/components/Header/header.js +37 -2
- package/src/overwrites/venia-ui/lib/components/Main/main.js +1 -1
- package/src/overwrites/venia-ui/lib/components/MegaMenu/shopByColumn.js +3 -2
- package/src/overwrites/venia-ui/lib/components/MegaMenu/submenu.js +1 -1
- package/src/overwrites/venia-ui/lib/components/MyAccount/ResetPassword/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/MyAccount/ResetPassword/resetPassword.gql.js +22 -0
- package/src/overwrites/venia-ui/lib/components/MyAccount/ResetPassword/resetPassword.js +143 -0
- package/src/overwrites/venia-ui/lib/components/MyAccount/ResetPassword/resetPassword.module.css +53 -0
- package/src/overwrites/venia-ui/lib/components/MyAccount/accountLink.js +42 -0
- package/src/overwrites/venia-ui/lib/components/MyAccount/accountLink.module.css +33 -0
- package/src/overwrites/venia-ui/lib/components/MyAccount/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/MyAccount/myAccount.js +38 -0
- package/src/overwrites/venia-ui/lib/components/MyAccount/myAccount.module.css +5 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/billingInformation.js +71 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/billingInformation.module.css +9 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/item.js +121 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/item.module.css +35 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/items.js +70 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/items.module.css +16 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/orderDetails.js +207 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/orderDetails.module.css +102 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/orderTotal.js +159 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/orderTotal.module.css +50 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/paymentMethod.js +45 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/paymentMethod.module.css +14 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/shippingInformation.js +90 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/shippingInformation.module.css +9 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/shippingMethod.js +86 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/OrderDetails/shippingMethod.module.css +19 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/collapsedImageGallery.js +63 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/collapsedImageGallery.module.css +16 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/index.js +15 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderHistoryPage.js +227 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderHistoryPage.module.css +70 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderProgressBar.js +70 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderProgressBar.module.css +14 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderRow.js +324 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderRow.module.css +146 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/resetButton.js +41 -0
- package/src/overwrites/venia-ui/lib/components/Password/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/Password/password.js +102 -0
- package/src/overwrites/venia-ui/lib/components/Password/password.module.css +26 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/productFullDetail.js +29 -14
- package/src/overwrites/venia-ui/lib/components/Select/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/Select/option.js +28 -0
- package/src/overwrites/venia-ui/lib/components/Select/select.js +74 -0
- package/src/overwrites/venia-ui/lib/components/Select/select.module.css +25 -0
- package/src/overwrites/venia-ui/lib/components/SignIn/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/SignIn/signIn.gql.js +50 -0
- package/src/overwrites/venia-ui/lib/components/SignIn/signIn.js +224 -0
- package/src/overwrites/venia-ui/lib/components/SignIn/signIn.module.css +65 -0
- package/src/overwrites/venia-ui/lib/components/SignInPage/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/SignInPage/signInPage.js +50 -0
- package/src/overwrites/venia-ui/lib/components/SignInPage/signInPage.module.css +17 -0
- package/src/overwrites/venia-ui/lib/components/TextInput/textInput.js +1 -1
- package/src/talons/Header/logo.gql.js +19 -0
- package/src/talons/Header/useLogo.js +19 -0
- package/src/talons/ShopBy/shopBy.gql.js +2 -2
- package/src/talons/ShopBy/useShopBy.js +10 -9
- package/src/talons/ShopByVehicles/shopByVehicles.gql.js +1 -0
- package/src/talons/TrainsSets/trainsSets.gql.js +60 -0
- package/src/talons/TrainsSets/useTrainsSets.js +223 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
|
+
import { arrayOf, bool, number, shape, string } from 'prop-types';
|
|
4
|
+
|
|
5
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
6
|
+
import RadioGroup from '@magento/venia-ui/lib/components/RadioGroup';
|
|
7
|
+
import ShippingRadio from '@magento/venia-ui/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingRadio';
|
|
8
|
+
import defaultClasses from './shippingRadios.module.css';
|
|
9
|
+
|
|
10
|
+
const ShippingRadios = props => {
|
|
11
|
+
const { disabled, shippingMethods } = props;
|
|
12
|
+
const { formatMessage } = useIntl();
|
|
13
|
+
|
|
14
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
15
|
+
|
|
16
|
+
const ERROR_MESSAGE = formatMessage({
|
|
17
|
+
id: 'shippingRadios.errorLoading',
|
|
18
|
+
defaultMessage:
|
|
19
|
+
'Error loading shipping methods. Please ensure a shipping address is set and try again.'
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
if (!shippingMethods.length) {
|
|
23
|
+
return <span className={classes.error}>{ERROR_MESSAGE}</span>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const radioGroupClasses = {
|
|
27
|
+
message: classes.radioMessage,
|
|
28
|
+
radioLabel: classes.radioLabel,
|
|
29
|
+
root: classes.radioRoot
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const shippingRadios = shippingMethods.map(method => {
|
|
33
|
+
const label = (
|
|
34
|
+
<ShippingRadio
|
|
35
|
+
currency={method.amount.currency}
|
|
36
|
+
name={method.method_title}
|
|
37
|
+
price={method.amount.value}
|
|
38
|
+
/>
|
|
39
|
+
);
|
|
40
|
+
const value = method.serializedValue;
|
|
41
|
+
|
|
42
|
+
return { label, value };
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<RadioGroup
|
|
47
|
+
classes={radioGroupClasses}
|
|
48
|
+
disabled={disabled}
|
|
49
|
+
field="shipping_method"
|
|
50
|
+
id={'shippingMethod'}
|
|
51
|
+
items={shippingRadios}
|
|
52
|
+
/>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export default ShippingRadios;
|
|
57
|
+
|
|
58
|
+
ShippingRadios.propTypes = {
|
|
59
|
+
classes: shape({
|
|
60
|
+
error: string,
|
|
61
|
+
radioMessage: string,
|
|
62
|
+
radioLabel: string,
|
|
63
|
+
radioRoot: string
|
|
64
|
+
}),
|
|
65
|
+
disabled: bool,
|
|
66
|
+
shippingMethods: arrayOf(
|
|
67
|
+
shape({
|
|
68
|
+
amount: shape({
|
|
69
|
+
currency: string,
|
|
70
|
+
value: number
|
|
71
|
+
}),
|
|
72
|
+
available: bool,
|
|
73
|
+
carrier_code: string,
|
|
74
|
+
carrier_title: string,
|
|
75
|
+
method_code: string,
|
|
76
|
+
method_title: string,
|
|
77
|
+
serializedValue: string.isRequired
|
|
78
|
+
})
|
|
79
|
+
).isRequired
|
|
80
|
+
};
|
package/src/overwrites/venia-ui/lib/components/CheckoutPage/ShippingMethod/shippingRadios.module.css
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.radioRoot {
|
|
2
|
+
composes: gap-2xs from global;
|
|
3
|
+
composes: grid from global;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.radioLabel {
|
|
7
|
+
composes: gap-2xs from global;
|
|
8
|
+
composes: grid from global;
|
|
9
|
+
composes: grid-cols-[100%] from global;
|
|
10
|
+
composes: justify-start from global;
|
|
11
|
+
|
|
12
|
+
composes: sm_grid-cols-autoAuto from global;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.radioMessage {
|
|
16
|
+
composes: hidden from global;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.error {
|
|
20
|
+
composes: leading-normal from global;
|
|
21
|
+
composes: text-error from global;
|
|
22
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
|
+
import { arrayOf, bool, func, number, object, shape, string } from 'prop-types';
|
|
4
|
+
|
|
5
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
6
|
+
import Dialog from '@magento/venia-ui/lib/components/Dialog';
|
|
7
|
+
import FormError from '@magento/venia-ui/lib/components/FormError';
|
|
8
|
+
import ShippingRadios from './shippingRadios';
|
|
9
|
+
import defaultClasses from './updateModal.module.css';
|
|
10
|
+
|
|
11
|
+
const UpdateModal = props => {
|
|
12
|
+
const {
|
|
13
|
+
classes: propClasses,
|
|
14
|
+
formErrors,
|
|
15
|
+
formInitialValues,
|
|
16
|
+
handleCancel,
|
|
17
|
+
handleSubmit,
|
|
18
|
+
isLoading,
|
|
19
|
+
isOpen,
|
|
20
|
+
pageIsUpdating,
|
|
21
|
+
shippingMethods
|
|
22
|
+
} = props;
|
|
23
|
+
const { formatMessage } = useIntl();
|
|
24
|
+
|
|
25
|
+
const dialogButtonsDisabled = pageIsUpdating;
|
|
26
|
+
const dialogSubmitButtonDisabled = isLoading;
|
|
27
|
+
const dialogFormProps = {
|
|
28
|
+
initialValues: formInitialValues
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const classes = useStyle(defaultClasses, propClasses);
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<Dialog
|
|
35
|
+
confirmText={'Update'}
|
|
36
|
+
confirmTranslationId={'global.updateButton'}
|
|
37
|
+
formProps={dialogFormProps}
|
|
38
|
+
isOpen={isOpen}
|
|
39
|
+
onCancel={handleCancel}
|
|
40
|
+
onConfirm={handleSubmit}
|
|
41
|
+
shouldDisableAllButtons={dialogButtonsDisabled}
|
|
42
|
+
shouldDisableConfirmButton={dialogSubmitButtonDisabled}
|
|
43
|
+
shouldUnmountOnHide={false}
|
|
44
|
+
title={formatMessage({
|
|
45
|
+
id: 'checkoutPage.editShippingMethod',
|
|
46
|
+
defaultMessage: 'Edit Shipping Method'
|
|
47
|
+
})}
|
|
48
|
+
data-cy="ShippingMethod-updateModal"
|
|
49
|
+
>
|
|
50
|
+
<FormError
|
|
51
|
+
classes={{ root: classes.errorContainer }}
|
|
52
|
+
errors={formErrors}
|
|
53
|
+
/>
|
|
54
|
+
<ShippingRadios
|
|
55
|
+
disabled={dialogButtonsDisabled}
|
|
56
|
+
shippingMethods={shippingMethods}
|
|
57
|
+
/>
|
|
58
|
+
</Dialog>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export default UpdateModal;
|
|
63
|
+
|
|
64
|
+
UpdateModal.propTypes = {
|
|
65
|
+
formInitialValues: object,
|
|
66
|
+
handleCancel: func,
|
|
67
|
+
handleSubmit: func,
|
|
68
|
+
isLoading: bool,
|
|
69
|
+
isOpen: bool,
|
|
70
|
+
pageIsUpdating: bool,
|
|
71
|
+
shippingMethods: arrayOf(
|
|
72
|
+
shape({
|
|
73
|
+
amount: shape({
|
|
74
|
+
currency: string,
|
|
75
|
+
value: number
|
|
76
|
+
}),
|
|
77
|
+
available: bool,
|
|
78
|
+
carrier_code: string,
|
|
79
|
+
carrier_title: string,
|
|
80
|
+
method_code: string,
|
|
81
|
+
method_title: string,
|
|
82
|
+
serializedValue: string.isRequired
|
|
83
|
+
})
|
|
84
|
+
)
|
|
85
|
+
};
|
|
@@ -0,0 +1,472 @@
|
|
|
1
|
+
import React, { Fragment, useEffect } from 'react';
|
|
2
|
+
import { shape, string } from 'prop-types';
|
|
3
|
+
import { FormattedMessage, useIntl } from 'react-intl';
|
|
4
|
+
import { AlertCircle as AlertCircleIcon } from 'react-feather';
|
|
5
|
+
import { Link } from 'react-router-dom';
|
|
6
|
+
|
|
7
|
+
import { useWindowSize, useToasts } from '@magento/peregrine';
|
|
8
|
+
import {
|
|
9
|
+
CHECKOUT_STEP,
|
|
10
|
+
useCheckoutPage
|
|
11
|
+
} from '@magento/peregrine/lib/talons/CheckoutPage/useCheckoutPage';
|
|
12
|
+
|
|
13
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
14
|
+
import Button from '@magento/venia-ui/lib/components/Button';
|
|
15
|
+
import { StoreTitle } from '@magento/venia-ui/lib/components/Head';
|
|
16
|
+
import Icon from '@magento/venia-ui/lib/components/Icon';
|
|
17
|
+
import { fullPageLoadingIndicator } from '@magento/venia-ui/lib/components/LoadingIndicator';
|
|
18
|
+
import StockStatusMessage from '@magento/venia-ui/lib/components/StockStatusMessage';
|
|
19
|
+
import FormError from '@magento/venia-ui/lib/components/FormError';
|
|
20
|
+
import AddressBook from './AddressBook';
|
|
21
|
+
import GuestSignIn from './GuestSignIn';
|
|
22
|
+
import OrderSummary from './OrderSummary';
|
|
23
|
+
import PaymentInformation from './PaymentInformation';
|
|
24
|
+
import payments from './PaymentInformation/paymentMethodCollection';
|
|
25
|
+
import PriceAdjustments from './PriceAdjustments';
|
|
26
|
+
import ShippingMethod from './ShippingMethod';
|
|
27
|
+
import ShippingInformation from './ShippingInformation';
|
|
28
|
+
import OrderConfirmationPage from './OrderConfirmationPage';
|
|
29
|
+
import ItemsReview from './ItemsReview';
|
|
30
|
+
import GoogleReCaptcha from '@magento/venia-ui/lib/components/GoogleReCaptcha';
|
|
31
|
+
|
|
32
|
+
import defaultClasses from './checkoutPage.module.css';
|
|
33
|
+
import ScrollAnchor from '@magento/venia-ui/lib/components/ScrollAnchor/scrollAnchor';
|
|
34
|
+
|
|
35
|
+
const errorIcon = <Icon src={AlertCircleIcon} size={20} />;
|
|
36
|
+
|
|
37
|
+
const CheckoutPage = props => {
|
|
38
|
+
const { classes: propClasses } = props;
|
|
39
|
+
const { formatMessage } = useIntl();
|
|
40
|
+
const talonProps = useCheckoutPage();
|
|
41
|
+
|
|
42
|
+
const {
|
|
43
|
+
/**
|
|
44
|
+
* Enum, one of:
|
|
45
|
+
* SHIPPING_ADDRESS, SHIPPING_METHOD, PAYMENT, REVIEW
|
|
46
|
+
*/
|
|
47
|
+
activeContent,
|
|
48
|
+
availablePaymentMethods,
|
|
49
|
+
cartItems,
|
|
50
|
+
checkoutStep,
|
|
51
|
+
customer,
|
|
52
|
+
error,
|
|
53
|
+
guestSignInUsername,
|
|
54
|
+
handlePlaceOrder,
|
|
55
|
+
handlePlaceOrderEnterKeyPress,
|
|
56
|
+
hasError,
|
|
57
|
+
isCartEmpty,
|
|
58
|
+
isGuestCheckout,
|
|
59
|
+
isLoading,
|
|
60
|
+
isUpdating,
|
|
61
|
+
orderDetailsData,
|
|
62
|
+
orderDetailsLoading,
|
|
63
|
+
orderNumber,
|
|
64
|
+
placeOrderLoading,
|
|
65
|
+
placeOrderButtonClicked,
|
|
66
|
+
setCheckoutStep,
|
|
67
|
+
setGuestSignInUsername,
|
|
68
|
+
setIsUpdating,
|
|
69
|
+
setShippingInformationDone,
|
|
70
|
+
scrollShippingInformationIntoView,
|
|
71
|
+
setShippingMethodDone,
|
|
72
|
+
scrollShippingMethodIntoView,
|
|
73
|
+
setPaymentInformationDone,
|
|
74
|
+
shippingInformationRef,
|
|
75
|
+
shippingMethodRef,
|
|
76
|
+
resetReviewOrderButtonClicked,
|
|
77
|
+
handleReviewOrder,
|
|
78
|
+
handleReviewOrderEnterKeyPress,
|
|
79
|
+
reviewOrderButtonClicked,
|
|
80
|
+
recaptchaWidgetProps,
|
|
81
|
+
toggleAddressBookContent,
|
|
82
|
+
toggleSignInContent
|
|
83
|
+
} = talonProps;
|
|
84
|
+
|
|
85
|
+
const [, { addToast }] = useToasts();
|
|
86
|
+
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
if (hasError) {
|
|
89
|
+
const message =
|
|
90
|
+
error && error.message
|
|
91
|
+
? error.message
|
|
92
|
+
: formatMessage({
|
|
93
|
+
id: 'checkoutPage.errorSubmit',
|
|
94
|
+
defaultMessage:
|
|
95
|
+
'Oops! An error occurred while submitting. Please try again.'
|
|
96
|
+
});
|
|
97
|
+
addToast({
|
|
98
|
+
type: 'error',
|
|
99
|
+
icon: errorIcon,
|
|
100
|
+
message,
|
|
101
|
+
dismissable: true,
|
|
102
|
+
timeout: 7000
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
106
|
+
console.error(error);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}, [addToast, error, formatMessage, hasError]);
|
|
110
|
+
|
|
111
|
+
const classes = useStyle(defaultClasses, propClasses);
|
|
112
|
+
|
|
113
|
+
const windowSize = useWindowSize();
|
|
114
|
+
const isMobile = windowSize.innerWidth <= 960;
|
|
115
|
+
|
|
116
|
+
let checkoutContent;
|
|
117
|
+
|
|
118
|
+
const heading = isGuestCheckout
|
|
119
|
+
? formatMessage({
|
|
120
|
+
id: 'checkoutPage.guestCheckout',
|
|
121
|
+
defaultMessage: 'Guest Checkout'
|
|
122
|
+
})
|
|
123
|
+
: formatMessage({
|
|
124
|
+
id: 'checkoutPage.checkout',
|
|
125
|
+
defaultMessage: 'Checkout'
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
if (orderNumber && orderDetailsData) {
|
|
129
|
+
return (
|
|
130
|
+
<OrderConfirmationPage
|
|
131
|
+
data={orderDetailsData}
|
|
132
|
+
orderNumber={orderNumber}
|
|
133
|
+
/>
|
|
134
|
+
);
|
|
135
|
+
} else if (isLoading) {
|
|
136
|
+
return fullPageLoadingIndicator;
|
|
137
|
+
} else if (isCartEmpty) {
|
|
138
|
+
checkoutContent = (
|
|
139
|
+
<div className={classes.empty_cart_container}>
|
|
140
|
+
<div className={classes.heading_container}>
|
|
141
|
+
<h1
|
|
142
|
+
aria-live="polite"
|
|
143
|
+
className={classes.heading}
|
|
144
|
+
data-cy="ChekoutPage-heading"
|
|
145
|
+
>
|
|
146
|
+
{heading}
|
|
147
|
+
</h1>
|
|
148
|
+
</div>
|
|
149
|
+
<h3>
|
|
150
|
+
<FormattedMessage
|
|
151
|
+
id={'checkoutPage.emptyMessage'}
|
|
152
|
+
defaultMessage={'There are no items in your cart.'}
|
|
153
|
+
/>
|
|
154
|
+
</h3>
|
|
155
|
+
</div>
|
|
156
|
+
);
|
|
157
|
+
} else {
|
|
158
|
+
const signInContainerVisible =
|
|
159
|
+
isGuestCheckout && checkoutStep !== CHECKOUT_STEP.REVIEW;
|
|
160
|
+
const signInContainerElement = signInContainerVisible ? (
|
|
161
|
+
<div className={classes.signInContainer}>
|
|
162
|
+
<span className={classes.signInLabel}>
|
|
163
|
+
<FormattedMessage
|
|
164
|
+
id={'checkoutPage.signInLabel'}
|
|
165
|
+
defaultMessage={'Sign in for Express Checkout'}
|
|
166
|
+
/>
|
|
167
|
+
</span>
|
|
168
|
+
<Button
|
|
169
|
+
className={classes.signInButton}
|
|
170
|
+
data-cy="CheckoutPage-signInButton"
|
|
171
|
+
onClick={toggleSignInContent}
|
|
172
|
+
priority="low"
|
|
173
|
+
classes={{
|
|
174
|
+
content: 'capitalize font-medium'
|
|
175
|
+
}}
|
|
176
|
+
>
|
|
177
|
+
<FormattedMessage
|
|
178
|
+
id={'checkoutPage.signInButton'}
|
|
179
|
+
defaultMessage={'Sign In'}
|
|
180
|
+
/>
|
|
181
|
+
</Button>
|
|
182
|
+
</div>
|
|
183
|
+
) : null;
|
|
184
|
+
|
|
185
|
+
const shippingMethodSection =
|
|
186
|
+
checkoutStep >= CHECKOUT_STEP.SHIPPING_METHOD ? (
|
|
187
|
+
<ShippingMethod
|
|
188
|
+
pageIsUpdating={isUpdating}
|
|
189
|
+
onSave={setShippingMethodDone}
|
|
190
|
+
onSuccess={scrollShippingMethodIntoView}
|
|
191
|
+
setPageIsUpdating={setIsUpdating}
|
|
192
|
+
/>
|
|
193
|
+
) : (
|
|
194
|
+
<h3 className={classes.shipping_method_heading}>
|
|
195
|
+
<FormattedMessage
|
|
196
|
+
id={'checkoutPage.shippingMethodStep'}
|
|
197
|
+
defaultMessage={'2. Shipping Method'}
|
|
198
|
+
/>
|
|
199
|
+
</h3>
|
|
200
|
+
);
|
|
201
|
+
|
|
202
|
+
const formErrors = [];
|
|
203
|
+
const paymentMethods = Object.keys(payments);
|
|
204
|
+
|
|
205
|
+
// If we have an implementation, or if this is a "zero" checkout,
|
|
206
|
+
// we can allow checkout to proceed.
|
|
207
|
+
const isPaymentAvailable = !!availablePaymentMethods.find(
|
|
208
|
+
({ code }) => code === 'free' || paymentMethods.includes(code)
|
|
209
|
+
);
|
|
210
|
+
|
|
211
|
+
if (!isPaymentAvailable) {
|
|
212
|
+
formErrors.push(
|
|
213
|
+
new Error(
|
|
214
|
+
formatMessage({
|
|
215
|
+
id: 'checkoutPage.noPaymentAvailable',
|
|
216
|
+
defaultMessage: 'Payment is currently unavailable.'
|
|
217
|
+
})
|
|
218
|
+
)
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
const paymentInformationSection =
|
|
223
|
+
checkoutStep >= CHECKOUT_STEP.PAYMENT ? (
|
|
224
|
+
<PaymentInformation
|
|
225
|
+
onSave={setPaymentInformationDone}
|
|
226
|
+
checkoutError={error}
|
|
227
|
+
resetShouldSubmit={resetReviewOrderButtonClicked}
|
|
228
|
+
setCheckoutStep={setCheckoutStep}
|
|
229
|
+
shouldSubmit={reviewOrderButtonClicked}
|
|
230
|
+
/>
|
|
231
|
+
) : (
|
|
232
|
+
<h3 className={classes.payment_information_heading}>
|
|
233
|
+
<FormattedMessage
|
|
234
|
+
id={'checkoutPage.paymentInformationStep'}
|
|
235
|
+
defaultMessage={'3. Payment Information'}
|
|
236
|
+
/>
|
|
237
|
+
</h3>
|
|
238
|
+
);
|
|
239
|
+
|
|
240
|
+
const priceAdjustmentsSection =
|
|
241
|
+
checkoutStep === CHECKOUT_STEP.PAYMENT ? (
|
|
242
|
+
<div className={classes.price_adjustments_container}>
|
|
243
|
+
<PriceAdjustments setPageIsUpdating={setIsUpdating} />
|
|
244
|
+
</div>
|
|
245
|
+
) : null;
|
|
246
|
+
|
|
247
|
+
const reviewOrderButton =
|
|
248
|
+
checkoutStep === CHECKOUT_STEP.PAYMENT ? (
|
|
249
|
+
<Button
|
|
250
|
+
onClick={handleReviewOrder}
|
|
251
|
+
onKeyDown={handleReviewOrderEnterKeyPress}
|
|
252
|
+
priority="high"
|
|
253
|
+
className={classes.review_order_button}
|
|
254
|
+
data-cy="CheckoutPage-reviewOrderButton"
|
|
255
|
+
disabled={
|
|
256
|
+
reviewOrderButtonClicked ||
|
|
257
|
+
isUpdating ||
|
|
258
|
+
!isPaymentAvailable
|
|
259
|
+
}
|
|
260
|
+
>
|
|
261
|
+
<FormattedMessage
|
|
262
|
+
id={'checkoutPage.reviewOrder'}
|
|
263
|
+
defaultMessage={'Review Order'}
|
|
264
|
+
/>
|
|
265
|
+
</Button>
|
|
266
|
+
) : null;
|
|
267
|
+
|
|
268
|
+
const itemsReview =
|
|
269
|
+
checkoutStep === CHECKOUT_STEP.REVIEW ? (
|
|
270
|
+
<div className={classes.items_review_container}>
|
|
271
|
+
<ItemsReview />
|
|
272
|
+
</div>
|
|
273
|
+
) : null;
|
|
274
|
+
|
|
275
|
+
const placeOrderButton =
|
|
276
|
+
checkoutStep === CHECKOUT_STEP.REVIEW ? (
|
|
277
|
+
<Button
|
|
278
|
+
onClick={handlePlaceOrder}
|
|
279
|
+
onKeyDown={handlePlaceOrderEnterKeyPress}
|
|
280
|
+
priority="high"
|
|
281
|
+
className={classes.place_order_button}
|
|
282
|
+
data-cy="CheckoutPage-placeOrderButton"
|
|
283
|
+
disabled={
|
|
284
|
+
isUpdating ||
|
|
285
|
+
placeOrderLoading ||
|
|
286
|
+
orderDetailsLoading ||
|
|
287
|
+
placeOrderButtonClicked
|
|
288
|
+
}
|
|
289
|
+
>
|
|
290
|
+
<FormattedMessage
|
|
291
|
+
id={'checkoutPage.placeOrder'}
|
|
292
|
+
defaultMessage={'Place Order'}
|
|
293
|
+
/>
|
|
294
|
+
</Button>
|
|
295
|
+
) : null;
|
|
296
|
+
|
|
297
|
+
// If we're on mobile we should only render price summary in/after review.
|
|
298
|
+
const shouldRenderPriceSummary = !(
|
|
299
|
+
isMobile && checkoutStep < CHECKOUT_STEP.REVIEW
|
|
300
|
+
);
|
|
301
|
+
|
|
302
|
+
const orderSummary = (
|
|
303
|
+
<div
|
|
304
|
+
className={
|
|
305
|
+
classes.summaryContainer +
|
|
306
|
+
(signInContainerVisible
|
|
307
|
+
? ' ' + classes.signInContainerVisible
|
|
308
|
+
: '') +
|
|
309
|
+
(recaptchaWidgetProps.shouldRender
|
|
310
|
+
? ' ' + classes.reCaptchaMargin
|
|
311
|
+
: '')
|
|
312
|
+
}
|
|
313
|
+
>
|
|
314
|
+
<OrderSummary isUpdating={isUpdating} />
|
|
315
|
+
</div>
|
|
316
|
+
);
|
|
317
|
+
|
|
318
|
+
let headerText;
|
|
319
|
+
|
|
320
|
+
if (isGuestCheckout) {
|
|
321
|
+
headerText = formatMessage({
|
|
322
|
+
id: 'checkoutPage.guestCheckout',
|
|
323
|
+
defaultMessage: 'Guest Checkout'
|
|
324
|
+
});
|
|
325
|
+
} else if (customer.default_shipping) {
|
|
326
|
+
headerText = formatMessage({
|
|
327
|
+
id: 'checkoutPage.reviewAndPlaceOrder',
|
|
328
|
+
defaultMessage: 'Review and Place Order'
|
|
329
|
+
});
|
|
330
|
+
} else {
|
|
331
|
+
headerText = formatMessage(
|
|
332
|
+
{
|
|
333
|
+
id: 'checkoutPage.greeting',
|
|
334
|
+
defaultMessage: 'Welcome {firstname}!'
|
|
335
|
+
},
|
|
336
|
+
{ firstname: customer.firstname }
|
|
337
|
+
);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
const checkoutContentClass =
|
|
341
|
+
activeContent === 'checkout'
|
|
342
|
+
? classes.checkoutContent
|
|
343
|
+
: classes.checkoutContent_hidden;
|
|
344
|
+
|
|
345
|
+
const stockStatusMessageElement = (
|
|
346
|
+
<Fragment>
|
|
347
|
+
<FormattedMessage
|
|
348
|
+
id={'checkoutPage.stockStatusMessage'}
|
|
349
|
+
defaultMessage={
|
|
350
|
+
'An item in your cart is currently out-of-stock and must be removed in order to Checkout. Please return to your cart to remove the item.'
|
|
351
|
+
}
|
|
352
|
+
/>
|
|
353
|
+
<Link className={classes.cartLink} to={'/cart'}>
|
|
354
|
+
<FormattedMessage
|
|
355
|
+
id={'checkoutPage.returnToCart'}
|
|
356
|
+
defaultMessage={'Return to Cart'}
|
|
357
|
+
/>
|
|
358
|
+
</Link>
|
|
359
|
+
</Fragment>
|
|
360
|
+
);
|
|
361
|
+
checkoutContent = (
|
|
362
|
+
<div className={checkoutContentClass}>
|
|
363
|
+
<div className={classes.heading_container}>
|
|
364
|
+
<FormError
|
|
365
|
+
classes={{
|
|
366
|
+
root: classes.formErrors
|
|
367
|
+
}}
|
|
368
|
+
errors={formErrors}
|
|
369
|
+
/>
|
|
370
|
+
<StockStatusMessage
|
|
371
|
+
cartItems={cartItems}
|
|
372
|
+
message={stockStatusMessageElement}
|
|
373
|
+
/>
|
|
374
|
+
<h1
|
|
375
|
+
className={classes.heading}
|
|
376
|
+
data-cy="ChekoutPage-headerText"
|
|
377
|
+
>
|
|
378
|
+
{headerText}
|
|
379
|
+
</h1>
|
|
380
|
+
</div>
|
|
381
|
+
{signInContainerElement}
|
|
382
|
+
<div className={classes.shipping_information_container}>
|
|
383
|
+
<ScrollAnchor ref={shippingInformationRef}>
|
|
384
|
+
<ShippingInformation
|
|
385
|
+
onSave={setShippingInformationDone}
|
|
386
|
+
onSuccess={scrollShippingInformationIntoView}
|
|
387
|
+
toggleActiveContent={toggleAddressBookContent}
|
|
388
|
+
toggleSignInContent={toggleSignInContent}
|
|
389
|
+
setGuestSignInUsername={setGuestSignInUsername}
|
|
390
|
+
/>
|
|
391
|
+
</ScrollAnchor>
|
|
392
|
+
</div>
|
|
393
|
+
<div className={classes.shipping_method_container}>
|
|
394
|
+
<ScrollAnchor ref={shippingMethodRef}>
|
|
395
|
+
{shippingMethodSection}
|
|
396
|
+
</ScrollAnchor>
|
|
397
|
+
</div>
|
|
398
|
+
<div className={classes.payment_information_container}>
|
|
399
|
+
{paymentInformationSection}
|
|
400
|
+
</div>
|
|
401
|
+
{priceAdjustmentsSection}
|
|
402
|
+
{reviewOrderButton}
|
|
403
|
+
{itemsReview}
|
|
404
|
+
{orderSummary}
|
|
405
|
+
{placeOrderButton}
|
|
406
|
+
<GoogleReCaptcha {...recaptchaWidgetProps} />
|
|
407
|
+
</div>
|
|
408
|
+
);
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
const addressBookElement = !isGuestCheckout ? (
|
|
412
|
+
<AddressBook
|
|
413
|
+
activeContent={activeContent}
|
|
414
|
+
toggleActiveContent={toggleAddressBookContent}
|
|
415
|
+
onSuccess={scrollShippingInformationIntoView}
|
|
416
|
+
/>
|
|
417
|
+
) : null;
|
|
418
|
+
|
|
419
|
+
const signInElement = isGuestCheckout ? (
|
|
420
|
+
<GuestSignIn
|
|
421
|
+
key={guestSignInUsername}
|
|
422
|
+
isActive={activeContent === 'signIn'}
|
|
423
|
+
toggleActiveContent={toggleSignInContent}
|
|
424
|
+
initialValues={{ email: guestSignInUsername }}
|
|
425
|
+
/>
|
|
426
|
+
) : null;
|
|
427
|
+
|
|
428
|
+
return (
|
|
429
|
+
<div className={classes.root} data-cy="CheckoutPage-root">
|
|
430
|
+
<StoreTitle>
|
|
431
|
+
{formatMessage({
|
|
432
|
+
id: 'checkoutPage.titleCheckout',
|
|
433
|
+
defaultMessage: 'Checkout'
|
|
434
|
+
})}
|
|
435
|
+
</StoreTitle>
|
|
436
|
+
{checkoutContent}
|
|
437
|
+
{addressBookElement}
|
|
438
|
+
{signInElement}
|
|
439
|
+
</div>
|
|
440
|
+
);
|
|
441
|
+
};
|
|
442
|
+
|
|
443
|
+
export default CheckoutPage;
|
|
444
|
+
|
|
445
|
+
CheckoutPage.propTypes = {
|
|
446
|
+
classes: shape({
|
|
447
|
+
root: string,
|
|
448
|
+
checkoutContent: string,
|
|
449
|
+
checkoutContent_hidden: string,
|
|
450
|
+
heading_container: string,
|
|
451
|
+
heading: string,
|
|
452
|
+
cartLink: string,
|
|
453
|
+
stepper_heading: string,
|
|
454
|
+
shipping_method_heading: string,
|
|
455
|
+
payment_information_heading: string,
|
|
456
|
+
signInContainer: string,
|
|
457
|
+
signInLabel: string,
|
|
458
|
+
signInButton: string,
|
|
459
|
+
empty_cart_container: string,
|
|
460
|
+
shipping_information_container: string,
|
|
461
|
+
shipping_method_container: string,
|
|
462
|
+
payment_information_container: string,
|
|
463
|
+
price_adjustments_container: string,
|
|
464
|
+
items_review_container: string,
|
|
465
|
+
summaryContainer: string,
|
|
466
|
+
formErrors: string,
|
|
467
|
+
review_order_button: string,
|
|
468
|
+
place_order_button: string,
|
|
469
|
+
signInContainerVisible: string,
|
|
470
|
+
reCaptchaMargin: string
|
|
471
|
+
})
|
|
472
|
+
};
|