@magento/venia-ui 9.1.0-alpha.1 → 9.2.0-alpha.2
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 +22 -7
- package/lib/RootComponents/CMS/__tests__/cms.spec.js +50 -20
- package/lib/RootComponents/CMS/cms.js +39 -43
- package/lib/RootComponents/CMS/cms.module.css +17 -14
- package/lib/RootComponents/Category/NoProductsFound/noProductsFound.js +1 -1
- package/lib/RootComponents/Category/__tests__/__snapshots__/category.spec.js.snap +2 -2
- package/lib/RootComponents/Category/__tests__/__snapshots__/categoryContent.spec.js.snap +60 -0
- package/lib/RootComponents/Category/__tests__/category.spec.js +1 -1
- package/lib/RootComponents/Category/__tests__/categoryContent.spec.js +8 -0
- package/lib/RootComponents/Category/category.gql.js +2 -1
- package/lib/RootComponents/Category/category.js +6 -6
- package/lib/RootComponents/Category/categoryContent.js +11 -4
- package/lib/components/Accordion/section.js +6 -2
- package/lib/components/AccountChip/accountChip.gql.js +1 -1
- package/lib/components/AccountInformationPage/accountInformationPage.gql.js +5 -7
- package/lib/components/AccountInformationPage/accountInformationPage.js +5 -1
- package/lib/components/AccountInformationPage/editForm.js +22 -4
- package/lib/components/AccountMenu/accountMenu.js +1 -1
- package/lib/components/AccountMenu/accountMenuItems.js +2 -1
- package/lib/components/AddressBookPage/__tests__/__snapshots__/addressCard.spec.js.snap +5 -0
- package/lib/components/AddressBookPage/addEditDialog.js +36 -10
- package/lib/components/AddressBookPage/addressBookPage.js +5 -2
- package/lib/components/AddressBookPage/addressCard.js +17 -4
- package/lib/components/App/app.js +5 -1
- package/lib/components/App/localeProvider.js +2 -1
- package/lib/components/Breadcrumbs/breadcrumbs.js +3 -3
- package/lib/components/Breadcrumbs/breadcrumbs.module.css +10 -3
- package/lib/components/CartPage/GiftCards/giftCard.js +1 -0
- package/lib/components/CartPage/GiftCards/giftCards.js +2 -0
- package/lib/components/CartPage/PriceAdjustments/CouponCode/couponCode.js +3 -0
- package/lib/components/CartPage/PriceAdjustments/GiftOptions/giftOptions.js +3 -0
- package/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingForm.js +10 -2
- package/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingMethods.js +2 -1
- package/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingRadio.js +1 -1
- package/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingRadios.js +1 -1
- package/lib/components/CartPage/PriceAdjustments/giftCardSection.ee.js +1 -0
- package/lib/components/CartPage/PriceAdjustments/priceAdjustments.js +4 -1
- package/lib/components/CartPage/PriceSummary/discountSummary.js +8 -2
- package/lib/components/CartPage/PriceSummary/giftCardSummary.ee.js +4 -1
- package/lib/components/CartPage/PriceSummary/priceSummary.js +10 -3
- package/lib/components/CartPage/PriceSummary/shippingSummary.js +6 -1
- package/lib/components/CartPage/PriceSummary/taxSummary.js +1 -1
- package/lib/components/CartPage/ProductListing/EditModal/__tests__/__snapshots__/productDetail.spec.js.snap +3 -3
- package/lib/components/CartPage/ProductListing/EditModal/__tests__/__snapshots__/productForm.spec.js.snap +2 -2
- package/lib/components/CartPage/ProductListing/EditModal/productDetail.js +1 -1
- package/lib/components/CartPage/ProductListing/__tests__/__snapshots__/errorMessage.spec.js.snap +11 -0
- package/lib/components/CartPage/ProductListing/__tests__/errorMessage.spec.js +20 -0
- package/lib/components/CartPage/ProductListing/__tests__/product.spec.js +1 -0
- package/lib/components/CartPage/ProductListing/errorMessage.js +31 -0
- package/lib/components/CartPage/ProductListing/errorMessage.module.css +9 -0
- package/lib/components/CartPage/ProductListing/product.js +14 -7
- package/lib/components/CartPage/ProductListing/productListing.js +6 -1
- package/lib/components/CartPage/ProductListing/productListing.module.css +6 -0
- package/lib/components/CartPage/ProductListing/quantity.js +3 -0
- package/lib/components/CartPage/cartPage.js +1 -1
- package/lib/components/CategoryList/__tests__/categoryList.spec.js +2 -0
- package/lib/components/CategoryList/categoryList.js +4 -2
- package/lib/components/CategoryList/categoryList.module.css +2 -0
- package/lib/components/CategoryList/categoryTile.js +2 -0
- package/lib/components/CategoryList/categoryTile.module.css +2 -0
- package/lib/components/CategoryList/index.js +2 -0
- package/lib/components/CategoryTree/categoryBranch.js +2 -1
- package/lib/components/CategoryTree/categoryLeaf.js +1 -0
- package/lib/components/CategoryTree/categoryTree.js +3 -3
- package/lib/components/Checkbox/checkbox.module.css +11 -3
- package/lib/components/Checkout/addressForm.js +2 -3
- package/lib/components/CheckoutPage/GuestSignIn/guestSignIn.js +6 -2
- package/lib/components/CheckoutPage/ItemsReview/__fixtures__/cartItems.js +12 -12
- package/lib/components/CheckoutPage/ItemsReview/__tests__/__snapshots__/item.spec.js.snap +2 -2
- package/lib/components/CheckoutPage/ItemsReview/__tests__/__snapshots__/itemsReview.spec.js.snap +3 -3
- package/lib/components/CheckoutPage/ItemsReview/item.js +1 -1
- package/lib/components/CheckoutPage/ItemsReview/itemsReview.js +4 -1
- package/lib/components/CheckoutPage/OrderConfirmationPage/__tests__/__snapshots__/orderConfirmationPage.spec.js.snap +1 -1
- package/lib/components/CheckoutPage/OrderConfirmationPage/createAccount.js +6 -0
- package/lib/components/CheckoutPage/OrderConfirmationPage/orderConfirmationPage.js +10 -4
- package/lib/components/CheckoutPage/OrderSummary/orderSummary.js +1 -1
- package/lib/components/CheckoutPage/PaymentInformation/braintreeSummary.js +2 -1
- package/lib/components/CheckoutPage/PaymentInformation/creditCard.js +11 -1
- package/lib/components/CheckoutPage/PaymentInformation/editCard.js +1 -1
- package/lib/components/CheckoutPage/PaymentInformation/editModal.js +1 -1
- package/lib/components/CheckoutPage/PaymentInformation/paymentInformation.js +1 -1
- package/lib/components/CheckoutPage/ShippingInformation/AddressForm/__tests__/__snapshots__/guestForm.spec.js.snap +8 -0
- package/lib/components/CheckoutPage/ShippingInformation/AddressForm/__tests__/guestForm.spec.js +56 -1
- package/lib/components/CheckoutPage/ShippingInformation/AddressForm/customerForm.js +27 -4
- package/lib/components/CheckoutPage/ShippingInformation/AddressForm/guestForm.js +96 -9
- package/lib/components/CheckoutPage/ShippingInformation/card.js +1 -1
- package/lib/components/CheckoutPage/ShippingInformation/shippingInformation.js +14 -3
- package/lib/components/CheckoutPage/ShippingMethod/completedView.js +1 -0
- package/lib/components/CheckoutPage/ShippingMethod/shippingMethod.js +2 -1
- package/lib/components/CheckoutPage/ShippingMethod/updateModal.js +1 -0
- package/lib/components/CheckoutPage/__tests__/__snapshots__/checkoutPage.spec.js.snap +32 -0
- package/lib/components/CheckoutPage/__tests__/checkoutPage.spec.js +2 -0
- package/lib/components/CheckoutPage/checkoutPage.js +26 -4
- package/lib/components/ContactPage/__tests__/__snapshots__/contactLink.spec.js.snap +11 -0
- package/lib/components/ContactPage/__tests__/__snapshots__/contactPage.shimmer.spec.js.snap +113 -0
- package/lib/components/ContactPage/__tests__/__snapshots__/contactPage.spec.js.snap +312 -0
- package/lib/components/ContactPage/__tests__/contactLink.spec.js +58 -0
- package/lib/components/ContactPage/__tests__/contactPage.shimmer.spec.js +20 -0
- package/lib/components/ContactPage/__tests__/contactPage.spec.js +159 -0
- package/lib/components/ContactPage/contactLink.js +21 -0
- package/lib/components/ContactPage/contactPage.js +270 -0
- package/lib/components/ContactPage/contactPage.module.css +81 -0
- package/lib/components/ContactPage/contactPage.shimmer.js +104 -0
- package/lib/components/ContactPage/contactPage.shimmer.module.css +27 -0
- package/lib/components/ContactPage/index.js +2 -0
- package/lib/components/CreateAccount/createAccount.js +5 -0
- package/lib/components/Dialog/dialog.js +18 -4
- package/lib/components/ErrorMessage/errorMessage.js +7 -2
- package/lib/components/ErrorView/errorView.js +4 -2
- package/lib/components/Field/field.module.css +10 -6
- package/lib/components/FilterModal/CurrentFilters/currentFilter.js +7 -3
- package/lib/components/FilterModal/FilterList/__tests__/filterItem.spec.js +34 -5
- package/lib/components/FilterModal/FilterList/filterDefault.js +3 -2
- package/lib/components/FilterModal/FilterList/filterItem.js +27 -7
- package/lib/components/FilterModal/FilterList/filterList.js +6 -1
- package/lib/components/FilterModal/filterBlock.js +9 -4
- package/lib/components/FilterModal/filterFooter.js +1 -0
- package/lib/components/FilterModal/filterModal.js +6 -1
- package/lib/components/FilterModalOpenButton/filterModalOpenButton.js +1 -0
- package/lib/components/FilterSidebar/filterSidebar.js +6 -1
- package/lib/components/Footer/__tests__/__snapshots__/footer.spec.js.snap +14 -0
- package/lib/components/Footer/__tests__/footer.spec.js +9 -1
- package/lib/components/Footer/footer.js +14 -7
- package/lib/components/Footer/sampleData.js +8 -3
- package/lib/components/ForgotPassword/ForgotPasswordForm/forgotPasswordForm.js +3 -0
- package/lib/components/ForgotPassword/FormSubmissionSuccessful/formSubmissionSuccessful.js +4 -2
- package/lib/components/ForgotPassword/forgotPassword.gql.js +0 -1
- package/lib/components/FormError/formError.js +10 -4
- package/lib/components/Gallery/__tests__/__snapshots__/addToCartButton.spec.js.snap +0 -3
- package/lib/components/Gallery/__tests__/__snapshots__/item.spec.js.snap +1 -0
- package/lib/components/Gallery/addToCartButton.js +27 -22
- package/lib/components/Gallery/item.js +16 -4
- package/lib/components/Gallery/item.module.css +1 -0
- package/lib/components/Head/index.js +2 -1
- package/lib/components/Header/__tests__/header.spec.js +1 -1
- package/lib/components/Header/accountTrigger.js +1 -0
- package/lib/components/Header/cartTrigger.js +4 -1
- package/lib/components/Header/header.js +1 -1
- package/lib/components/Header/navTrigger.js +1 -0
- package/lib/components/Header/searchTrigger.js +1 -0
- package/lib/components/LegacyMiniCart/cartOptions.gql.js +4 -3
- package/lib/components/LegacyMiniCart/editFormFragment.gql.js +7 -3
- package/lib/components/LegacyMiniCart/kebab.js +1 -0
- package/lib/components/LegacyMiniCart/productOptions.js +6 -1
- package/lib/components/LegacyMiniCart/section.js +15 -5
- package/lib/components/Link/link.js +6 -4
- package/lib/components/Mask/mask.js +3 -3
- package/lib/components/MegaMenu/__tests__/MegaMenuItem.spec.js +1 -0
- package/lib/components/MegaMenu/__tests__/__snapshots__/MegaMenu.spec.js.snap +9 -0
- package/lib/components/MegaMenu/__tests__/__snapshots__/MegaMenuItem.spec.js.snap +6 -0
- package/lib/components/MegaMenu/__tests__/__snapshots__/Submenu.spec.js.snap +2 -0
- package/lib/components/MegaMenu/megaMenu.js +6 -2
- package/lib/components/MegaMenu/megaMenuItem.js +27 -6
- package/lib/components/MegaMenu/megaMenuItem.module.css +0 -5
- package/lib/components/MegaMenu/submenu.js +5 -3
- package/lib/components/MegaMenu/submenuColumn.js +15 -4
- package/lib/components/MiniCart/ProductList/__tests__/__snapshots__/item.spec.js.snap +4 -4
- package/lib/components/MiniCart/ProductList/item.js +5 -2
- package/lib/components/MiniCart/ProductList/productList.js +5 -1
- package/lib/components/MiniCart/__tests__/__snapshots__/miniCart.spec.js.snap +1 -1
- package/lib/components/MiniCart/miniCart.gql.js +3 -2
- package/lib/components/MiniCart/miniCart.js +9 -4
- package/lib/components/MyAccount/ResetPassword/resetPassword.gql.js +1 -1
- package/lib/components/Newsletter/__tests__/__snapshots__/newsletter.shimmer.spec.js.snap +40 -0
- package/lib/components/Newsletter/__tests__/__snapshots__/newsletter.spec.js.snap +14 -8
- package/lib/components/Newsletter/__tests__/newsletter.shimmer.spec.js +10 -0
- package/lib/components/Newsletter/__tests__/newsletter.spec.js +25 -2
- package/lib/components/Newsletter/newsletter.js +27 -6
- package/lib/components/Newsletter/newsletter.shimmer.js +46 -0
- package/lib/components/Newsletter/newsletter.shimmer.module.css +11 -0
- package/lib/components/OrderHistoryPage/OrderDetails/__tests__/__snapshots__/item.spec.js.snap +1 -1
- package/lib/components/OrderHistoryPage/OrderDetails/__tests__/__snapshots__/shippingMethod.spec.js.snap +3 -0
- package/lib/components/OrderHistoryPage/OrderDetails/billingInformation.js +4 -1
- package/lib/components/OrderHistoryPage/OrderDetails/item.js +1 -1
- package/lib/components/OrderHistoryPage/OrderDetails/items.js +1 -1
- package/lib/components/OrderHistoryPage/OrderDetails/paymentMethod.js +1 -1
- package/lib/components/OrderHistoryPage/OrderDetails/shippingInformation.js +4 -1
- package/lib/components/OrderHistoryPage/OrderDetails/shippingMethod.js +5 -1
- package/lib/components/OrderHistoryPage/orderHistoryPage.js +8 -1
- package/lib/components/Pagination/pagination.js +1 -1
- package/lib/components/Pagination/tile.js +5 -1
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Boolean/__tests__/__snapshots__/boolean.spec.js.snap +20 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Boolean/__tests__/boolean.spec.js +52 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Boolean/boolean.js +74 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Boolean/boolean.module.css +9 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Boolean/index.js +1 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Date/__tests__/__snapshots__/date.spec.js.snap +25 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Date/__tests__/date.spec.js +52 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Date/date.js +82 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Date/date.module.css +9 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Date/index.js +1 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/DateTime/__tests__/__snapshots__/dateTime.spec.js.snap +29 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/DateTime/__tests__/dateTime.spec.js +53 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/DateTime/dateTime.js +85 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/DateTime/dateTime.module.css +9 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/DateTime/index.js +1 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Multiselect/__tests__/__snapshots__/multiSelect.spec.js.snap +36 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Multiselect/__tests__/multiSelect.spec.js +88 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Multiselect/index.js +1 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Multiselect/multiselect.js +99 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Multiselect/multiselect.module.css +13 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Price/__tests__/__snapshots__/price.spec.js.snap +23 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Price/__tests__/price.spec.js +52 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Price/index.js +1 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Price/price.js +74 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Price/price.module.css +9 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Select/__tests__/__snapshots__/select.spec.js.snap +36 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Select/__tests__/select.spec.js +88 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Select/index.js +1 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Select/select.js +99 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Select/select.module.css +13 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Text/__tests__/__snapshots__/text.spec.js.snap +33 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Text/__tests__/text.spec.js +74 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Text/index.js +1 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Text/text.js +88 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Text/text.module.css +13 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Textarea/__tests__/__snapshots__/textarea.spec.js.snap +33 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Textarea/__tests__/textarea.spec.js +74 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Textarea/index.js +1 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Textarea/textarea.js +88 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Textarea/textarea.module.css +13 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/__tests__/__snapshots__/attributeType.spec.js.snap +101 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/__tests__/attributeType.spec.js +173 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/attributeType.js +61 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/index.js +1 -0
- package/lib/components/ProductFullDetail/CustomAttributes/__tests__/__snapshots__/customAttributes.spec.js.snap +49 -0
- package/lib/components/ProductFullDetail/CustomAttributes/__tests__/customAttributes.spec.js +78 -0
- package/lib/components/ProductFullDetail/CustomAttributes/customAttributes.js +66 -0
- package/lib/components/ProductFullDetail/CustomAttributes/customAttributes.module.css +14 -0
- package/lib/components/ProductFullDetail/CustomAttributes/index.js +1 -0
- package/lib/components/ProductFullDetail/__tests__/__snapshots__/productFullDetail.spec.js.snap +39 -0
- package/lib/components/ProductFullDetail/__tests__/productFullDetail.spec.js +3 -1
- package/lib/components/ProductFullDetail/productFullDetail.js +18 -3
- package/lib/components/ProductOptions/__tests__/__snapshots__/option.spec.js.snap +1 -1
- package/lib/components/ProductOptions/__tests__/__snapshots__/options.spec.js.snap +2 -2
- package/lib/components/ProductOptions/__tests__/__snapshots__/swatch.spec.js.snap +44 -2
- package/lib/components/ProductOptions/__tests__/__snapshots__/swatchList.spec.js.snap +22 -1
- package/lib/components/ProductOptions/__tests__/swatch.spec.js +0 -2
- package/lib/components/ProductOptions/option.js +2 -2
- package/lib/components/ProductOptions/swatch.js +7 -5
- package/lib/components/ProductOptions/swatch.module.css +11 -0
- package/lib/components/ProductOptions/tile.js +1 -0
- package/lib/components/ProductSort/__tests__/__snapshots__/sortItem.spec.js.snap +14 -0
- package/lib/components/ProductSort/__tests__/sortItem.spec.js +61 -0
- package/lib/components/ProductSort/productSort.js +84 -40
- package/lib/components/ProductSort/sortItem.js +26 -11
- package/lib/components/RadioGroup/radio.module.css +13 -5
- package/lib/components/RadioGroup/radioGroup.js +2 -1
- package/lib/components/Rating/__tests__/__snapshots__/rating.spec.js.snap +27 -0
- package/lib/components/Rating/__tests__/rating.spec.js +13 -0
- package/lib/components/Rating/index.js +1 -0
- package/lib/components/Rating/rating.js +30 -0
- package/lib/components/Rating/rating.module.css +21 -0
- package/lib/components/RichContent/richContent.module.css +52 -59
- package/lib/components/SearchBar/autocomplete.js +2 -0
- package/lib/components/SearchBar/searchBar.js +1 -1
- package/lib/components/SearchBar/searchField.js +1 -0
- package/lib/components/SearchBar/suggestedCategory.js +1 -1
- package/lib/components/SearchBar/suggestedProduct.js +6 -1
- package/lib/components/SearchPage/__tests__/__snapshots__/searchPage.spec.js.snap +41 -1
- package/lib/components/SearchPage/__tests__/searchPage.spec.js +8 -0
- package/lib/components/SearchPage/searchPage.js +12 -6
- package/lib/components/Shimmer/shimmer.js +11 -2
- package/lib/components/Shimmer/shimmer.module.css +4 -8
- package/lib/components/SignIn/__tests__/__snapshots__/signIn.spec.js.snap +126 -0
- package/lib/components/SignIn/__tests__/signIn.spec.js +11 -0
- package/lib/components/SignIn/signIn.gql.js +8 -4
- package/lib/components/SignIn/signIn.js +24 -4
- package/lib/components/TextArea/textArea.module.css +9 -0
- package/lib/components/TextInput/textInput.module.css +4 -0
- package/lib/components/ToastContainer/toast.js +23 -3
- package/lib/components/ToastContainer/toast.module.css +3 -0
- package/lib/components/Trigger/trigger.js +9 -2
- package/lib/components/Wishlist/AddToListButton/addToListButton.ee.js +1 -0
- package/lib/components/Wishlist/WishlistDialog/CreateWishlistForm/createWishlistForm.js +2 -0
- package/lib/components/Wishlist/WishlistDialog/WishlistLineItem/wishlistLineItem.js +1 -0
- package/lib/components/Wishlist/WishlistDialog/wishlistDialog.js +1 -0
- package/lib/components/WishlistPage/__tests__/__snapshots__/wishlistPage.spec.js.snap +5 -5
- package/lib/components/WishlistPage/createWishlist.ee.js +2 -0
- package/lib/components/WishlistPage/wishlist.js +8 -3
- package/lib/components/WishlistPage/wishlistItem.js +17 -4
- package/lib/components/WishlistPage/wishlistPage.js +5 -3
- package/lib/defaultRoutes.json +6 -0
- package/lib/targets/__tests__/venia-ui-targets.spec.js +2 -0
- package/lib/util/__tests__/shrinkGETQuery.spec.js +1 -1
- package/lib/util/apolloCache.js +2 -2
- package/lib/util/formValidators.js +10 -8
- package/lib/util/toCamelCase.js +3 -0
- package/package.json +17 -14
- package/upward.yml +19 -40
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`it displays cms blocks 1`] = `
|
|
4
|
+
Array [
|
|
5
|
+
"Setting Store Title",
|
|
6
|
+
"Setting Meta",
|
|
7
|
+
"Setting Meta",
|
|
8
|
+
<article
|
|
9
|
+
className="root"
|
|
10
|
+
>
|
|
11
|
+
<div
|
|
12
|
+
className="banner"
|
|
13
|
+
>
|
|
14
|
+
<mock-CmsBlock
|
|
15
|
+
content="Banner Content"
|
|
16
|
+
/>
|
|
17
|
+
</div>
|
|
18
|
+
<div
|
|
19
|
+
className="content"
|
|
20
|
+
>
|
|
21
|
+
<div
|
|
22
|
+
className="formContainer"
|
|
23
|
+
>
|
|
24
|
+
<h1
|
|
25
|
+
className="title"
|
|
26
|
+
>
|
|
27
|
+
Contact Us
|
|
28
|
+
</h1>
|
|
29
|
+
<p
|
|
30
|
+
className="subtitle"
|
|
31
|
+
>
|
|
32
|
+
Drop us a line and we'll get back to you as soon as possible.
|
|
33
|
+
</p>
|
|
34
|
+
<FormError
|
|
35
|
+
allowErrorMessages={true}
|
|
36
|
+
errors={Array []}
|
|
37
|
+
/>
|
|
38
|
+
<mock-Form>
|
|
39
|
+
<Field
|
|
40
|
+
id="contact-name"
|
|
41
|
+
label="Name"
|
|
42
|
+
>
|
|
43
|
+
<TextInput
|
|
44
|
+
autoComplete="name"
|
|
45
|
+
field="name"
|
|
46
|
+
id="contact-name"
|
|
47
|
+
validate={[Function]}
|
|
48
|
+
/>
|
|
49
|
+
</Field>
|
|
50
|
+
<Field
|
|
51
|
+
id="contact-email"
|
|
52
|
+
label="Email"
|
|
53
|
+
>
|
|
54
|
+
<TextInput
|
|
55
|
+
autoComplete="email"
|
|
56
|
+
field="email"
|
|
57
|
+
id="contact-email"
|
|
58
|
+
placeholder="abc@xyz.com"
|
|
59
|
+
validate={[Function]}
|
|
60
|
+
/>
|
|
61
|
+
</Field>
|
|
62
|
+
<Field
|
|
63
|
+
id="contact-telephone"
|
|
64
|
+
label="Phone Number"
|
|
65
|
+
optional={true}
|
|
66
|
+
>
|
|
67
|
+
<TextInput
|
|
68
|
+
autoComplete="tel"
|
|
69
|
+
field="telephone"
|
|
70
|
+
id="contact-telephone"
|
|
71
|
+
placeholder="(222)-222-2222"
|
|
72
|
+
/>
|
|
73
|
+
</Field>
|
|
74
|
+
<Field
|
|
75
|
+
id="contact-comment"
|
|
76
|
+
label="Message"
|
|
77
|
+
>
|
|
78
|
+
<TextArea
|
|
79
|
+
autoComplete="comment"
|
|
80
|
+
field="comment"
|
|
81
|
+
id="contact-comment"
|
|
82
|
+
placeholder="Tell us what's on your mind"
|
|
83
|
+
validate={[Function]}
|
|
84
|
+
/>
|
|
85
|
+
</Field>
|
|
86
|
+
<div
|
|
87
|
+
className="buttonsContainer"
|
|
88
|
+
>
|
|
89
|
+
<Button
|
|
90
|
+
disabled={false}
|
|
91
|
+
priority="high"
|
|
92
|
+
type="submit"
|
|
93
|
+
>
|
|
94
|
+
Send
|
|
95
|
+
</Button>
|
|
96
|
+
</div>
|
|
97
|
+
</mock-Form>
|
|
98
|
+
</div>
|
|
99
|
+
<div
|
|
100
|
+
className="sideContent"
|
|
101
|
+
>
|
|
102
|
+
<mock-CmsBlock
|
|
103
|
+
content="Sidebar Content"
|
|
104
|
+
/>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
</article>,
|
|
108
|
+
]
|
|
109
|
+
`;
|
|
110
|
+
|
|
111
|
+
exports[`it displays errors 1`] = `
|
|
112
|
+
Array [
|
|
113
|
+
"Setting Store Title",
|
|
114
|
+
"Setting Meta",
|
|
115
|
+
"Setting Meta",
|
|
116
|
+
<article
|
|
117
|
+
className="root"
|
|
118
|
+
>
|
|
119
|
+
<div
|
|
120
|
+
className="content"
|
|
121
|
+
>
|
|
122
|
+
<div
|
|
123
|
+
className="formContainer"
|
|
124
|
+
>
|
|
125
|
+
<h1
|
|
126
|
+
className="title"
|
|
127
|
+
>
|
|
128
|
+
Contact Us
|
|
129
|
+
</h1>
|
|
130
|
+
<p
|
|
131
|
+
className="subtitle"
|
|
132
|
+
>
|
|
133
|
+
Drop us a line and we'll get back to you as soon as possible.
|
|
134
|
+
</p>
|
|
135
|
+
<FormError
|
|
136
|
+
allowErrorMessages={true}
|
|
137
|
+
errors={
|
|
138
|
+
Array [
|
|
139
|
+
"message here",
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
/>
|
|
143
|
+
<mock-Form>
|
|
144
|
+
<Field
|
|
145
|
+
id="contact-name"
|
|
146
|
+
label="Name"
|
|
147
|
+
>
|
|
148
|
+
<TextInput
|
|
149
|
+
autoComplete="name"
|
|
150
|
+
field="name"
|
|
151
|
+
id="contact-name"
|
|
152
|
+
validate={[Function]}
|
|
153
|
+
/>
|
|
154
|
+
</Field>
|
|
155
|
+
<Field
|
|
156
|
+
id="contact-email"
|
|
157
|
+
label="Email"
|
|
158
|
+
>
|
|
159
|
+
<TextInput
|
|
160
|
+
autoComplete="email"
|
|
161
|
+
field="email"
|
|
162
|
+
id="contact-email"
|
|
163
|
+
placeholder="abc@xyz.com"
|
|
164
|
+
validate={[Function]}
|
|
165
|
+
/>
|
|
166
|
+
</Field>
|
|
167
|
+
<Field
|
|
168
|
+
id="contact-telephone"
|
|
169
|
+
label="Phone Number"
|
|
170
|
+
optional={true}
|
|
171
|
+
>
|
|
172
|
+
<TextInput
|
|
173
|
+
autoComplete="tel"
|
|
174
|
+
field="telephone"
|
|
175
|
+
id="contact-telephone"
|
|
176
|
+
placeholder="(222)-222-2222"
|
|
177
|
+
/>
|
|
178
|
+
</Field>
|
|
179
|
+
<Field
|
|
180
|
+
id="contact-comment"
|
|
181
|
+
label="Message"
|
|
182
|
+
>
|
|
183
|
+
<TextArea
|
|
184
|
+
autoComplete="comment"
|
|
185
|
+
field="comment"
|
|
186
|
+
id="contact-comment"
|
|
187
|
+
placeholder="Tell us what's on your mind"
|
|
188
|
+
validate={[Function]}
|
|
189
|
+
/>
|
|
190
|
+
</Field>
|
|
191
|
+
<div
|
|
192
|
+
className="buttonsContainer"
|
|
193
|
+
>
|
|
194
|
+
<Button
|
|
195
|
+
disabled={false}
|
|
196
|
+
priority="high"
|
|
197
|
+
type="submit"
|
|
198
|
+
>
|
|
199
|
+
Send
|
|
200
|
+
</Button>
|
|
201
|
+
</div>
|
|
202
|
+
</mock-Form>
|
|
203
|
+
</div>
|
|
204
|
+
</div>
|
|
205
|
+
</article>,
|
|
206
|
+
]
|
|
207
|
+
`;
|
|
208
|
+
|
|
209
|
+
exports[`it renders form 1`] = `
|
|
210
|
+
Array [
|
|
211
|
+
"Setting Store Title",
|
|
212
|
+
"Setting Meta",
|
|
213
|
+
"Setting Meta",
|
|
214
|
+
<article
|
|
215
|
+
className="root"
|
|
216
|
+
>
|
|
217
|
+
<div
|
|
218
|
+
className="content"
|
|
219
|
+
>
|
|
220
|
+
<div
|
|
221
|
+
className="formContainer"
|
|
222
|
+
>
|
|
223
|
+
<h1
|
|
224
|
+
className="title"
|
|
225
|
+
>
|
|
226
|
+
Contact Us
|
|
227
|
+
</h1>
|
|
228
|
+
<p
|
|
229
|
+
className="subtitle"
|
|
230
|
+
>
|
|
231
|
+
Drop us a line and we'll get back to you as soon as possible.
|
|
232
|
+
</p>
|
|
233
|
+
<FormError
|
|
234
|
+
allowErrorMessages={true}
|
|
235
|
+
errors={Array []}
|
|
236
|
+
/>
|
|
237
|
+
<mock-Form>
|
|
238
|
+
<Field
|
|
239
|
+
id="contact-name"
|
|
240
|
+
label="Name"
|
|
241
|
+
>
|
|
242
|
+
<TextInput
|
|
243
|
+
autoComplete="name"
|
|
244
|
+
field="name"
|
|
245
|
+
id="contact-name"
|
|
246
|
+
validate={[Function]}
|
|
247
|
+
/>
|
|
248
|
+
</Field>
|
|
249
|
+
<Field
|
|
250
|
+
id="contact-email"
|
|
251
|
+
label="Email"
|
|
252
|
+
>
|
|
253
|
+
<TextInput
|
|
254
|
+
autoComplete="email"
|
|
255
|
+
field="email"
|
|
256
|
+
id="contact-email"
|
|
257
|
+
placeholder="abc@xyz.com"
|
|
258
|
+
validate={[Function]}
|
|
259
|
+
/>
|
|
260
|
+
</Field>
|
|
261
|
+
<Field
|
|
262
|
+
id="contact-telephone"
|
|
263
|
+
label="Phone Number"
|
|
264
|
+
optional={true}
|
|
265
|
+
>
|
|
266
|
+
<TextInput
|
|
267
|
+
autoComplete="tel"
|
|
268
|
+
field="telephone"
|
|
269
|
+
id="contact-telephone"
|
|
270
|
+
placeholder="(222)-222-2222"
|
|
271
|
+
/>
|
|
272
|
+
</Field>
|
|
273
|
+
<Field
|
|
274
|
+
id="contact-comment"
|
|
275
|
+
label="Message"
|
|
276
|
+
>
|
|
277
|
+
<TextArea
|
|
278
|
+
autoComplete="comment"
|
|
279
|
+
field="comment"
|
|
280
|
+
id="contact-comment"
|
|
281
|
+
placeholder="Tell us what's on your mind"
|
|
282
|
+
validate={[Function]}
|
|
283
|
+
/>
|
|
284
|
+
</Field>
|
|
285
|
+
<div
|
|
286
|
+
className="buttonsContainer"
|
|
287
|
+
>
|
|
288
|
+
<Button
|
|
289
|
+
disabled={false}
|
|
290
|
+
priority="high"
|
|
291
|
+
type="submit"
|
|
292
|
+
>
|
|
293
|
+
Send
|
|
294
|
+
</Button>
|
|
295
|
+
</div>
|
|
296
|
+
</mock-Form>
|
|
297
|
+
</div>
|
|
298
|
+
</div>
|
|
299
|
+
</article>,
|
|
300
|
+
]
|
|
301
|
+
`;
|
|
302
|
+
|
|
303
|
+
exports[`it shows 404 if disabled 1`] = `
|
|
304
|
+
Array [
|
|
305
|
+
"Setting Store Title",
|
|
306
|
+
<ErrorView
|
|
307
|
+
message="Looks like the page you were hoping to find doesn't exist. Sorry about that."
|
|
308
|
+
/>,
|
|
309
|
+
]
|
|
310
|
+
`;
|
|
311
|
+
|
|
312
|
+
exports[`it shows shimmer while loading 1`] = `<ContactPageShimmer />`;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { createTestInstance } from '@magento/peregrine';
|
|
3
|
+
import { useContactLink } from '@magento/peregrine/lib/talons/ContactPage';
|
|
4
|
+
import ContactLink from '../contactLink';
|
|
5
|
+
|
|
6
|
+
jest.mock('@magento/peregrine/lib/talons/ContactPage');
|
|
7
|
+
jest.mock('../../Shimmer', () => 'Shimmer');
|
|
8
|
+
|
|
9
|
+
test('it renders children', () => {
|
|
10
|
+
useContactLink.mockImplementation(() => ({
|
|
11
|
+
isEnabled: true,
|
|
12
|
+
isLoading: false
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
const text = 'Contact Link';
|
|
16
|
+
|
|
17
|
+
const instance = createTestInstance(
|
|
18
|
+
<ContactLink>
|
|
19
|
+
<div>{text}</div>
|
|
20
|
+
</ContactLink>
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
expect(instance.toJSON()).toMatchSnapshot();
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test('it shows shimmer while loading', () => {
|
|
27
|
+
useContactLink.mockImplementation(() => ({
|
|
28
|
+
isEnabled: false,
|
|
29
|
+
isLoading: true
|
|
30
|
+
}));
|
|
31
|
+
|
|
32
|
+
const text = "Shouldn't appear";
|
|
33
|
+
|
|
34
|
+
const instance = createTestInstance(
|
|
35
|
+
<ContactLink>
|
|
36
|
+
<div>{text}</div>
|
|
37
|
+
</ContactLink>
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
expect(instance.toJSON()).toMatchSnapshot();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
test('it does not render children when inactive', () => {
|
|
44
|
+
useContactLink.mockImplementation(() => ({
|
|
45
|
+
isEnabled: false,
|
|
46
|
+
isLoading: false
|
|
47
|
+
}));
|
|
48
|
+
|
|
49
|
+
const text = "Shouldn't appear";
|
|
50
|
+
|
|
51
|
+
const instance = createTestInstance(
|
|
52
|
+
<ContactLink>
|
|
53
|
+
<div>{text}</div>
|
|
54
|
+
</ContactLink>
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
expect(instance.toJSON()).toMatchSnapshot();
|
|
58
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { createTestInstance } from '@magento/peregrine';
|
|
3
|
+
import ContactPageShimmer from '../contactPage.shimmer';
|
|
4
|
+
|
|
5
|
+
jest.mock('../../Shimmer', () => 'Shimmer');
|
|
6
|
+
jest.mock('../../../classify', () => ({
|
|
7
|
+
useStyle: (...classes) => Object.assign({}, ...classes)
|
|
8
|
+
}));
|
|
9
|
+
|
|
10
|
+
const classes = {
|
|
11
|
+
shimmer: 'shimmer-class'
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
test('it renders', () => {
|
|
15
|
+
const instance = createTestInstance(
|
|
16
|
+
<ContactPageShimmer classes={classes} />
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
expect(instance.toJSON()).toMatchSnapshot();
|
|
20
|
+
});
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { createTestInstance, useToasts } from '@magento/peregrine';
|
|
3
|
+
import { useContactPage } from '@magento/peregrine/lib/talons/ContactPage';
|
|
4
|
+
import LoadingIndicator from '../../LoadingIndicator';
|
|
5
|
+
import ContactPage from '../contactPage';
|
|
6
|
+
|
|
7
|
+
jest.mock('react-intl', () => ({
|
|
8
|
+
FormattedMessage: ({ defaultMessage }) => defaultMessage,
|
|
9
|
+
useIntl: () => ({
|
|
10
|
+
formatMessage: ({ defaultMessage }) => defaultMessage
|
|
11
|
+
})
|
|
12
|
+
}));
|
|
13
|
+
|
|
14
|
+
jest.mock('informed', () => ({
|
|
15
|
+
Form: ({ children }) => <mock-Form>{children}</mock-Form>
|
|
16
|
+
}));
|
|
17
|
+
|
|
18
|
+
jest.mock('@magento/peregrine', () => {
|
|
19
|
+
const peregrine = jest.requireActual('@magento/peregrine');
|
|
20
|
+
|
|
21
|
+
return {
|
|
22
|
+
...peregrine,
|
|
23
|
+
useToasts: jest.fn()
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
jest.mock('@magento/peregrine/lib/talons/ContactPage');
|
|
28
|
+
|
|
29
|
+
jest.mock('../../../classify');
|
|
30
|
+
|
|
31
|
+
jest.mock('../../Head', () => ({
|
|
32
|
+
Meta: () => 'Setting Meta',
|
|
33
|
+
StoreTitle: () => 'Setting Store Title'
|
|
34
|
+
}));
|
|
35
|
+
|
|
36
|
+
jest.mock('../../Button', () => 'Button');
|
|
37
|
+
jest.mock('../../CmsBlock/block', () => props => <mock-CmsBlock {...props} />);
|
|
38
|
+
jest.mock('../../FormError', () => 'FormError');
|
|
39
|
+
jest.mock('../../Field', () => 'Field');
|
|
40
|
+
jest.mock('../../TextInput', () => 'TextInput');
|
|
41
|
+
jest.mock('../../TextArea', () => 'TextArea');
|
|
42
|
+
jest.mock('../../LoadingIndicator', () => 'LoadingIndicator');
|
|
43
|
+
jest.mock('../../ErrorView', () => 'ErrorView');
|
|
44
|
+
|
|
45
|
+
jest.mock('../contactPage.shimmer', () => 'ContactPageShimmer');
|
|
46
|
+
|
|
47
|
+
const defaultTalonProps = {
|
|
48
|
+
isEnabled: true,
|
|
49
|
+
cmsBlocks: [],
|
|
50
|
+
errors: new Map(),
|
|
51
|
+
handleSubmit: jest.fn(),
|
|
52
|
+
isBusy: false,
|
|
53
|
+
isLoading: false,
|
|
54
|
+
setFormApi: jest.fn(),
|
|
55
|
+
response: null
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
beforeEach(() => {
|
|
59
|
+
useContactPage.mockImplementation(() => defaultTalonProps);
|
|
60
|
+
|
|
61
|
+
useToasts.mockImplementation(() => [
|
|
62
|
+
null,
|
|
63
|
+
{
|
|
64
|
+
addToast: jest.fn()
|
|
65
|
+
}
|
|
66
|
+
]);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
test('it renders form', () => {
|
|
70
|
+
const instance = createTestInstance(<ContactPage />);
|
|
71
|
+
|
|
72
|
+
expect(instance.toJSON()).toMatchSnapshot();
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
test('it shows shimmer while loading', () => {
|
|
76
|
+
useContactPage.mockImplementation(() => ({
|
|
77
|
+
...defaultTalonProps,
|
|
78
|
+
isEnabled: false,
|
|
79
|
+
isLoading: true
|
|
80
|
+
}));
|
|
81
|
+
|
|
82
|
+
const instance = createTestInstance(<ContactPage />);
|
|
83
|
+
|
|
84
|
+
expect(instance.toJSON()).toMatchSnapshot();
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
test('it shows 404 if disabled', () => {
|
|
88
|
+
useContactPage.mockImplementation(() => ({
|
|
89
|
+
...defaultTalonProps,
|
|
90
|
+
isEnabled: false
|
|
91
|
+
}));
|
|
92
|
+
|
|
93
|
+
const instance = createTestInstance(<ContactPage />);
|
|
94
|
+
|
|
95
|
+
expect(instance.toJSON()).toMatchSnapshot();
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
test('it displays loader while sending form', () => {
|
|
99
|
+
useContactPage.mockImplementation(() => ({
|
|
100
|
+
...defaultTalonProps,
|
|
101
|
+
isBusy: true
|
|
102
|
+
}));
|
|
103
|
+
|
|
104
|
+
const { root } = createTestInstance(<ContactPage />);
|
|
105
|
+
|
|
106
|
+
expect(root.findByType(LoadingIndicator)).toBeTruthy();
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
test('it displays errors', () => {
|
|
110
|
+
useContactPage.mockImplementation(() => ({
|
|
111
|
+
...defaultTalonProps,
|
|
112
|
+
errors: new Map([['someError', 'message here']])
|
|
113
|
+
}));
|
|
114
|
+
|
|
115
|
+
const instance = createTestInstance(<ContactPage />);
|
|
116
|
+
|
|
117
|
+
expect(instance.toJSON()).toMatchSnapshot();
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
test('it displays cms blocks', () => {
|
|
121
|
+
useContactPage.mockImplementation(() => ({
|
|
122
|
+
...defaultTalonProps,
|
|
123
|
+
cmsBlocks: [
|
|
124
|
+
{
|
|
125
|
+
identifier: 'contact-us-banner',
|
|
126
|
+
content: 'Banner Content'
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
identifier: 'contact-us-sidebar',
|
|
130
|
+
content: 'Sidebar Content'
|
|
131
|
+
}
|
|
132
|
+
]
|
|
133
|
+
}));
|
|
134
|
+
|
|
135
|
+
const instance = createTestInstance(<ContactPage />);
|
|
136
|
+
|
|
137
|
+
expect(instance.toJSON()).toMatchSnapshot();
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
test('it shows success toast', () => {
|
|
141
|
+
useContactPage.mockImplementation(() => ({
|
|
142
|
+
...defaultTalonProps,
|
|
143
|
+
response: {
|
|
144
|
+
status: true
|
|
145
|
+
}
|
|
146
|
+
}));
|
|
147
|
+
|
|
148
|
+
const addToastMock = jest.fn();
|
|
149
|
+
useToasts.mockImplementation(() => [
|
|
150
|
+
null,
|
|
151
|
+
{
|
|
152
|
+
addToast: addToastMock
|
|
153
|
+
}
|
|
154
|
+
]);
|
|
155
|
+
|
|
156
|
+
createTestInstance(<ContactPage />);
|
|
157
|
+
|
|
158
|
+
expect(addToastMock).toHaveBeenCalled();
|
|
159
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useContactLink } from '@magento/peregrine/lib/talons/ContactPage';
|
|
3
|
+
import Shimmer from '../Shimmer';
|
|
4
|
+
|
|
5
|
+
const ContactLink = props => {
|
|
6
|
+
const { children } = props;
|
|
7
|
+
const talonProps = useContactLink();
|
|
8
|
+
const { isEnabled, isLoading } = talonProps;
|
|
9
|
+
|
|
10
|
+
if (!isEnabled && !isLoading) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (isLoading) {
|
|
15
|
+
return <Shimmer />;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return children;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default ContactLink;
|