@anker-in/campaign-ui 0.2.10-beta.2 → 0.2.10-beta.20
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/dist/index.d.mts +494 -0
- package/dist/index.d.ts +494 -0
- package/dist/index.js +31227 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +31211 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +33 -30
- package/src/components/credits/context/hooks/useActivities.ts +2 -2
- package/src/components/credits/context/hooks/useAddressValidate.ts +2 -2
- package/src/components/credits/context/hooks/useAlpcFetch.ts +8 -8
- package/src/components/credits/context/hooks/useCountries.ts +2 -2
- package/src/components/credits/context/hooks/useMyRewards.ts +2 -2
- package/src/components/credits/context/hooks/useRedeemAndBuy.ts +21 -24
- package/src/components/credits/context/hooks/useRedeemCoupon.ts +2 -2
- package/src/components/credits/context/hooks/useRedeemProduct.ts +2 -2
- package/src/components/credits/context/hooks/useRedeemableList.ts +2 -2
- package/src/components/credits/context/hooks/useSendEmailValidation.ts +2 -2
- package/src/components/credits/context/hooks/useSubscribed.ts +2 -2
- package/src/components/credits/context/hooks/useSubscriptions.ts +2 -2
- package/src/components/credits/creditsBanner/index.tsx +1 -1
- package/src/components/credits/creditsBenefits/benefitItem.tsx +1 -1
- package/src/components/credits/creditsBenefits/index.tsx +6 -8
- package/src/components/credits/creditsCash/RedeemableItem.tsx +13 -18
- package/src/components/credits/creditsCash/index.tsx +2 -2
- package/src/components/credits/creditsCash/type.ts +1 -1
- package/src/components/credits/creditsInfoCard/index.tsx +4 -3
- package/src/components/credits/creditsRedeemList/AddressForm/index.tsx +2 -2
- package/src/components/credits/creditsRedeemList/RedeemCouponModal.tsx +2 -2
- package/src/components/credits/creditsRedeemList/RedeemProductModal/Address.tsx +2 -2
- package/src/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.tsx +2 -2
- package/src/components/credits/creditsRedeemList/RedeemProductModal/index.tsx +2 -2
- package/src/components/credits/creditsRedeemList/index.tsx +1 -1
- package/src/components/credits/creditsWaysToGetCredits/useActions.ts +4 -3
- package/src/components/credits/modal/MyRewardsModal.tsx +77 -65
- package/src/components/credits/modal/activitiesModal.tsx +54 -44
- package/src/components/credits/modal/loadingDots.tsx +8 -6
- package/src/components/credits/type.ts +1 -1
- package/src/helpers/track.ts +18 -0
- package/src/index.ts +2 -21
- package/tailwind.config.ts +10 -0
- package/dist/cjs/components/chat/action.d.ts +0 -25
- package/dist/cjs/components/chat/action.js +0 -2
- package/dist/cjs/components/chat/action.js.map +0 -7
- package/dist/cjs/components/chat/button.d.ts +0 -3
- package/dist/cjs/components/chat/button.js +0 -2
- package/dist/cjs/components/chat/button.js.map +0 -7
- package/dist/cjs/components/chat/chatContext.d.ts +0 -101
- package/dist/cjs/components/chat/chatContext.js +0 -2
- package/dist/cjs/components/chat/chatContext.js.map +0 -7
- package/dist/cjs/components/chat/index.d.ts +0 -71
- package/dist/cjs/components/chat/index.js +0 -2
- package/dist/cjs/components/chat/index.js.map +0 -7
- package/dist/cjs/components/chat/markdown.d.ts +0 -5
- package/dist/cjs/components/chat/markdown.js +0 -2
- package/dist/cjs/components/chat/markdown.js.map +0 -7
- package/dist/cjs/components/chat/messages.d.ts +0 -3
- package/dist/cjs/components/chat/messages.js +0 -2
- package/dist/cjs/components/chat/messages.js.map +0 -7
- package/dist/cjs/components/chat/props.d.ts +0 -43
- package/dist/cjs/components/chat/props.js +0 -2
- package/dist/cjs/components/chat/props.js.map +0 -7
- package/dist/cjs/components/chat/response.d.ts +0 -4
- package/dist/cjs/components/chat/response.js +0 -2
- package/dist/cjs/components/chat/response.js.map +0 -7
- package/dist/cjs/components/chat/suggestions.d.ts +0 -3
- package/dist/cjs/components/chat/suggestions.js +0 -2
- package/dist/cjs/components/chat/suggestions.js.map +0 -7
- package/dist/cjs/components/chat/utils.d.ts +0 -3
- package/dist/cjs/components/chat/utils.js +0 -2
- package/dist/cjs/components/chat/utils.js.map +0 -7
- package/dist/cjs/components/credits/context/const.d.ts +0 -81
- package/dist/cjs/components/credits/context/const.js +0 -2
- package/dist/cjs/components/credits/context/const.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useActivities.d.ts +0 -12
- package/dist/cjs/components/credits/context/hooks/useActivities.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useActivities.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useAddressValidate.d.ts +0 -34
- package/dist/cjs/components/credits/context/hooks/useAddressValidate.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useAddressValidate.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useAlpcFetch.d.ts +0 -23
- package/dist/cjs/components/credits/context/hooks/useAlpcFetch.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useAlpcFetch.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useClickOutside.d.ts +0 -3
- package/dist/cjs/components/credits/context/hooks/useClickOutside.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useClickOutside.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useCopy.d.ts +0 -5
- package/dist/cjs/components/credits/context/hooks/useCopy.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useCopy.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useCountries.d.ts +0 -8
- package/dist/cjs/components/credits/context/hooks/useCountries.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useCountries.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useFirstPurchaseFinished.d.ts +0 -1
- package/dist/cjs/components/credits/context/hooks/useFirstPurchaseFinished.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useFirstPurchaseFinished.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useMyRewards.d.ts +0 -14
- package/dist/cjs/components/credits/context/hooks/useMyRewards.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useMyRewards.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useReceiptUploaded.d.ts +0 -2
- package/dist/cjs/components/credits/context/hooks/useReceiptUploaded.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useReceiptUploaded.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.d.ts +0 -14
- package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.d.ts +0 -17
- package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useRedeemProduct.d.ts +0 -16
- package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useRedeemableList.d.ts +0 -7
- package/dist/cjs/components/credits/context/hooks/useRedeemableList.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useRedeemableList.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.d.ts +0 -1
- package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useSubscribed.d.ts +0 -1
- package/dist/cjs/components/credits/context/hooks/useSubscribed.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useSubscribed.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useSubscriptions.d.ts +0 -5
- package/dist/cjs/components/credits/context/hooks/useSubscriptions.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useSubscriptions.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useUploadReceipt.d.ts +0 -14
- package/dist/cjs/components/credits/context/hooks/useUploadReceipt.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useUploadReceipt.js.map +0 -7
- package/dist/cjs/components/credits/context/provider.d.ts +0 -49
- package/dist/cjs/components/credits/context/provider.js +0 -2
- package/dist/cjs/components/credits/context/provider.js.map +0 -7
- package/dist/cjs/components/credits/context/response.d.ts +0 -63
- package/dist/cjs/components/credits/context/response.js +0 -2
- package/dist/cjs/components/credits/context/response.js.map +0 -7
- package/dist/cjs/components/credits/context/utils.d.ts +0 -25
- package/dist/cjs/components/credits/context/utils.js +0 -2
- package/dist/cjs/components/credits/context/utils.js.map +0 -7
- package/dist/cjs/components/credits/creditsBanner/index.d.ts +0 -23
- package/dist/cjs/components/credits/creditsBanner/index.js +0 -2
- package/dist/cjs/components/credits/creditsBanner/index.js.map +0 -7
- package/dist/cjs/components/credits/creditsBenefits/benefitItem.d.ts +0 -19
- package/dist/cjs/components/credits/creditsBenefits/benefitItem.js +0 -2
- package/dist/cjs/components/credits/creditsBenefits/benefitItem.js.map +0 -7
- package/dist/cjs/components/credits/creditsBenefits/iconInfo.d.ts +0 -2
- package/dist/cjs/components/credits/creditsBenefits/iconInfo.js +0 -2
- package/dist/cjs/components/credits/creditsBenefits/iconInfo.js.map +0 -7
- package/dist/cjs/components/credits/creditsBenefits/index.d.ts +0 -12
- package/dist/cjs/components/credits/creditsBenefits/index.js +0 -4
- package/dist/cjs/components/credits/creditsBenefits/index.js.map +0 -7
- package/dist/cjs/components/credits/creditsCash/RedeemableItem.d.ts +0 -15
- package/dist/cjs/components/credits/creditsCash/RedeemableItem.js +0 -2
- package/dist/cjs/components/credits/creditsCash/RedeemableItem.js.map +0 -7
- package/dist/cjs/components/credits/creditsCash/index.d.ts +0 -13
- package/dist/cjs/components/credits/creditsCash/index.js +0 -2
- package/dist/cjs/components/credits/creditsCash/index.js.map +0 -7
- package/dist/cjs/components/credits/creditsCash/type.d.ts +0 -47
- package/dist/cjs/components/credits/creditsCash/type.js +0 -2
- package/dist/cjs/components/credits/creditsCash/type.js.map +0 -7
- package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.d.ts +0 -13
- package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js +0 -2
- package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js.map +0 -7
- package/dist/cjs/components/credits/creditsFaq/index.d.ts +0 -16
- package/dist/cjs/components/credits/creditsFaq/index.js +0 -2
- package/dist/cjs/components/credits/creditsFaq/index.js.map +0 -7
- package/dist/cjs/components/credits/creditsInfoCard/index.d.ts +0 -20
- package/dist/cjs/components/credits/creditsInfoCard/index.js +0 -2
- package/dist/cjs/components/credits/creditsInfoCard/index.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.d.ts +0 -14
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/FormItem.d.ts +0 -6
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/FormItem.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/FormItem.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/Input.d.ts +0 -13
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/Input.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/Input.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.d.ts +0 -15
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.d.ts +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/type.d.ts +0 -26
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/type.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/type.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.d.ts +0 -9
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.d.ts +0 -20
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Error.d.ts +0 -8
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Error.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Error.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.d.ts +0 -11
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.d.ts +0 -8
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.d.ts +0 -13
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.d.ts +0 -11
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.d.ts +0 -9
- package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/index.d.ts +0 -13
- package/dist/cjs/components/credits/creditsRedeemList/index.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/index.js.map +0 -7
- package/dist/cjs/components/credits/creditsRedeemList/type.d.ts +0 -77
- package/dist/cjs/components/credits/creditsRedeemList/type.js +0 -2
- package/dist/cjs/components/credits/creditsRedeemList/type.js.map +0 -7
- package/dist/cjs/components/credits/creditsWaysToGetCredits/index.d.ts +0 -2
- package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js +0 -2
- package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js.map +0 -7
- package/dist/cjs/components/credits/creditsWaysToGetCredits/type.d.ts +0 -60
- package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js +0 -2
- package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js.map +0 -7
- package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.d.ts +0 -96
- package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js +0 -2
- package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js.map +0 -7
- package/dist/cjs/components/credits/index.d.ts +0 -10
- package/dist/cjs/components/credits/index.js +0 -2
- package/dist/cjs/components/credits/index.js.map +0 -7
- package/dist/cjs/components/credits/modal/MyRewardsModal.d.ts +0 -29
- package/dist/cjs/components/credits/modal/MyRewardsModal.js +0 -2
- package/dist/cjs/components/credits/modal/MyRewardsModal.js.map +0 -7
- package/dist/cjs/components/credits/modal/activitiesModal.d.ts +0 -29
- package/dist/cjs/components/credits/modal/activitiesModal.js +0 -2
- package/dist/cjs/components/credits/modal/activitiesModal.js.map +0 -7
- package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.d.ts +0 -24
- package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js +0 -2
- package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js.map +0 -7
- package/dist/cjs/components/credits/modal/loadingDots.d.ts +0 -5
- package/dist/cjs/components/credits/modal/loadingDots.js +0 -2
- package/dist/cjs/components/credits/modal/loadingDots.js.map +0 -7
- package/dist/cjs/components/credits/modal/modalContainer.d.ts +0 -15
- package/dist/cjs/components/credits/modal/modalContainer.js +0 -2
- package/dist/cjs/components/credits/modal/modalContainer.js.map +0 -7
- package/dist/cjs/components/credits/modal/rulesModal.d.ts +0 -7
- package/dist/cjs/components/credits/modal/rulesModal.js +0 -2
- package/dist/cjs/components/credits/modal/rulesModal.js.map +0 -7
- package/dist/cjs/components/credits/modal/tip.d.ts +0 -5
- package/dist/cjs/components/credits/modal/tip.js +0 -2
- package/dist/cjs/components/credits/modal/tip.js.map +0 -7
- package/dist/cjs/components/credits/type.d.ts +0 -55
- package/dist/cjs/components/credits/type.js +0 -2
- package/dist/cjs/components/credits/type.js.map +0 -7
- package/dist/cjs/components/index.d.ts +0 -3
- package/dist/cjs/components/index.js +0 -2
- package/dist/cjs/components/index.js.map +0 -7
- package/dist/cjs/debug-env.d.ts +0 -7
- package/dist/cjs/helpers/fetchResponse.d.ts +0 -14
- package/dist/cjs/helpers/fetchResponse.js +0 -2
- package/dist/cjs/helpers/fetchResponse.js.map +0 -7
- package/dist/cjs/helpers/fetcher.d.ts +0 -2
- package/dist/cjs/helpers/fetcher.js +0 -2
- package/dist/cjs/helpers/fetcher.js.map +0 -7
- package/dist/cjs/helpers/index.d.ts +0 -2
- package/dist/cjs/helpers/index.js +0 -2
- package/dist/cjs/helpers/index.js.map +0 -7
- package/dist/cjs/helpers/track.d.ts +0 -15
- package/dist/cjs/helpers/track.js +0 -2
- package/dist/cjs/helpers/track.js.map +0 -7
- package/dist/cjs/helpers/utils.d.ts +0 -3
- package/dist/cjs/helpers/utils.js +0 -2
- package/dist/cjs/helpers/utils.js.map +0 -7
- package/dist/cjs/index.css +0 -2
- package/dist/cjs/index.css.map +0 -7
- package/dist/cjs/index.d.ts +0 -7
- package/dist/cjs/index.js +0 -2
- package/dist/cjs/index.js.map +0 -7
- package/dist/cjs/shopify/context/ShopifyProvider.d.ts +0 -10
- package/dist/cjs/shopify/fetchers/create-cart.d.ts +0 -13
- package/dist/cjs/shopify/fetchers/get-products-by-handles.d.ts +0 -7
- package/dist/cjs/shopify/fetchers/index.d.ts +0 -2
- package/dist/cjs/shopify/fragments/article.d.ts +0 -2
- package/dist/cjs/shopify/fragments/blog.d.ts +0 -1
- package/dist/cjs/shopify/fragments/cart.d.ts +0 -1
- package/dist/cjs/shopify/fragments/collection.d.ts +0 -1
- package/dist/cjs/shopify/fragments/image.d.ts +0 -1
- package/dist/cjs/shopify/fragments/index.d.ts +0 -11
- package/dist/cjs/shopify/fragments/metafields.d.ts +0 -2
- package/dist/cjs/shopify/fragments/page-info.d.ts +0 -1
- package/dist/cjs/shopify/fragments/page.d.ts +0 -1
- package/dist/cjs/shopify/fragments/product.d.ts +0 -1
- package/dist/cjs/shopify/fragments/seo.d.ts +0 -1
- package/dist/cjs/shopify/fragments/variant.d.ts +0 -1
- package/dist/cjs/shopify/gql/fragment-masking.d.ts +0 -15
- package/dist/cjs/shopify/gql/gql.d.ts +0 -87
- package/dist/cjs/shopify/gql/graphql.d.ts +0 -7669
- package/dist/cjs/shopify/gql/index.d.ts +0 -3
- package/dist/cjs/shopify/hooks/index.d.ts +0 -2
- package/dist/cjs/shopify/hooks/useCreateCart.d.ts +0 -2
- package/dist/cjs/shopify/hooks/useProductsByHandles.d.ts +0 -4
- package/dist/cjs/shopify/mutations/create-cart.d.ts +0 -1
- package/dist/cjs/shopify/queries/get-product-by-handles.d.ts +0 -1
- package/dist/cjs/shopify/queries/index.d.ts +0 -1
- package/dist/cjs/shopify/src/index.d.ts +0 -5
- package/dist/cjs/shopify/tsup.config.d.ts +0 -2
- package/dist/cjs/shopify/types/article.d.ts +0 -48
- package/dist/cjs/shopify/types/cart.d.ts +0 -173
- package/dist/cjs/shopify/types/checkout.d.ts +0 -42
- package/dist/cjs/shopify/types/collection.d.ts +0 -122
- package/dist/cjs/shopify/types/common.d.ts +0 -42
- package/dist/cjs/shopify/types/config.d.ts +0 -12
- package/dist/cjs/shopify/types/customer.d.ts +0 -30
- package/dist/cjs/shopify/types/fetcher.d.ts +0 -38
- package/dist/cjs/shopify/types/index.d.ts +0 -10
- package/dist/cjs/shopify/types/page.d.ts +0 -33
- package/dist/cjs/shopify/types/product.d.ts +0 -174
- package/dist/cjs/shopify/types/search.d.ts +0 -54
- package/dist/cjs/shopify/types/site.d.ts +0 -33
- package/dist/cjs/shopify/types/type-helper.d.ts +0 -5
- package/dist/cjs/shopify/utils/colors.d.ts +0 -3
- package/dist/cjs/shopify/utils/const.d.ts +0 -76
- package/dist/cjs/shopify/utils/cookie.d.ts +0 -15
- package/dist/cjs/shopify/utils/errors.d.ts +0 -38
- package/dist/cjs/shopify/utils/fetch-graphql-api.d.ts +0 -19
- package/dist/cjs/shopify/utils/handle-fetch-response.d.ts +0 -5
- package/dist/cjs/shopify/utils/helper.d.ts +0 -28
- package/dist/cjs/shopify/utils/normalize/cart.d.ts +0 -7
- package/dist/cjs/shopify/utils/normalize/customer.d.ts +0 -3
- package/dist/cjs/shopify/utils/normalize/index.d.ts +0 -2
- package/dist/cjs/shopify/utils/normalize/metafield.d.ts +0 -5
- package/dist/cjs/shopify/utils/normalize/product.d.ts +0 -16
- package/dist/cjs/shopify/utils/store.d.ts +0 -2
- package/dist/cjs/shopify/utils/type-helper.d.ts +0 -5
- package/dist/cjs/stories/chat.stories.d.ts +0 -7
- package/dist/esm/components/chat/action.d.ts +0 -25
- package/dist/esm/components/chat/action.js +0 -2
- package/dist/esm/components/chat/action.js.map +0 -7
- package/dist/esm/components/chat/button.d.ts +0 -3
- package/dist/esm/components/chat/button.js +0 -2
- package/dist/esm/components/chat/button.js.map +0 -7
- package/dist/esm/components/chat/chatContext.d.ts +0 -101
- package/dist/esm/components/chat/chatContext.js +0 -2
- package/dist/esm/components/chat/chatContext.js.map +0 -7
- package/dist/esm/components/chat/index.d.ts +0 -71
- package/dist/esm/components/chat/index.js +0 -2
- package/dist/esm/components/chat/index.js.map +0 -7
- package/dist/esm/components/chat/markdown.d.ts +0 -5
- package/dist/esm/components/chat/markdown.js +0 -2
- package/dist/esm/components/chat/markdown.js.map +0 -7
- package/dist/esm/components/chat/messages.d.ts +0 -3
- package/dist/esm/components/chat/messages.js +0 -2
- package/dist/esm/components/chat/messages.js.map +0 -7
- package/dist/esm/components/chat/props.d.ts +0 -43
- package/dist/esm/components/chat/props.js +0 -1
- package/dist/esm/components/chat/props.js.map +0 -7
- package/dist/esm/components/chat/response.d.ts +0 -4
- package/dist/esm/components/chat/response.js +0 -2
- package/dist/esm/components/chat/response.js.map +0 -7
- package/dist/esm/components/chat/suggestions.d.ts +0 -3
- package/dist/esm/components/chat/suggestions.js +0 -2
- package/dist/esm/components/chat/suggestions.js.map +0 -7
- package/dist/esm/components/chat/utils.d.ts +0 -3
- package/dist/esm/components/chat/utils.js +0 -2
- package/dist/esm/components/chat/utils.js.map +0 -7
- package/dist/esm/components/credits/context/const.d.ts +0 -81
- package/dist/esm/components/credits/context/const.js +0 -2
- package/dist/esm/components/credits/context/const.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useActivities.d.ts +0 -12
- package/dist/esm/components/credits/context/hooks/useActivities.js +0 -2
- package/dist/esm/components/credits/context/hooks/useActivities.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useAddressValidate.d.ts +0 -34
- package/dist/esm/components/credits/context/hooks/useAddressValidate.js +0 -2
- package/dist/esm/components/credits/context/hooks/useAddressValidate.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useAlpcFetch.d.ts +0 -23
- package/dist/esm/components/credits/context/hooks/useAlpcFetch.js +0 -2
- package/dist/esm/components/credits/context/hooks/useAlpcFetch.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useClickOutside.d.ts +0 -3
- package/dist/esm/components/credits/context/hooks/useClickOutside.js +0 -2
- package/dist/esm/components/credits/context/hooks/useClickOutside.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useCopy.d.ts +0 -5
- package/dist/esm/components/credits/context/hooks/useCopy.js +0 -2
- package/dist/esm/components/credits/context/hooks/useCopy.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useCountries.d.ts +0 -8
- package/dist/esm/components/credits/context/hooks/useCountries.js +0 -2
- package/dist/esm/components/credits/context/hooks/useCountries.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useFirstPurchaseFinished.d.ts +0 -1
- package/dist/esm/components/credits/context/hooks/useFirstPurchaseFinished.js +0 -2
- package/dist/esm/components/credits/context/hooks/useFirstPurchaseFinished.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useMyRewards.d.ts +0 -14
- package/dist/esm/components/credits/context/hooks/useMyRewards.js +0 -2
- package/dist/esm/components/credits/context/hooks/useMyRewards.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useReceiptUploaded.d.ts +0 -2
- package/dist/esm/components/credits/context/hooks/useReceiptUploaded.js +0 -2
- package/dist/esm/components/credits/context/hooks/useReceiptUploaded.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.d.ts +0 -14
- package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js +0 -2
- package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useRedeemCoupon.d.ts +0 -17
- package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js +0 -2
- package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useRedeemProduct.d.ts +0 -16
- package/dist/esm/components/credits/context/hooks/useRedeemProduct.js +0 -2
- package/dist/esm/components/credits/context/hooks/useRedeemProduct.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useRedeemableList.d.ts +0 -7
- package/dist/esm/components/credits/context/hooks/useRedeemableList.js +0 -2
- package/dist/esm/components/credits/context/hooks/useRedeemableList.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useSendEmailValidation.d.ts +0 -1
- package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js +0 -2
- package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useSubscribed.d.ts +0 -1
- package/dist/esm/components/credits/context/hooks/useSubscribed.js +0 -2
- package/dist/esm/components/credits/context/hooks/useSubscribed.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useSubscriptions.d.ts +0 -5
- package/dist/esm/components/credits/context/hooks/useSubscriptions.js +0 -2
- package/dist/esm/components/credits/context/hooks/useSubscriptions.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useUploadReceipt.d.ts +0 -14
- package/dist/esm/components/credits/context/hooks/useUploadReceipt.js +0 -2
- package/dist/esm/components/credits/context/hooks/useUploadReceipt.js.map +0 -7
- package/dist/esm/components/credits/context/provider.d.ts +0 -49
- package/dist/esm/components/credits/context/provider.js +0 -2
- package/dist/esm/components/credits/context/provider.js.map +0 -7
- package/dist/esm/components/credits/context/response.d.ts +0 -63
- package/dist/esm/components/credits/context/response.js +0 -1
- package/dist/esm/components/credits/context/response.js.map +0 -7
- package/dist/esm/components/credits/context/utils.d.ts +0 -25
- package/dist/esm/components/credits/context/utils.js +0 -2
- package/dist/esm/components/credits/context/utils.js.map +0 -7
- package/dist/esm/components/credits/creditsBanner/index.d.ts +0 -23
- package/dist/esm/components/credits/creditsBanner/index.js +0 -2
- package/dist/esm/components/credits/creditsBanner/index.js.map +0 -7
- package/dist/esm/components/credits/creditsBenefits/benefitItem.d.ts +0 -19
- package/dist/esm/components/credits/creditsBenefits/benefitItem.js +0 -2
- package/dist/esm/components/credits/creditsBenefits/benefitItem.js.map +0 -7
- package/dist/esm/components/credits/creditsBenefits/iconInfo.d.ts +0 -2
- package/dist/esm/components/credits/creditsBenefits/iconInfo.js +0 -2
- package/dist/esm/components/credits/creditsBenefits/iconInfo.js.map +0 -7
- package/dist/esm/components/credits/creditsBenefits/index.d.ts +0 -12
- package/dist/esm/components/credits/creditsBenefits/index.js +0 -4
- package/dist/esm/components/credits/creditsBenefits/index.js.map +0 -7
- package/dist/esm/components/credits/creditsCash/RedeemableItem.d.ts +0 -15
- package/dist/esm/components/credits/creditsCash/RedeemableItem.js +0 -2
- package/dist/esm/components/credits/creditsCash/RedeemableItem.js.map +0 -7
- package/dist/esm/components/credits/creditsCash/index.d.ts +0 -13
- package/dist/esm/components/credits/creditsCash/index.js +0 -2
- package/dist/esm/components/credits/creditsCash/index.js.map +0 -7
- package/dist/esm/components/credits/creditsCash/type.d.ts +0 -47
- package/dist/esm/components/credits/creditsCash/type.js +0 -1
- package/dist/esm/components/credits/creditsCash/type.js.map +0 -7
- package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.d.ts +0 -13
- package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js +0 -2
- package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js.map +0 -7
- package/dist/esm/components/credits/creditsFaq/index.d.ts +0 -16
- package/dist/esm/components/credits/creditsFaq/index.js +0 -2
- package/dist/esm/components/credits/creditsFaq/index.js.map +0 -7
- package/dist/esm/components/credits/creditsInfoCard/index.d.ts +0 -20
- package/dist/esm/components/credits/creditsInfoCard/index.js +0 -2
- package/dist/esm/components/credits/creditsInfoCard/index.js.map +0 -7
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.d.ts +0 -14
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +0 -2
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +0 -7
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/FormItem.d.ts +0 -6
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/FormItem.js +0 -2
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/FormItem.js.map +0 -7
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/Input.d.ts +0 -13
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/Input.js +0 -2
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/Input.js.map +0 -7
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.d.ts +0 -15
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js +0 -2
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +0 -7
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.d.ts +0 -2
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js +0 -2
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js.map +0 -7
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/type.d.ts +0 -26
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/type.js +0 -1
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/type.js.map +0 -7
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.d.ts +0 -9
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js +0 -2
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js.map +0 -7
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.d.ts +0 -20
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js +0 -2
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +0 -7
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.d.ts +0 -8
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js +0 -2
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js.map +0 -7
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.d.ts +0 -11
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js +0 -2
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +0 -7
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.d.ts +0 -8
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +0 -2
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +0 -7
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.d.ts +0 -13
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js +0 -2
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +0 -7
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.d.ts +0 -11
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js +0 -2
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +0 -7
- package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.d.ts +0 -9
- package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js +0 -2
- package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js.map +0 -7
- package/dist/esm/components/credits/creditsRedeemList/index.d.ts +0 -13
- package/dist/esm/components/credits/creditsRedeemList/index.js +0 -2
- package/dist/esm/components/credits/creditsRedeemList/index.js.map +0 -7
- package/dist/esm/components/credits/creditsRedeemList/type.d.ts +0 -77
- package/dist/esm/components/credits/creditsRedeemList/type.js +0 -1
- package/dist/esm/components/credits/creditsRedeemList/type.js.map +0 -7
- package/dist/esm/components/credits/creditsWaysToGetCredits/index.d.ts +0 -2
- package/dist/esm/components/credits/creditsWaysToGetCredits/index.js +0 -2
- package/dist/esm/components/credits/creditsWaysToGetCredits/index.js.map +0 -7
- package/dist/esm/components/credits/creditsWaysToGetCredits/type.d.ts +0 -60
- package/dist/esm/components/credits/creditsWaysToGetCredits/type.js +0 -2
- package/dist/esm/components/credits/creditsWaysToGetCredits/type.js.map +0 -7
- package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.d.ts +0 -96
- package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js +0 -2
- package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js.map +0 -7
- package/dist/esm/components/credits/index.d.ts +0 -10
- package/dist/esm/components/credits/index.js +0 -2
- package/dist/esm/components/credits/index.js.map +0 -7
- package/dist/esm/components/credits/modal/MyRewardsModal.d.ts +0 -29
- package/dist/esm/components/credits/modal/MyRewardsModal.js +0 -2
- package/dist/esm/components/credits/modal/MyRewardsModal.js.map +0 -7
- package/dist/esm/components/credits/modal/activitiesModal.d.ts +0 -29
- package/dist/esm/components/credits/modal/activitiesModal.js +0 -2
- package/dist/esm/components/credits/modal/activitiesModal.js.map +0 -7
- package/dist/esm/components/credits/modal/creditsUploadReceiptModal.d.ts +0 -24
- package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js +0 -2
- package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js.map +0 -7
- package/dist/esm/components/credits/modal/loadingDots.d.ts +0 -5
- package/dist/esm/components/credits/modal/loadingDots.js +0 -2
- package/dist/esm/components/credits/modal/loadingDots.js.map +0 -7
- package/dist/esm/components/credits/modal/modalContainer.d.ts +0 -15
- package/dist/esm/components/credits/modal/modalContainer.js +0 -2
- package/dist/esm/components/credits/modal/modalContainer.js.map +0 -7
- package/dist/esm/components/credits/modal/rulesModal.d.ts +0 -7
- package/dist/esm/components/credits/modal/rulesModal.js +0 -2
- package/dist/esm/components/credits/modal/rulesModal.js.map +0 -7
- package/dist/esm/components/credits/modal/tip.d.ts +0 -5
- package/dist/esm/components/credits/modal/tip.js +0 -2
- package/dist/esm/components/credits/modal/tip.js.map +0 -7
- package/dist/esm/components/credits/type.d.ts +0 -55
- package/dist/esm/components/credits/type.js +0 -1
- package/dist/esm/components/credits/type.js.map +0 -7
- package/dist/esm/components/index.d.ts +0 -3
- package/dist/esm/components/index.js +0 -2
- package/dist/esm/components/index.js.map +0 -7
- package/dist/esm/debug-env.d.ts +0 -7
- package/dist/esm/helpers/fetchResponse.d.ts +0 -14
- package/dist/esm/helpers/fetchResponse.js +0 -2
- package/dist/esm/helpers/fetchResponse.js.map +0 -7
- package/dist/esm/helpers/fetcher.d.ts +0 -2
- package/dist/esm/helpers/fetcher.js +0 -2
- package/dist/esm/helpers/fetcher.js.map +0 -7
- package/dist/esm/helpers/index.d.ts +0 -2
- package/dist/esm/helpers/index.js +0 -2
- package/dist/esm/helpers/index.js.map +0 -7
- package/dist/esm/helpers/track.d.ts +0 -15
- package/dist/esm/helpers/track.js +0 -2
- package/dist/esm/helpers/track.js.map +0 -7
- package/dist/esm/helpers/utils.d.ts +0 -3
- package/dist/esm/helpers/utils.js +0 -2
- package/dist/esm/helpers/utils.js.map +0 -7
- package/dist/esm/index.css +0 -2
- package/dist/esm/index.css.map +0 -7
- package/dist/esm/index.d.ts +0 -7
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +0 -7
- package/dist/esm/package.json +0 -3
- package/dist/esm/shopify/context/ShopifyProvider.d.ts +0 -10
- package/dist/esm/shopify/fetchers/create-cart.d.ts +0 -13
- package/dist/esm/shopify/fetchers/get-products-by-handles.d.ts +0 -7
- package/dist/esm/shopify/fetchers/index.d.ts +0 -2
- package/dist/esm/shopify/fragments/article.d.ts +0 -2
- package/dist/esm/shopify/fragments/blog.d.ts +0 -1
- package/dist/esm/shopify/fragments/cart.d.ts +0 -1
- package/dist/esm/shopify/fragments/collection.d.ts +0 -1
- package/dist/esm/shopify/fragments/image.d.ts +0 -1
- package/dist/esm/shopify/fragments/index.d.ts +0 -11
- package/dist/esm/shopify/fragments/metafields.d.ts +0 -2
- package/dist/esm/shopify/fragments/page-info.d.ts +0 -1
- package/dist/esm/shopify/fragments/page.d.ts +0 -1
- package/dist/esm/shopify/fragments/product.d.ts +0 -1
- package/dist/esm/shopify/fragments/seo.d.ts +0 -1
- package/dist/esm/shopify/fragments/variant.d.ts +0 -1
- package/dist/esm/shopify/gql/fragment-masking.d.ts +0 -15
- package/dist/esm/shopify/gql/gql.d.ts +0 -87
- package/dist/esm/shopify/gql/graphql.d.ts +0 -7669
- package/dist/esm/shopify/gql/index.d.ts +0 -3
- package/dist/esm/shopify/hooks/index.d.ts +0 -2
- package/dist/esm/shopify/hooks/useCreateCart.d.ts +0 -2
- package/dist/esm/shopify/hooks/useProductsByHandles.d.ts +0 -4
- package/dist/esm/shopify/mutations/create-cart.d.ts +0 -1
- package/dist/esm/shopify/queries/get-product-by-handles.d.ts +0 -1
- package/dist/esm/shopify/queries/index.d.ts +0 -1
- package/dist/esm/shopify/src/index.d.ts +0 -5
- package/dist/esm/shopify/tsup.config.d.ts +0 -2
- package/dist/esm/shopify/types/article.d.ts +0 -48
- package/dist/esm/shopify/types/cart.d.ts +0 -173
- package/dist/esm/shopify/types/checkout.d.ts +0 -42
- package/dist/esm/shopify/types/collection.d.ts +0 -122
- package/dist/esm/shopify/types/common.d.ts +0 -42
- package/dist/esm/shopify/types/config.d.ts +0 -12
- package/dist/esm/shopify/types/customer.d.ts +0 -30
- package/dist/esm/shopify/types/fetcher.d.ts +0 -38
- package/dist/esm/shopify/types/index.d.ts +0 -10
- package/dist/esm/shopify/types/page.d.ts +0 -33
- package/dist/esm/shopify/types/product.d.ts +0 -174
- package/dist/esm/shopify/types/search.d.ts +0 -54
- package/dist/esm/shopify/types/site.d.ts +0 -33
- package/dist/esm/shopify/types/type-helper.d.ts +0 -5
- package/dist/esm/shopify/utils/colors.d.ts +0 -3
- package/dist/esm/shopify/utils/const.d.ts +0 -76
- package/dist/esm/shopify/utils/cookie.d.ts +0 -15
- package/dist/esm/shopify/utils/errors.d.ts +0 -38
- package/dist/esm/shopify/utils/fetch-graphql-api.d.ts +0 -19
- package/dist/esm/shopify/utils/handle-fetch-response.d.ts +0 -5
- package/dist/esm/shopify/utils/helper.d.ts +0 -28
- package/dist/esm/shopify/utils/normalize/cart.d.ts +0 -7
- package/dist/esm/shopify/utils/normalize/customer.d.ts +0 -3
- package/dist/esm/shopify/utils/normalize/index.d.ts +0 -2
- package/dist/esm/shopify/utils/normalize/metafield.d.ts +0 -5
- package/dist/esm/shopify/utils/normalize/product.d.ts +0 -16
- package/dist/esm/shopify/utils/store.d.ts +0 -2
- package/dist/esm/shopify/utils/type-helper.d.ts +0 -5
- package/dist/esm/stories/chat.stories.d.ts +0 -7
- package/src/shopify/MIGRATION_GUIDE.md +0 -156
- package/src/shopify/context/ShopifyProvider.tsx +0 -34
- package/src/shopify/dist/cart-BNkVu3fh.d.ts +0 -220
- package/src/shopify/dist/cart-BcrGTPdx.d.cts +0 -220
- package/src/shopify/dist/fetchers.cjs +0 -7945
- package/src/shopify/dist/fetchers.cjs.map +0 -1
- package/src/shopify/dist/fetchers.d.cts +0 -3
- package/src/shopify/dist/fetchers.d.ts +0 -3
- package/src/shopify/dist/fetchers.js +0 -7942
- package/src/shopify/dist/fetchers.js.map +0 -1
- package/src/shopify/dist/fragments.cjs +0 -731
- package/src/shopify/dist/fragments.cjs.map +0 -1
- package/src/shopify/dist/fragments.d.cts +0 -25
- package/src/shopify/dist/fragments.d.ts +0 -25
- package/src/shopify/dist/fragments.js +0 -705
- package/src/shopify/dist/fragments.js.map +0 -1
- package/src/shopify/dist/graphql-D4M28V-x.d.cts +0 -3558
- package/src/shopify/dist/graphql-D4M28V-x.d.ts +0 -3558
- package/src/shopify/dist/hooks.cjs +0 -9431
- package/src/shopify/dist/hooks.cjs.map +0 -1
- package/src/shopify/dist/hooks.d.cts +0 -14
- package/src/shopify/dist/hooks.d.ts +0 -14
- package/src/shopify/dist/hooks.js +0 -9427
- package/src/shopify/dist/hooks.js.map +0 -1
- package/src/shopify/dist/index-BTtE4HZM.d.ts +0 -42
- package/src/shopify/dist/index-BjNIecYX.d.cts +0 -42
- package/src/shopify/dist/index.cjs +0 -9642
- package/src/shopify/dist/index.cjs.map +0 -1
- package/src/shopify/dist/index.d.cts +0 -11
- package/src/shopify/dist/index.d.ts +0 -11
- package/src/shopify/dist/index.js +0 -9619
- package/src/shopify/dist/index.js.map +0 -1
- package/src/shopify/dist/product-Bqi3sqb9.d.cts +0 -262
- package/src/shopify/dist/product-DNk6jYAP.d.ts +0 -262
- package/src/shopify/dist/queries.cjs +0 -615
- package/src/shopify/dist/queries.cjs.map +0 -1
- package/src/shopify/dist/queries.d.cts +0 -3
- package/src/shopify/dist/queries.d.ts +0 -3
- package/src/shopify/dist/queries.js +0 -601
- package/src/shopify/dist/queries.js.map +0 -1
- package/src/shopify/dist/types.cjs +0 -19
- package/src/shopify/dist/types.cjs.map +0 -1
- package/src/shopify/dist/types.d.cts +0 -282
- package/src/shopify/dist/types.d.ts +0 -282
- package/src/shopify/dist/types.js +0 -1
- package/src/shopify/dist/types.js.map +0 -1
- package/src/shopify/dist/utils.cjs +0 -334
- package/src/shopify/dist/utils.cjs.map +0 -1
- package/src/shopify/dist/utils.d.cts +0 -12
- package/src/shopify/dist/utils.d.ts +0 -12
- package/src/shopify/dist/utils.js +0 -319
- package/src/shopify/dist/utils.js.map +0 -1
- package/src/shopify/fetchers/create-cart.ts +0 -40
- package/src/shopify/fetchers/get-products-by-handles.ts +0 -41
- package/src/shopify/fetchers/index.ts +0 -3
- package/src/shopify/fragments/article.ts +0 -51
- package/src/shopify/fragments/blog.ts +0 -10
- package/src/shopify/fragments/cart.ts +0 -190
- package/src/shopify/fragments/collection.ts +0 -15
- package/src/shopify/fragments/image.ts +0 -8
- package/src/shopify/fragments/index.ts +0 -11
- package/src/shopify/fragments/metafields.ts +0 -17
- package/src/shopify/fragments/page-info.ts +0 -8
- package/src/shopify/fragments/page.ts +0 -12
- package/src/shopify/fragments/product.ts +0 -71
- package/src/shopify/fragments/seo.ts +0 -6
- package/src/shopify/fragments/variant.ts +0 -29
- package/src/shopify/gql/fragment-masking.ts +0 -85
- package/src/shopify/gql/gql.ts +0 -110
- package/src/shopify/gql/graphql.ts +0 -11780
- package/src/shopify/gql/index.ts +0 -4
- package/src/shopify/hooks/index.ts +0 -2
- package/src/shopify/hooks/useCreateCart.ts +0 -24
- package/src/shopify/hooks/useProductsByHandles.ts +0 -25
- package/src/shopify/mutations/create-cart.ts +0 -16
- package/src/shopify/package.json +0 -84
- package/src/shopify/queries/get-product-by-handles.ts +0 -32
- package/src/shopify/queries/index.ts +0 -2
- package/src/shopify/src/index.ts +0 -5
- package/src/shopify/tsconfig.json +0 -25
- package/src/shopify/tsup.config.ts +0 -21
- package/src/shopify/types/article.ts +0 -46
- package/src/shopify/types/cart.ts +0 -202
- package/src/shopify/types/checkout.ts +0 -44
- package/src/shopify/types/collection.ts +0 -104
- package/src/shopify/types/common.ts +0 -53
- package/src/shopify/types/config.ts +0 -14
- package/src/shopify/types/customer.ts +0 -31
- package/src/shopify/types/fetcher.ts +0 -61
- package/src/shopify/types/index.ts +0 -10
- package/src/shopify/types/page.ts +0 -45
- package/src/shopify/types/product.ts +0 -176
- package/src/shopify/types/search.ts +0 -62
- package/src/shopify/types/site.ts +0 -38
- package/src/shopify/types/type-helper.ts +0 -5
- package/src/shopify/utils/colors.ts +0 -206
- package/src/shopify/utils/const.ts +0 -115
- package/src/shopify/utils/cookie.ts +0 -39
- package/src/shopify/utils/errors.ts +0 -65
- package/src/shopify/utils/fetch-graphql-api.ts +0 -67
- package/src/shopify/utils/handle-fetch-response.ts +0 -60
- package/src/shopify/utils/helper.ts +0 -89
- package/src/shopify/utils/normalize/cart.ts +0 -106
- package/src/shopify/utils/normalize/customer.ts +0 -18
- package/src/shopify/utils/normalize/index.ts +0 -2
- package/src/shopify/utils/normalize/metafield.ts +0 -69
- package/src/shopify/utils/normalize/product.ts +0 -193
- package/src/shopify/utils/store.ts +0 -5
- package/src/shopify/utils/type-helper.ts +0 -7
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import classNames from 'classnames'\nimport { useCallback, useEffect, useMemo, useState } from 'react'\nimport { useCreditsContext } from '../../context/provider'\nimport useCountries from '../../context/hooks/useCountries'\nimport { AlpcErrorCode } from '../../context/const'\nimport { useAddressValidate } from '../../context/hooks/useAddressValidate'\nimport { useRedeemProduct } from '../../context/hooks/useRedeemProduct'\nimport type { ModalContainerProps } from '../../modal/modalContainer'\nimport { CreditsModalContainer } from '../../modal/modalContainer'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { useShopifyContext } from '@shopify/context/ShopifyProvider'\nimport { CreditsRedeemListCopy } from '../type'\nimport { Error } from './Error'\nimport { Success } from './Success'\nimport { Address } from './Address'\nimport { Init } from './Init'\n\ntype RedeemProductModalProps = ModalContainerProps & {\n item: RedeemableItemType\n copy: CreditsRedeemListCopy\n onError: (code: AlpcErrorCode) => void\n}\n\nfunction RedeemProductModal({ item, copy, onError, ...props }: RedeemProductModalProps) {\n const { fetchCreditInfo, profile } = useCreditsContext()\n const { storeDomain, locale } = useShopifyContext()\n\n const { validatorInfo } = copy\n const { shippingAddress, shippingProduct } = copy.redeemModal.product\n\n const [status, setStatus] = useState<'init' | 'address' | 'success' | 'error'>('init')\n const [address, setAddress] = useState<any>()\n const [errorInfo, setErrorInfo] = useState({\n code: 0,\n message: '',\n imageUrl: '',\n })\n const [disabled, setDisabled] = useState(false)\n\n const { countries = [], isLoading: countriesLoading } = useCountries({ shopifyStoreDomain: storeDomain })\n\n const { isMutating: loading, trigger } = useRedeemProduct({\n onSuccess(responseData) {\n if (!responseData) {\n setStatus('error')\n setErrorInfo({\n code: 0,\n imageUrl: copy.redeemModal.errorImageUrl || '',\n message: copy.redeemModal.commonError || '',\n })\n return\n }\n\n if (responseData?.code === 0) {\n fetchCreditInfo(profile?.user_id)\n setStatus('success')\n } else {\n let errorMsg\n let errorImage\n if (responseData.code === AlpcErrorCode.CodeLpcShopifyCouponRuleRedeemLimit) {\n errorMsg = copy.redeemModal.redeemLimitError\n setDisabled(true)\n } else if (responseData.code === AlpcErrorCode.CodeLpcRuleInventoryNotEnough) {\n errorMsg = copy.redeemModal.inventoryNotEnough\n setDisabled(true)\n errorImage = copy.redeemModal.inventoryNotEnough\n } else if (responseData.code === AlpcErrorCode.CodeLpcNotEnoughCredits) {\n errorMsg = copy.redeemModal.creditsNotEnough\n setDisabled(true)\n fetchCreditInfo(profile?.user_id)\n } else if (responseData.code === AlpcErrorCode.CodeCrossSiteError) {\n errorMsg = copy.redeemModal.crossSiteError\n setDisabled(true)\n }\n\n setStatus('error')\n setErrorInfo({\n code: responseData.code,\n imageUrl: errorImage || copy.redeemModal.errorImageUrl || '',\n message: errorMsg || copy.redeemModal.commonError || '',\n })\n onError && onError(responseData.code)\n }\n },\n onError(error) {\n setStatus('error')\n setErrorInfo({\n code: 0,\n imageUrl: copy.redeemModal.errorImageUrl || '',\n message: copy.redeemModal.commonError || '',\n })\n },\n })\n\n const stateInputKey = useMemo(() => {\n const stateInput = copy?.redeemModal.product.form?.flat().find(item => item.type === 'state')\n return stateInput?.key\n }, [copy?.redeemModal.product.form])\n\n const { validate: validateAddress, errors: validateErrors } = useAddressValidate({\n address: address,\n validatorInfo: validatorInfo,\n formData: copy?.redeemModal.product.form?.flat() || [],\n errorLabel: {\n require: copy.redeemModal.product.required,\n email: copy.redeemModal.product.invalidEmail,\n },\n })\n\n const handlePayment = useCallback(async () => {\n const ignoreKeys: string[] = []\n\n if (stateInputKey) {\n const provinces = countries.find(item => item.code === address.country)?.provinces || []\n\n if (!provinces.length) {\n ignoreKeys.push(stateInputKey as never)\n }\n }\n\n if (\n validateAddress({\n force: true,\n ignoreKeys,\n })\n ) {\n // \u5730\u5740\u6821\u9A8C\u9519\u8BEF\n return\n }\n console.log('address', address)\n let requestAddress = { ...address }\n if (requestAddress.name) {\n delete requestAddress.name\n }\n if (requestAddress.country === 'UK') {\n requestAddress.country = 'GB'\n }\n trigger({\n address: btoa(JSON.stringify(requestAddress)),\n rule_id: Number(item.alpc?.id),\n })\n }, [item, trigger, stateInputKey, validateAddress, address, countries])\n\n useEffect(() => {\n if (!props.isOpen) {\n setDisabled(false)\n setErrorInfo({ code: 0, message: '', imageUrl: '' })\n }\n }, [props.isOpen, locale])\n\n return (\n <CreditsModalContainer\n {...props}\n className={classNames(\n 'w-[540px] md:h-auto min-md:max-h-[calc(100vh-40px)]',\n status !== 'init' && 'w-[740px] md:w-full'\n )}\n scrollClassName=\"mb-0 min-l:px-0 md:mb-0 px-0\"\n titleClassName={classNames('h-[56px]', status === 'init' && 'bg-[#F5F5F7]')}\n title={status === 'address' ? 'Order Confirmation' : ''}\n >\n {status === 'error' && <Error errorInfo={errorInfo} />}\n {status === 'success' && (\n <Success\n copy={copy}\n shippingProduct={shippingProduct}\n loading={loading}\n address={address}\n disabled={disabled}\n onClose={props.onClose}\n item={item}\n />\n )}\n {status === 'address' && (\n <Address\n copy={copy}\n shippingAddress={shippingAddress}\n setAddress={setAddress}\n validateAddress={validateAddress}\n validateErrors={validateErrors}\n shippingProduct={shippingProduct}\n loading={loading}\n address={address}\n disabled={disabled}\n handlePayment={handlePayment}\n item={item}\n />\n )}\n {status === 'init' && (\n <Init item={item} copy={copy} loading={loading} disabled={disabled} setStatus={setStatus} />\n )}\n </CreditsModalContainer>\n )\n}\n\nexport default RedeemProductModal\n"],
|
|
5
|
-
"mappings": "AAuJI,OAUyB,OAAAA,EAVzB,QAAAC,MAAA,oBAvJJ,OAAOC,MAAgB,aACvB,OAAS,eAAAC,EAAa,aAAAC,EAAW,WAAAC,EAAS,YAAAC,MAAgB,QAC1D,OAAS,qBAAAC,MAAyB,yBAClC,OAAOC,MAAkB,mCACzB,OAAS,iBAAAC,MAAqB,sBAC9B,OAAS,sBAAAC,MAA0B,yCACnC,OAAS,oBAAAC,MAAwB,uCAEjC,OAAS,yBAAAC,MAA6B,6BAEtC,OAAS,qBAAAC,MAAyB,mCAElC,OAAS,SAAAC,MAAa,UACtB,OAAS,WAAAC,MAAe,YACxB,OAAS,WAAAC,MAAe,YACxB,OAAS,QAAAC,MAAY,SAQrB,SAASC,EAAmB,CAAE,KAAAC,EAAM,KAAAC,EAAM,QAAAC,EAAS,GAAGC,CAAM,EAA4B,CACtF,KAAM,CAAE,gBAAAC,EAAiB,QAAAC,CAAQ,EAAIjB,EAAkB,EACjD,CAAE,YAAAkB,EAAa,OAAAC,CAAO,EAAIb,EAAkB,EAE5C,CAAE,cAAAc,CAAc,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EAAG,QAAS,GAAI,SAAU,EAAG,CAAC,EAEvD,EAAG,CAACb,EAAM,OAAQI,CAAM,CAAC,EAGvBzB,EAACW,EAAA,CACE,GAAGU,EACJ,UAAWpB,EACT,sDACA4B,IAAW,QAAU,qBACvB,EACA,gBAAgB,+BAChB,eAAgB5B,EAAW,WAAY4B,IAAW,QAAU,cAAc,EAC1E,MAAOA,IAAW,UAAY,qBAAuB,GAEpD,UAAAA,IAAW,SAAW9B,EAACc,EAAA,CAAM,UAAWoB,EAAW,EACnDJ,IAAW,WACV9B,EAACe,EAAA,CACC,KAAMK,EACN,gBAAiBS,EACjB,QAASW,EACT,QAASR,EACT,SAAUI,EACV,QAASd,EAAM,QACf,KAAMH,EACR,EAEDW,IAAW,WACV9B,EAACgB,EAAA,CACC,KAAMI,EACN,gBAAiBQ,EACjB,WAAYK,EACZ,gBAAiBc,EACjB,eAAgBC,EAChB,gBAAiBnB,EACjB,QAASW,EACT,QAASR,EACT,SAAUI,EACV,cAAea,EACf,KAAM9B,EACR,EAEDW,IAAW,QACV9B,EAACiB,EAAA,CAAK,KAAME,EAAM,KAAMC,EAAM,QAASoB,EAAS,SAAUJ,EAAU,UAAWL,EAAW,GAE9F,CAEJ,CAEA,IAAOqB,GAAQlC",
|
|
6
|
-
"names": ["jsx", "jsxs", "classNames", "useCallback", "useEffect", "useMemo", "useState", "useCreditsContext", "useCountries", "AlpcErrorCode", "useAddressValidate", "useRedeemProduct", "CreditsModalContainer", "useShopifyContext", "Error", "Success", "Address", "Init", "RedeemProductModal", "item", "copy", "onError", "props", "fetchCreditInfo", "profile", "storeDomain", "locale", "validatorInfo", "shippingAddress", "shippingProduct", "status", "setStatus", "address", "setAddress", "errorInfo", "setErrorInfo", "disabled", "setDisabled", "countries", "countriesLoading", "loading", "trigger", "responseData", "errorMsg", "errorImage", "error", "stateInputKey", "validateAddress", "validateErrors", "handlePayment", "ignoreKeys", "requestAddress", "RedeemProductModal_default"]
|
|
7
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { RedeemableItem as RedeemableItemType } from '../type';
|
|
2
|
-
import type { CreditsRedeemListCopy } from './type';
|
|
3
|
-
export declare function RedeemableItem({ copy, className, item, onRulesOpen, onRedeem, }: {
|
|
4
|
-
copy: CreditsRedeemListCopy;
|
|
5
|
-
className?: string;
|
|
6
|
-
item: RedeemableItemType;
|
|
7
|
-
onRulesOpen: (rules: string[]) => void;
|
|
8
|
-
onRedeem: (item: RedeemableItemType) => void;
|
|
9
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as l,jsxs as a}from"react/jsx-runtime";import{Button as y,Text as n,Picture as p}from"@anker-in/headless-ui";import{useMemo as c}from"react";import s from"classnames";import{useCreditsContext as N}from"../context/provider";import{AlpcConsumeType as u,ConsumeType as f}from"../context/const";import{numberFormat as C}from"../context/utils";import{gaTrack as v}from"../../../helpers/track";function E({copy:t,className:g,item:e,onRulesOpen:b,onRedeem:h}){const{creditInfo:m,profile:i,gtm:{pageGroup:x}}=N(),o=Object.keys(i||{}).length>0,_=c(()=>!!(e.alpc?.remainingInventory<=0&&e.alpc?.isLimited||e.alpc?.consumeType===u.Product&&!e.variant?.availableForSale||o&&i?.activated&&e.alpc?.consumeCredits>Number(m?.available_credit||0)),[e.alpc?.remainingInventory,e.alpc?.isLimited,e.alpc?.consumeType,e.alpc?.consumeCredits,o,i?.activated,m?.available_credit,e.variant?.availableForSale]),d=c(()=>o?e.alpc?.consumeType===u.Product?e.variant?.availableForSale?t.btnRedeem:t?.soldOut||"Sold Out":t.btnRedeem:t.unlockRewards,[o,e.alpc?.consumeType,e.variant?.availableForSale,t.btnRedeem,t.unlockRewards,t?.soldOut]);return a("div",{className:s("flex flex-col items-center rounded-[16px] bg-[#EAEAEC] p-[24px] md:rounded-[12px] md:px-[8px] xl:py-[16px] md-xl:px-[16px]",g),children:[e.config?.type!==f.Product?a("div",{className:"relative mx-auto my-[30px] h-[164px] md:my-0 md:h-[66px] l-xxl:h-[138px] md-l:h-[80px]",children:[l(p,{source:t?.imageMapping[e.config?.type]?.url,className:"h-full [&_img]:h-full [&_img]:w-auto [&_img]:object-contain"}),l("div",{className:"absolute bottom-[8px] left-[16px] font-extrabold text-white md:bottom-[2px] md:left-[5px]",children:e.config?.value?a("div",{className:"flex items-end",children:[l(n,{className:"text-[64px] font-bold leading-none md:text-[20px] l-xxl:text-[40px] md-l:text-[22px]",html:e.config?.value}),l(n,{className:"ml-[4px] text-[24px] font-bold leading-[2] md:ml-[2px] l:text-[12px] xxl:leading-[1.4] l-xxl:text-[20px]",html:e.config?.type===f.GiftCard?t?.giftCardLabel:t?.off})]}):l(n,{size:3,html:e.config?.title||e.alpc?.title})})]}):l("div",{className:s("relative mx-auto h-[224px] w-fit md:my-[10px] l:h-[120px] l-xxl:h-[138px]"),children:l(p,{className:"h-full w-auto [&_img]:h-full [&_img]:object-contain",source:e.config?.image?.url||e.product.images?.[0]?.url})}),a("div",{className:s("mt-[22px] flex w-full flex-1 flex-col justify-between"),children:[l(n,{html:e.config?.title||e.alpc?.title,title:e.config?.title||e.alpc?.title,size:2,className:"text-[24px] font-bold leading-[1.2] l:text-[16px] l-xxl:text-[20px]"}),e.config?.rules?.length>0&&l("button",{type:"button",onClick:()=>{b(e.config?.rules||[]),v({event:"ga4Event",event_name:"lp_button",member_active_status:i?.activated?"active":"not active",event_parameters:{page_group:x,position:t.title,button_name:t?.ruleLabel,info:e.alpc?.id?.toString()}})},className:"mt-[8px] w-fit text-[16px] font-bold underline md:text-[14px] l:mt-0",tabIndex:0,onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&r.preventDefault()},children:t?.ruleLabel}),a("div",{children:[a("div",{className:"mt-[24px] flex items-center l:mt-[12px] l-xl:mt-[16px]",children:[l(p,{className:"size-[20px]",source:"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/icon_hire_purchase.png?v=1757496783"}),l(n,{html:`${C(e.alpc?.consumeCredits)}`,size:2,as:"p",className:"ml-[4px] text-[28px] font-bold leading-[1.2] md:text-[18px] l-xxl:text-[24px] md-l:text-[20px] "})]}),l(y,{disabled:_,variant:"primary",size:"lg",className:"mt-[8px] md:px-[8px] l:w-full",onClick:()=>{h(e),v({event:"ga4Event",event_name:"lp_button",member_active_status:i?.activated?"active":"not active",event_parameters:{page_group:x,position:t.title,button_name:d,info:e.alpc?.id?.toString()}})},children:d})]})]})]})}export{E as RedeemableItem};
|
|
2
|
-
//# sourceMappingURL=RedeemableItem.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/components/credits/creditsRedeemList/RedeemableItem.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Button, Text, Picture } from '@anker-in/headless-ui'\n\nimport { useMemo } from 'react'\n\nimport classNames from 'classnames'\nimport { useCreditsContext } from '../context/provider'\nimport type { RedeemableItem as RedeemableItemType } from '../type'\nimport { AlpcConsumeType, ConsumeType } from '../context/const'\nimport { numberFormat } from '../context/utils'\nimport type { CreditsRedeemListCopy } from './type'\nimport { gaTrack } from '../../../helpers/track'\n\nexport function RedeemableItem({\n copy,\n className,\n item,\n onRulesOpen,\n onRedeem,\n}: {\n copy: CreditsRedeemListCopy\n className?: string\n item: RedeemableItemType\n onRulesOpen: (rules: string[]) => void\n onRedeem: (item: RedeemableItemType) => void\n}) {\n const {\n creditInfo,\n profile,\n gtm: { pageGroup },\n } = useCreditsContext()\n const isLogin = Object.keys(profile || {}).length > 0\n\n const isDisabled = useMemo(() => {\n if (item.alpc?.remainingInventory <= 0 && item.alpc?.isLimited) {\n // \u6709\u5E93\u5B58\u9650\u5236\n return true\n }\n\n if (item.alpc?.consumeType === AlpcConsumeType.Product) {\n if (!item.variant?.availableForSale) {\n return true\n }\n }\n if (isLogin && profile?.activated && item.alpc?.consumeCredits > Number(creditInfo?.available_credit || 0)) {\n return true\n }\n return false\n }, [\n item.alpc?.remainingInventory,\n item.alpc?.isLimited,\n item.alpc?.consumeType,\n item.alpc?.consumeCredits,\n isLogin,\n profile?.activated,\n creditInfo?.available_credit,\n item.variant?.availableForSale,\n ])\n\n const redeemButtonText = useMemo(() => {\n if (!isLogin) {\n return copy.unlockRewards\n }\n\n // \u7F3A\u8D27\u6587\u6848\n if (item.alpc?.consumeType === AlpcConsumeType.Product) {\n return item.variant?.availableForSale ? copy.btnRedeem : copy?.soldOut || 'Sold Out'\n }\n return copy.btnRedeem\n }, [\n isLogin,\n item.alpc?.consumeType,\n item.variant?.availableForSale,\n copy.btnRedeem,\n copy.unlockRewards,\n copy?.soldOut,\n ])\n\n return (\n <div\n className={classNames(\n 'flex flex-col items-center rounded-[16px] bg-[#EAEAEC] p-[24px] md:rounded-[12px] md:px-[8px] xl:py-[16px] md-xl:px-[16px]',\n className\n )}\n >\n {item.config?.type !== ConsumeType.Product ? (\n <div className=\"relative mx-auto my-[30px] h-[164px] md:my-0 md:h-[66px] l-xxl:h-[138px] md-l:h-[80px]\">\n <Picture\n source={copy?.imageMapping[item.config?.type]?.url}\n className=\"h-full [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n ></Picture>\n <div className=\"absolute bottom-[8px] left-[16px] font-extrabold text-white md:bottom-[2px] md:left-[5px]\">\n {item.config?.value ? (\n <div className=\"flex items-end\">\n <Text\n className=\"text-[64px] font-bold leading-none md:text-[20px] l-xxl:text-[40px] md-l:text-[22px]\"\n html={item.config?.value}\n />\n <Text\n className=\"ml-[4px] text-[24px] font-bold leading-[2] md:ml-[2px] l:text-[12px] xxl:leading-[1.4] l-xxl:text-[20px]\"\n html={item.config?.type === ConsumeType.GiftCard ? copy?.giftCardLabel : copy?.off}\n />\n </div>\n ) : (\n <Text size={3} html={item.config?.title || item.alpc?.title} />\n )}\n </div>\n </div>\n ) : (\n <div className={classNames('relative mx-auto h-[224px] w-fit md:my-[10px] l:h-[120px] l-xxl:h-[138px]')}>\n <Picture\n className=\"h-full w-auto [&_img]:h-full [&_img]:object-contain\"\n source={item.config?.image?.url || item.product.images?.[0]?.url}\n ></Picture>\n </div>\n )}\n <div className={classNames('mt-[22px] flex w-full flex-1 flex-col justify-between')}>\n <Text\n html={item.config?.title || item.alpc?.title}\n title={item.config?.title || item.alpc?.title}\n size={2}\n className=\"text-[24px] font-bold leading-[1.2] l:text-[16px] l-xxl:text-[20px]\"\n />\n {item.config?.rules?.length > 0 && (\n <button\n type=\"button\"\n onClick={() => {\n onRulesOpen(item.config?.rules || [])\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n member_active_status: profile?.activated ? 'active' : 'not active',\n event_parameters: {\n page_group: pageGroup,\n position: copy.title,\n button_name: copy?.ruleLabel,\n info: item.alpc?.id?.toString(),\n },\n })\n }}\n className=\"mt-[8px] w-fit text-[16px] font-bold underline md:text-[14px] l:mt-0\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n {copy?.ruleLabel}\n </button>\n )}\n <div>\n <div className=\"mt-[24px] flex items-center l:mt-[12px] l-xl:mt-[16px]\">\n <Picture\n className=\"size-[20px]\"\n source=\"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/icon_hire_purchase.png?v=1757496783\"\n />\n <Text\n html={`${numberFormat(item.alpc?.consumeCredits)}`}\n size={2}\n as=\"p\"\n className=\"ml-[4px] text-[28px] font-bold leading-[1.2] md:text-[18px] l-xxl:text-[24px] md-l:text-[20px] \"\n />\n </div>\n\n <Button\n disabled={isDisabled}\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[8px] md:px-[8px] l:w-full\"\n onClick={() => {\n onRedeem(item)\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n member_active_status: profile?.activated ? 'active' : 'not active',\n event_parameters: {\n page_group: pageGroup,\n position: copy.title,\n button_name: redeemButtonText,\n info: item.alpc?.id?.toString(),\n },\n })\n }}\n >\n {redeemButtonText}\n </Button>\n </div>\n </div>\n </div>\n )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X,GAAM,UACT,EAEFZ,EAAC,OACC,UAAAA,EAAC,OAAI,UAAU,yDACb,UAAAD,EAACI,EAAA,CACC,UAAU,cACV,OAAO,6FACT,EACAJ,EAACG,EAAA,CACC,KAAM,GAAGO,EAAaK,EAAK,MAAM,cAAc,CAAC,GAChD,KAAM,EACN,GAAG,IACH,UAAU,kGACZ,GACF,EAEAf,EAACE,EAAA,CACC,SAAUoB,EACV,QAAQ,UACR,KAAK,KACL,UAAU,gCACV,QAAS,IAAM,CACbL,EAASF,CAAI,EACbJ,EAAQ,CACN,MAAO,WACP,WAAY,YACZ,qBAAsBQ,GAAS,UAAY,SAAW,aACtD,iBAAkB,CAChB,WAAYC,EACZ,SAAUP,EAAK,MACf,YAAaU,EACb,KAAMR,EAAK,MAAM,IAAI,SAAS,CAChC,CACF,CAAC,CACH,EAEC,SAAAQ,EACH,GACF,GACF,GACF,CAEJ",
|
|
6
|
-
"names": ["jsx", "jsxs", "Button", "Text", "Picture", "useMemo", "classNames", "useCreditsContext", "AlpcConsumeType", "ConsumeType", "numberFormat", "gaTrack", "RedeemableItem", "copy", "className", "item", "onRulesOpen", "onRedeem", "creditInfo", "profile", "pageGroup", "isLogin", "isDisabled", "redeemButtonText", "e"]
|
|
7
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { CreditsRedeemListCopy } from './type';
|
|
2
|
-
export declare function CreditsRedeemList({ copy, className, tabClassName, hideTitle, cardClassName, activate, }: {
|
|
3
|
-
copy: CreditsRedeemListCopy;
|
|
4
|
-
className?: string;
|
|
5
|
-
tabClassName?: string;
|
|
6
|
-
hideTitle?: boolean;
|
|
7
|
-
cardClassName?: string;
|
|
8
|
-
activate: {
|
|
9
|
-
openAuthCodePopup: () => void;
|
|
10
|
-
isSuccess: boolean;
|
|
11
|
-
setOnSuccess: (callback: Function) => void;
|
|
12
|
-
};
|
|
13
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as n,jsxs as X}from"react/jsx-runtime";import{Container as F,Heading as D,Tabs as z,TabsList as H,TabsTrigger as j}from"@anker-in/headless-ui";import c from"classnames";import{useCallback as w,useMemo as L,useState as g}from"react";import B from"./RedeemCouponModal";import G from"./RedeemProductModal";import{useCreditsContext as U}from"../context/provider";import V from"../context/hooks/useRedeemableList";import{AlpcConsumeType as f,AlpcErrorCode as q}from"../context/const";import{useProductsByHandles as J}from"@shopify/hooks/useProductsByHandles";import{RedeemableItem as K}from"./RedeemableItem";import Q from"../modal/rulesModal";import{gaTrack as W}from"../../../helpers/track";function pe({copy:t,className:N="",tabClassName:k="",hideTitle:x=!1,cardClassName:_,activate:d}){const{profile:b,openSignUpPopup:I,gtm:{pageGroup:P}}=U(),S=Object.keys(b||{}).length>0,[m,E]=g(t.list[0].label),[o,l]=g(void 0),[p,C]=g(),{listLoading:O,redeemableList:R,getRedeemableList:v}=V(),r=L(()=>R.map(e=>({id:e.id.toString(),title:e.name,consumeCredits:e.consume_credits,remainingInventory:e.remaining_inventory,isLimited:!!e.is_limited,consumeType:e.consume_type,handle:e.sku_handle,sku:e.goods_sku,image:e.goods_url})),[t.list,m,R]),A=r.map(e=>e.handle),{data:T}=J({handles:A}),M=L(()=>t.list.find(s=>s.label===m)?.list.filter(s=>r.some(i=>i.id===s.id)).map(s=>{const i=r.find(a=>a.id===s.id),u=T?.find(a=>a.handle===i?.handle),y=u?.variants.find(a=>a.sku===i?.sku);return i?.consumeType===f.Product&&(!u||!y)?null:{alpc:r.find(a=>a.id===s.id),config:s,product:u,variant:y}}).filter(s=>s!==null),[r,T]),h=w(e=>{e===q.CodeLpcRuleInventoryNotEnough&&v()},[v]);return console.log("popRedeemData",o),X(F,{className:c("relative bg-[#F5F5F7]",N),children:[!x&&n(D,{as:"h2",size:"4",html:t.title}),n(z,{shape:"rounded",align:"left",className:c("sticky top-0 z-20 py-[24px] md:justify-center",k),value:m.toString(),onValueChange:e=>{E(e),W({event:"ga4Event",event_name:"lp_navigation",event_parameters:{navigation:e,page_group:P}})},children:n(H,{children:t.list.map(e=>n(j,{value:e.label,children:e.label},e.label))})}),!!r?.length&&!O&&n("div",{className:c("relative grid grid-cols-4 gap-[16px] md:grid-cols-2 md:gap-[12px] md-xl:grid-cols-3"),children:M?.map(e=>n(K,{copy:t,item:e,onRedeem:s=>{S?!b?.activated&&!d.isSuccess?(d.openAuthCodePopup(),d.setOnSuccess(()=>{l(s)})):l(s):I()},onRulesOpen:C,className:_},e?.alpc?.id))}),o?.alpc?.consumeType===f.Coupon&&t?.redeemModal?.coupon&&o&&n(B,{isOpen:!!o,item:o,copy:t,onError:h,onClose:()=>{l(void 0)}}),o?.alpc?.consumeType===f.Product&&t?.redeemModal&&o&&n(G,{isOpen:!!o,item:o,copy:t,onError:h,onClose:()=>{l(void 0)}}),p&&n(Q,{overlayClassName:"md:px-[16px] md:items-center",className:"md:h-fit md:rounded-b-[16px]",isOpen:p.length>0,onClose:()=>C([]),titleClassName:"border-b-transparent h-[56px]",rules:p,scrollClassName:"md:mt-[8px] md:mb-[24px] md:pt-0",title:t?.ruleLabel,ruleClassName:"text-[#1d1d1f] font-bold"})]})}export{pe as CreditsRedeemList};
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/components/credits/creditsRedeemList/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Container, Heading, Tabs, TabsList, TabsTrigger } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { useCallback, useMemo, useState } from 'react'\n\nimport RedeemCouponModal from './RedeemCouponModal'\nimport RedeemProductModal from './RedeemProductModal'\nimport { useCreditsContext } from '../context/provider'\nimport useRedeemableList from '../context/hooks/useRedeemableList'\nimport { AlpcConsumeType, AlpcErrorCode } from '../context/const'\nimport { useProductsByHandles } from '@shopify/hooks/useProductsByHandles'\nimport type { RedeemableItem as RedeemableItemType } from '../type'\nimport { RedeemableItem } from './RedeemableItem'\nimport RulesModal from '../modal/rulesModal'\nimport { CreditsRedeemListCopy } from './type'\nimport { gaTrack } from '../../../helpers/track'\n\nexport function CreditsRedeemList({\n copy,\n className = '',\n tabClassName = '',\n hideTitle = false,\n cardClassName,\n activate,\n}: {\n copy: CreditsRedeemListCopy\n className?: string\n tabClassName?: string\n hideTitle?: boolean\n cardClassName?: string\n activate: {\n openAuthCodePopup: () => void\n isSuccess: boolean\n setOnSuccess: (callback: Function) => void\n }\n}) {\n const {\n profile,\n openSignUpPopup,\n gtm: { pageGroup },\n } = useCreditsContext()\n const isLogin = Object.keys(profile || {}).length > 0\n\n const [activeTab, setActiveTab] = useState<string>(copy.list[0].label)\n\n const [popRedeemData, setPopRedeemData] = useState<RedeemableItemType | undefined>(undefined)\n\n const [rules, setRules] = useState<string | string[]>()\n\n const { listLoading, redeemableList, getRedeemableList } = useRedeemableList()\n\n const alpcList = useMemo(() => {\n return redeemableList.map(item => {\n return {\n id: item.id.toString(),\n title: item.name,\n consumeCredits: item.consume_credits,\n remainingInventory: item.remaining_inventory,\n isLimited: !!item.is_limited,\n consumeType: item.consume_type,\n handle: item.sku_handle,\n sku: item.goods_sku,\n image: item.goods_url,\n }\n })\n }, [copy.list, activeTab, redeemableList])\n\n const handles = alpcList.map(item => item.handle)\n const { data: products } = useProductsByHandles({ handles })\n\n const list = useMemo(() => {\n const currentList = copy.list.find(item => item.label === activeTab)\n return currentList?.list\n .filter(item => alpcList.some(alpcItem => alpcItem.id === item.id))\n .map(item => {\n const alpcItem = alpcList.find(alpcItem => alpcItem.id === item.id)\n const product = products?.find(product => product.handle === alpcItem?.handle)\n const variant = product?.variants.find(variant => variant.sku === alpcItem?.sku)\n if (alpcItem?.consumeType === AlpcConsumeType.Product && (!product || !variant)) return null\n return {\n alpc: alpcList.find(alpcItem => alpcItem.id === item.id),\n config: item,\n product,\n variant,\n }\n })\n .filter(item => item !== null) as unknown as RedeemableItemType[]\n }, [alpcList, products])\n\n const handleRedeemError = useCallback(\n (errorCode: AlpcErrorCode) => {\n if (errorCode === AlpcErrorCode.CodeLpcRuleInventoryNotEnough) {\n getRedeemableList()\n }\n },\n [getRedeemableList]\n )\n\n console.log('popRedeemData', popRedeemData)\n\n return (\n <Container className={classNames('relative bg-[#F5F5F7]', className)}>\n {!hideTitle && <Heading as=\"h2\" size=\"4\" html={copy.title} />}\n\n <Tabs\n shape=\"rounded\"\n align=\"left\"\n className={classNames('sticky top-0 z-20 py-[24px] md:justify-center', tabClassName)}\n value={activeTab.toString()}\n onValueChange={value => {\n setActiveTab(value)\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_navigation',\n event_parameters: {\n navigation: value,\n page_group: pageGroup,\n },\n })\n }}\n >\n <TabsList>\n {copy.list.map(item => (\n <TabsTrigger key={item.label} value={item.label}>\n {item.label}\n </TabsTrigger>\n ))}\n </TabsList>\n </Tabs>\n {/* PC\u7AEF */}\n {!!alpcList?.length && !listLoading && (\n <div\n className={classNames('relative grid grid-cols-4 gap-[16px] md:grid-cols-2 md:gap-[12px] md-xl:grid-cols-3')}\n >\n {list?.map(item => (\n <RedeemableItem\n key={item?.alpc?.id}\n copy={copy}\n item={item}\n onRedeem={(item: RedeemableItemType) => {\n if (!isLogin) {\n openSignUpPopup()\n } else if (!profile?.activated && !activate.isSuccess) {\n activate.openAuthCodePopup()\n activate.setOnSuccess(() => {\n setPopRedeemData(item)\n })\n } else {\n setPopRedeemData(item)\n }\n }}\n onRulesOpen={setRules}\n className={cardClassName}\n />\n ))}\n </div>\n )}\n\n {popRedeemData?.alpc?.consumeType === AlpcConsumeType.Coupon && copy?.redeemModal?.coupon && popRedeemData && (\n <RedeemCouponModal\n isOpen={!!popRedeemData}\n item={popRedeemData}\n copy={copy}\n onError={handleRedeemError}\n onClose={() => {\n setPopRedeemData(undefined)\n }}\n />\n )}\n {popRedeemData?.alpc?.consumeType === AlpcConsumeType.Product && copy?.redeemModal && popRedeemData && (\n <RedeemProductModal\n isOpen={!!popRedeemData}\n item={popRedeemData}\n copy={copy}\n onError={handleRedeemError}\n onClose={() => {\n setPopRedeemData(undefined)\n }}\n />\n )}\n {rules && (\n <RulesModal\n overlayClassName=\"md:px-[16px] md:items-center\"\n className=\"md:h-fit md:rounded-b-[16px]\"\n isOpen={rules.length > 0}\n onClose={() => setRules([])}\n titleClassName=\"border-b-transparent h-[56px]\"\n rules={rules}\n scrollClassName=\"md:mt-[8px] md:mb-[24px] md:pt-0\"\n title={copy?.ruleLabel}\n ruleClassName=\"text-[#1d1d1f] font-bold\"\n />\n )}\n </Container>\n )\n}\n"],
|
|
5
|
-
"mappings": "AAoGI,OACiB,OAAAA,EADjB,QAAAC,MAAA,oBApGJ,OAAS,aAAAC,EAAW,WAAAC,EAAS,QAAAC,EAAM,YAAAC,EAAU,eAAAC,MAAmB,wBAChE,OAAOC,MAAgB,aACvB,OAAS,eAAAC,EAAa,WAAAC,EAAS,YAAAC,MAAgB,QAE/C,OAAOC,MAAuB,sBAC9B,OAAOC,MAAwB,uBAC/B,OAAS,qBAAAC,MAAyB,sBAClC,OAAOC,MAAuB,qCAC9B,OAAS,mBAAAC,EAAiB,iBAAAC,MAAqB,mBAC/C,OAAS,wBAAAC,MAA4B,sCAErC,OAAS,kBAAAC,MAAsB,mBAC/B,OAAOC,MAAgB,sBAEvB,OAAS,WAAAC,MAAe,yBAEjB,SAASC,GAAkB,CAChC,KAAAC,EACA,UAAAC,EAAY,GACZ,aAAAC,EAAe,GACf,UAAAC,EAAY,GACZ,cAAAC,EACA,SAAAC,CACF,EAWG,CACD,KAAM,CACJ,QAAAC,EACA,gBAAAC,EACA,IAAK,CAAE,UAAAC,CAAU,CACnB,EAAIjB,EAAkB,EAChBkB,EAAU,OAAO,KAAKH,GAAW,CAAC,CAAC,EAAE,OAAS,EAE9C,CAACI,EAAWC,CAAY,EAAIvB,EAAiBY,EAAK,KAAK,CAAC,EAAE,KAAK,EAE/D,CAACY,EAAeC,CAAgB,EAAIzB,EAAyC,MA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GAAe,MAAM,cAAgBnB,EAAgB,SAAWO,GAAM,aAAeY,GACpFlC,EAACY,EAAA,CACC,OAAQ,CAAC,CAACsB,EACV,KAAMA,EACN,KAAMZ,EACN,QAAS2B,EACT,QAAS,IAAM,CACbd,EAAiB,MAAS,CAC5B,EACF,EAEDC,GACCpC,EAACmB,EAAA,CACC,iBAAiB,+BACjB,UAAU,+BACV,OAAQiB,EAAM,OAAS,EACvB,QAAS,IAAMC,EAAS,CAAC,CAAC,EAC1B,eAAe,gCACf,MAAOD,EACP,gBAAgB,mCAChB,MAAOd,GAAM,UACb,cAAc,2BAChB,GAEJ,CAEJ",
|
|
6
|
-
"names": ["jsx", "jsxs", "Container", "Heading", "Tabs", "TabsList", "TabsTrigger", "classNames", "useCallback", "useMemo", "useState", "RedeemCouponModal", "RedeemProductModal", "useCreditsContext", "useRedeemableList", "AlpcConsumeType", "AlpcErrorCode", "useProductsByHandles", "RedeemableItem", "RulesModal", "gaTrack", "CreditsRedeemList", "copy", "className", "tabClassName", "hideTitle", "cardClassName", "activate", "profile", "openSignUpPopup", "pageGroup", "isLogin", "activeTab", "setActiveTab", "popRedeemData", "setPopRedeemData", "rules", "setRules", "listLoading", "redeemableList", "getRedeemableList", "alpcList", "item", "handles", "products", "list", "alpcItem", "product", "variant", "handleRedeemError", "errorCode", "value"]
|
|
7
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { CreditsPageCommon } from '../type';
|
|
2
|
-
export type CreditsRedeemListCopy = {
|
|
3
|
-
title: string;
|
|
4
|
-
giftCardLabel: string;
|
|
5
|
-
unlockRewards: string;
|
|
6
|
-
btnRedeem: string;
|
|
7
|
-
list: {
|
|
8
|
-
label: string;
|
|
9
|
-
list: {
|
|
10
|
-
id: string;
|
|
11
|
-
type: string;
|
|
12
|
-
value: string;
|
|
13
|
-
rules: string[];
|
|
14
|
-
}[];
|
|
15
|
-
}[];
|
|
16
|
-
validatorInfo: {
|
|
17
|
-
addressInfo: {
|
|
18
|
-
name: string;
|
|
19
|
-
country: string;
|
|
20
|
-
province: string;
|
|
21
|
-
city: string;
|
|
22
|
-
address: string;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
redeemModal: {
|
|
26
|
-
confirmTitle: string;
|
|
27
|
-
confirmButton: string;
|
|
28
|
-
commonError: string;
|
|
29
|
-
redeemLimitError: string;
|
|
30
|
-
inventoryNotEnough: string;
|
|
31
|
-
creditsNotEnough: string;
|
|
32
|
-
crossSiteError: string;
|
|
33
|
-
errorImageUrl: string;
|
|
34
|
-
coupon: {
|
|
35
|
-
successDesc: string;
|
|
36
|
-
successTitle: string;
|
|
37
|
-
successButton: string;
|
|
38
|
-
successButtonUrl: string;
|
|
39
|
-
};
|
|
40
|
-
product: {
|
|
41
|
-
required: string;
|
|
42
|
-
invalidEmail: string;
|
|
43
|
-
shippingAddress: string;
|
|
44
|
-
shippingProduct: string;
|
|
45
|
-
addressForm: {
|
|
46
|
-
key: string;
|
|
47
|
-
type: string;
|
|
48
|
-
label: string;
|
|
49
|
-
isSelect: boolean;
|
|
50
|
-
required: boolean;
|
|
51
|
-
placeholder: string;
|
|
52
|
-
}[][];
|
|
53
|
-
form: {
|
|
54
|
-
key: string;
|
|
55
|
-
type: string;
|
|
56
|
-
isSelect: boolean;
|
|
57
|
-
required: boolean;
|
|
58
|
-
placeholder: string;
|
|
59
|
-
}[][];
|
|
60
|
-
successDesc: string[];
|
|
61
|
-
rules: string[];
|
|
62
|
-
steps: {
|
|
63
|
-
imageUrl: string;
|
|
64
|
-
title: string;
|
|
65
|
-
}[];
|
|
66
|
-
quantityLabel: string;
|
|
67
|
-
totalPriceLabel: string;
|
|
68
|
-
variantLabel: string;
|
|
69
|
-
shippingFeeLabel: string;
|
|
70
|
-
paymentButton: string;
|
|
71
|
-
stepTitle: string;
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
copied: string;
|
|
75
|
-
off: string;
|
|
76
|
-
copy: string;
|
|
77
|
-
} & CreditsPageCommon;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=type.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Fragment as P,jsx as t,jsxs as s}from"react/jsx-runtime";import{Button as N,Container as I,Heading as r,Picture as f,Text as L}from"@anker-in/headless-ui";import{ChevronDownIcon as T,ChevronUpIcon as D}from"@heroicons/react/24/outline";import{motion as S}from"framer-motion";import{useMemo as A,useState as B}from"react";import{TaskType as p}from"./type";import{useActions as G}from"./useActions";import{useCreditsContext as M}from"../context/provider";import{cn as w}from"../../../helpers/index";const J=({copy:i,activate:m,subscribe:h,uploadReceipt:b,classNames:g})=>{const[n,v]=B(!1),{profile:F}=M(),c=!!F,{actions:x}=G({copy:i,activate:m,subscribe:h,uploadReceipt:b}),y=A(()=>{const e=i.list.map(l=>{if(!x[l.id])return;const{finished:o,notLogin:k,notFinished:u,completed:z}=x[l.id];let d="",a,C;return c?o?(d=z.buttonLabel,a=void 0):(d=u.buttonLabel,a=u.handleClick,C=u.link):(d=k.buttonLabel,a=k.handleClick),{...l,buttonLabel:d,handleClick:a,finished:o,link:C}}).filter(Boolean);return c?e.sort((l,o)=>l?.finished&&!o?.finished?1:!l?.finished&&o?.finished?-1:0):e},[x,i.list,c]);return t(I,{id:"ways-to-get-credits",className:" bg-[#F5F5F7] [&>div]:l:!px-0",children:s("div",{className:"rounded-[16px] bg-[#1D1D1F] py-[64px] px-[140px] text-white md:px-[16px] l:rounded-none md-l:px-[32px] l-xl:px-[77px]",children:[t(r,{as:"h2",size:4,html:i?.title,className:"text-center l:pl-[16px] l:text-left"}),s("div",{className:"mt-[64px] flex items-center justify-between md:mt-[64px] l:mt-[24px] l:flex-col-reverse l:items-start md-l:mt-[32px]",children:[s("div",{className:"pl-[16px] l:mt-[40px] desktop:pl-[24px] lg-desktop:pl-[32px]",children:[t(r,{size:3,as:"h3",html:i.subtitle,className:g?.subtitle}),s("div",{className:"mt-[8px] flex items-center",children:[i.creditsIcon?.url&&t(f,{className:"size-[48px] mr-[8px] stroke-brand xl:size-[30px] [&_path]:stroke-brand",source:i.creditsIcon.url,alt:i.creditsIcon.alt||"credits"}),t(r,{html:i.equalCredits,size:4,as:"h3",className:w("mt-2 text-white md:text-[24px]",g?.equalCreditsText)})]})]}),t(f,{className:"w-full laptop:w-[50%]",source:i.mainImage?.url})]}),s("div",{className:"relative",children:[s(S.div,{className:w("relative mt-[64px] grid grid-cols-3 gap-[16px] overflow-hidden md:mt-[16px] md:grid-cols-1 l:gap-[12px] min-md:!h-auto md-l:mt-[32px] md-l:grid-cols-2"),initial:{height:512},animate:{height:n?"auto":512},transition:{duration:.3},onAnimationComplete:()=>{if(!n&&window.screen.width<768){const e=document.getElementById("ways-to-get-credits");e&&e.scrollIntoView({behavior:"smooth",block:"end"})}},children:[y.map(e=>s("div",{className:"flex min-h-[160px] flex-col justify-between rounded-[16px] bg-white p-[16px] text-[#1D1D1F] desktop:min-h-[192px] desktop:p-[24px] lg-desktop:min-h-[240px] lg-desktop:p-[32px]",children:[s("div",{children:[t(r,{as:"h4",html:e.title,size:2,className:"text-pretty"}),s("div",{className:"mt-[4px] flex items-center",children:[t(f,{className:"size-[24px] xl:size-[18px] [&_path]:size-full",source:"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/20250902-153351.png?v=1756798450"}),t(L,{as:"p",html:e.credits,size:2,className:"ml-[4px] mt-[6px] lg-desktop:text-[18px]"})]})]}),e.handleClick&&!(e.id===p.UploadReceipt&&b.isSuccess)&&!(e.id===p.Activate&&m.isSuccess)&&!(e.id===p.Subscribe&&h.isSuccess)?t(N,{as:e.link?"a":"button",...e.link&&{href:e.link},...e.handleClick&&{onClick:e.handleClick},variant:"primary",loading:e.id===p.Activate&&m.isSendingActivateEmail,size:"lg",className:"mt-[24px] w-fit",children:e.buttonLabel}):t(N,{variant:"primary",size:"lg",className:"mt-[24px] w-fit",disabled:!0,children:e.buttonLabel})]},e.id)),!n&&t("div",{className:"absolute inset-0 min-md:hidden",style:{background:"linear-gradient(180deg, rgba(29, 29, 31, 0) 66.37%, #1D1D1F 100%"}})]}),n?t("button",{className:"mx-auto mt-[12px] block w-fit min-md:hidden",onClick:()=>{v(!1)},children:t(D,{className:"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]"})}):t(P,{children:t("div",{className:"absolute bottom-0 flex w-full translate-y-1/2 justify-center min-md:hidden",children:t("button",{className:"w-fit",onClick:()=>v(!n),children:t(T,{className:"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]"})})})})]})]})})};export{J as CreditsWaysToGetCredits};
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/components/credits/creditsWaysToGetCredits/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Button, Container, Heading, Picture, Text } from '@anker-in/headless-ui'\nimport { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/24/outline'\nimport { motion } from 'framer-motion'\nimport { useMemo, useState } from 'react'\n\nimport { TaskType, type CreditsWaysToGetCreditsProps } from './type'\nimport { useActions } from './useActions'\nimport { useCreditsContext } from '../context/provider'\nimport { cn } from '../../../helpers/index'\n\nexport const CreditsWaysToGetCredits = ({\n copy,\n activate,\n subscribe,\n uploadReceipt,\n classNames,\n}: CreditsWaysToGetCreditsProps) => {\n const [showMore, setShowMore] = useState(false)\n const { profile } = useCreditsContext()\n const isLogin = !!profile\n\n const { actions } = useActions({ copy, activate, subscribe, uploadReceipt })\n\n const list = useMemo(() => {\n const list = copy.list\n .map(item => {\n if (!actions[item.id as keyof typeof actions]) {\n return undefined\n }\n const { finished, notLogin, notFinished, completed } = actions[item.id as keyof typeof actions]\n let buttonLabel = ''\n let handleClick = undefined\n let link = undefined\n if (!isLogin) {\n buttonLabel = notLogin.buttonLabel\n handleClick = notLogin.handleClick\n } else if (finished) {\n buttonLabel = completed.buttonLabel\n handleClick = undefined\n } else {\n buttonLabel = notFinished.buttonLabel\n handleClick = notFinished.handleClick\n link = (notFinished as { link: string }).link\n }\n return {\n ...item,\n buttonLabel,\n handleClick,\n finished,\n link,\n }\n })\n .filter(Boolean) as {\n title: string\n credits: string\n id: TaskType\n buttonLabel: string\n finished: boolean\n link: string\n handleClick: (() => void) | undefined\n }[]\n\n // \u767B\u5F55\u540E\uFF0C\u4FDD\u7559\u539F\u987A\u5E8F\uFF0C\u5C06\u5DF2\u5B8C\u6210\u7684\u4EFB\u52A1\u653E\u5728\u6700\u540E\n if (isLogin) {\n return list.sort((a, b) => {\n if (a?.finished && !b?.finished) {\n return 1 // a\u5DF2\u5B8C\u6210\uFF0Cb\u672A\u5B8C\u6210\uFF0Ca\u6392\u5728\u540E\u9762\n }\n if (!a?.finished && b?.finished) {\n return -1 // a\u672A\u5B8C\u6210\uFF0Cb\u5DF2\u5B8C\u6210\uFF0Ca\u6392\u5728\u524D\u9762\n }\n return 0 // \u90FD\u5DF2\u5B8C\u6210\u6216\u90FD\u672A\u5B8C\u6210\uFF0C\u4FDD\u6301\u539F\u987A\u5E8F\n })\n } else {\n return list\n }\n }, [actions, copy.list, isLogin])\n\n return (\n <Container id=\"ways-to-get-credits\" className=\" bg-[#F5F5F7] [&>div]:l:!px-0\">\n <div className=\"rounded-[16px] bg-[#1D1D1F] py-[64px] px-[140px] text-white md:px-[16px] l:rounded-none md-l:px-[32px] l-xl:px-[77px]\">\n <Heading as=\"h2\" size={4} html={copy?.title} className=\"text-center l:pl-[16px] l:text-left\" />\n <div className=\"mt-[64px] flex items-center justify-between md:mt-[64px] l:mt-[24px] l:flex-col-reverse l:items-start md-l:mt-[32px]\">\n <div className=\"pl-[16px] l:mt-[40px] desktop:pl-[24px] lg-desktop:pl-[32px]\">\n <Heading size={3} as=\"h3\" html={copy.subtitle} className={classNames?.subtitle} />\n <div className=\"mt-[8px] flex items-center\">\n {copy.creditsIcon?.url && (\n <Picture\n className=\"size-[48px] mr-[8px] stroke-brand xl:size-[30px] [&_path]:stroke-brand\"\n source={copy.creditsIcon.url}\n alt={copy.creditsIcon.alt || 'credits'}\n />\n )}\n <Heading\n html={copy.equalCredits}\n size={4}\n as=\"h3\"\n className={cn('mt-2 text-white md:text-[24px]', classNames?.equalCreditsText)}\n />\n </div>\n </div>\n <Picture className=\"w-full laptop:w-[50%]\" source={copy.mainImage?.url} />\n </div>\n\n <div className=\"relative\">\n <motion.div\n className={cn(\n 'relative mt-[64px] grid grid-cols-3 gap-[16px] overflow-hidden md:mt-[16px] md:grid-cols-1 l:gap-[12px] min-md:!h-auto md-l:mt-[32px] md-l:grid-cols-2'\n )}\n initial={{ height: 512 }}\n animate={{ height: showMore ? 'auto' : 512 }}\n transition={{ duration: 0.3 }}\n onAnimationComplete={() => {\n if (!showMore && window.screen.width < 768) {\n const section = document.getElementById('ways-to-get-credits')\n if (section) {\n section.scrollIntoView({ behavior: 'smooth', block: 'end' })\n }\n }\n }}\n >\n {list.map(item => (\n <div\n key={item.id}\n className=\"flex min-h-[160px] flex-col justify-between rounded-[16px] bg-white p-[16px] text-[#1D1D1F] desktop:min-h-[192px] desktop:p-[24px] lg-desktop:min-h-[240px] lg-desktop:p-[32px]\"\n >\n <div>\n <Heading as=\"h4\" html={item.title} size={2} className=\"text-pretty\" />\n <div className=\"mt-[4px] flex items-center\">\n <Picture\n className=\"size-[24px] xl:size-[18px] [&_path]:size-full\"\n source=\"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/20250902-153351.png?v=1756798450\"\n />\n <Text as=\"p\" html={item.credits} size={2} className=\"ml-[4px] mt-[6px] lg-desktop:text-[18px]\" />\n </div>\n </div>\n\n {item.handleClick &&\n !(item.id === TaskType.UploadReceipt && uploadReceipt.isSuccess) &&\n !(item.id === TaskType.Activate && activate.isSuccess) &&\n !(item.id === TaskType.Subscribe && subscribe.isSuccess) ? (\n <Button\n as={item.link ? 'a' : 'button'}\n {...(item.link && { href: item.link })}\n {...(item.handleClick && { onClick: item.handleClick })}\n variant=\"primary\"\n loading={item.id === TaskType.Activate && activate.isSendingActivateEmail}\n size=\"lg\"\n className=\"mt-[24px] w-fit\"\n >\n {item.buttonLabel}\n </Button>\n ) : (\n <Button variant=\"primary\" size=\"lg\" className=\"mt-[24px] w-fit\" disabled>\n {item.buttonLabel}\n </Button>\n )}\n </div>\n ))}\n {!showMore && (\n <div\n className=\"absolute inset-0 min-md:hidden\"\n style={{ background: 'linear-gradient(180deg, rgba(29, 29, 31, 0) 66.37%, #1D1D1F 100%' }}\n ></div>\n )}\n </motion.div>\n {showMore ? (\n <button\n className=\"mx-auto mt-[12px] block w-fit min-md:hidden\"\n onClick={() => {\n setShowMore(false)\n }}\n >\n <ChevronUpIcon className=\"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]\"></ChevronUpIcon>\n </button>\n ) : (\n <>\n <div className=\"absolute bottom-0 flex w-full translate-y-1/2 justify-center min-md:hidden\">\n <button className=\"w-fit\" onClick={() => setShowMore(!showMore)}>\n <ChevronDownIcon className=\"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]\"></ChevronDownIcon>\n </button>\n </div>\n </>\n )}\n </div>\n </div>\n </Container>\n )\n}\n"],
|
|
5
|
-
"mappings": "AAiFQ,OA+FI,YAAAA,EA/FJ,OAAAC,EAII,QAAAC,MAJJ,oBAjFR,OAAS,UAAAC,EAAQ,aAAAC,EAAW,WAAAC,EAAS,WAAAC,EAAS,QAAAC,MAAY,wBAC1D,OAAS,mBAAAC,EAAiB,iBAAAC,MAAqB,8BAC/C,OAAS,UAAAC,MAAc,gBACvB,OAAS,WAAAC,EAAS,YAAAC,MAAgB,QAElC,OAAS,YAAAC,MAAmD,SAC5D,OAAS,cAAAC,MAAkB,eAC3B,OAAS,qBAAAC,MAAyB,sBAClC,OAAS,MAAAC,MAAU,yBAEZ,MAAMC,EAA0B,CAAC,CACtC,KAAAC,EACA,SAAAC,EACA,UAAAC,EACA,cAAAC,EACA,WAAAC,CACF,IAAoC,CAClC,KAAM,CAACC,EAAUC,CAAW,EA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AAO,IAAM,SACrB,GAAIA,EAAK,MAAQ,CAAE,KAAMA,EAAK,IAAK,EACnC,GAAIA,EAAK,aAAe,CAAE,QAASA,EAAK,WAAY,EACrD,QAAQ,UACR,QAASA,EAAK,KAAOhB,EAAS,UAAYM,EAAS,uBACnD,KAAK,KACL,UAAU,kBAET,SAAAU,EAAK,YACR,EAEA5B,EAACE,EAAA,CAAO,QAAQ,UAAU,KAAK,KAAK,UAAU,kBAAkB,SAAQ,GACrE,SAAA0B,EAAK,YACR,IAhCGA,EAAK,EAkCZ,CACD,EACA,CAACN,GACAtB,EAAC,OACC,UAAU,iCACV,MAAO,CAAE,WAAY,kEAAmE,EACzF,GAEL,EACCsB,EACCtB,EAAC,UACC,UAAU,8CACV,QAAS,IAAM,CACbuB,EAAY,EAAK,CACnB,EAEA,SAAAvB,EAACQ,EAAA,CAAc,UAAU,kDAAkD,EAC7E,EAEAR,EAAAD,EAAA,CACE,SAAAC,EAAC,OAAI,UAAU,6EACb,SAAAA,EAAC,UAAO,UAAU,QAAQ,QAAS,IAAMuB,EAAY,CAACD,CAAQ,EAC5D,SAAAtB,EAACO,EAAA,CAAgB,UAAU,kDAAkD,EAC/E,EACF,EACF,GAEJ,GACF,EACF,CAEJ",
|
|
6
|
-
"names": ["Fragment", "jsx", "jsxs", "Button", "Container", "Heading", "Picture", "Text", "ChevronDownIcon", "ChevronUpIcon", "motion", "useMemo", "useState", "TaskType", "useActions", "useCreditsContext", "cn", "CreditsWaysToGetCredits", "copy", "activate", "subscribe", "uploadReceipt", "classNames", "showMore", "setShowMore", "profile", "isLogin", "actions", "list", "item", "finished", "notLogin", "notFinished", "completed", "buttonLabel", "handleClick", "link", "a", "b", "section"]
|
|
7
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import type { ReceiptCopy } from '../modal/creditsUploadReceiptModal';
|
|
2
|
-
export type BenefitItem = {
|
|
3
|
-
title: string;
|
|
4
|
-
credits: string;
|
|
5
|
-
id: string;
|
|
6
|
-
};
|
|
7
|
-
export type WaysToGetCreditsCopy = {
|
|
8
|
-
title: string;
|
|
9
|
-
subtitle: string;
|
|
10
|
-
equalCredits: string;
|
|
11
|
-
musicIcon: string;
|
|
12
|
-
list: BenefitItem[];
|
|
13
|
-
mainImage: {
|
|
14
|
-
url: string;
|
|
15
|
-
alt: string;
|
|
16
|
-
};
|
|
17
|
-
joinNow: string;
|
|
18
|
-
activate: string;
|
|
19
|
-
completed: string;
|
|
20
|
-
completeProfile: string;
|
|
21
|
-
makeFirstPurchase: string;
|
|
22
|
-
goShopLink: string;
|
|
23
|
-
uploadReceipt: string;
|
|
24
|
-
shopNow: string;
|
|
25
|
-
subscribe: string;
|
|
26
|
-
sendEmailSuccess: string;
|
|
27
|
-
creditsIcon: {
|
|
28
|
-
url: string;
|
|
29
|
-
alt: string;
|
|
30
|
-
};
|
|
31
|
-
receipt: ReceiptCopy;
|
|
32
|
-
};
|
|
33
|
-
export declare enum TaskType {
|
|
34
|
-
Activate = "activate",
|
|
35
|
-
Subscribe = "subscribe",
|
|
36
|
-
CompleteProfile = "completeProfile",
|
|
37
|
-
FirstPurchase = "firstPurchase",
|
|
38
|
-
UploadReceipt = "uploadReceipt",
|
|
39
|
-
Shop = "shop"
|
|
40
|
-
}
|
|
41
|
-
export type CreditsWaysToGetCreditsProps = {
|
|
42
|
-
copy: WaysToGetCreditsCopy;
|
|
43
|
-
classNames?: {
|
|
44
|
-
equalCreditsText?: string;
|
|
45
|
-
subtitle?: string;
|
|
46
|
-
};
|
|
47
|
-
activate: {
|
|
48
|
-
openAuthCodePopup: () => void;
|
|
49
|
-
isSuccess: boolean;
|
|
50
|
-
isSendingActivateEmail: boolean;
|
|
51
|
-
};
|
|
52
|
-
subscribe: {
|
|
53
|
-
openSubscribePopup: () => void;
|
|
54
|
-
isSuccess: boolean;
|
|
55
|
-
};
|
|
56
|
-
uploadReceipt: {
|
|
57
|
-
openUploadReceiptPopup: () => void;
|
|
58
|
-
isSuccess: boolean;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/components/credits/creditsWaysToGetCredits/type.ts"],
|
|
4
|
-
"sourcesContent": ["import type { ReceiptCopy } from '../modal/creditsUploadReceiptModal'\n\nexport type BenefitItem = {\n title: string\n credits: string\n id: string\n}\n\nexport type WaysToGetCreditsCopy = {\n title: string\n subtitle: string\n equalCredits: string\n musicIcon: string\n list: BenefitItem[]\n mainImage: {\n url: string\n alt: string\n }\n joinNow: string\n activate: string\n completed: string\n completeProfile: string\n makeFirstPurchase: string\n goShopLink: string\n uploadReceipt: string\n shopNow: string\n subscribe: string\n sendEmailSuccess: string\n creditsIcon: {\n url: string\n alt: string\n }\n receipt: ReceiptCopy\n}\n\nexport enum TaskType {\n Activate = 'activate',\n Subscribe = 'subscribe',\n CompleteProfile = 'completeProfile',\n FirstPurchase = 'firstPurchase',\n UploadReceipt = 'uploadReceipt',\n Shop = 'shop',\n}\n\nexport type CreditsWaysToGetCreditsProps = {\n copy: WaysToGetCreditsCopy\n classNames?: {\n equalCreditsText?: string\n subtitle?: string\n }\n activate: {\n openAuthCodePopup: () => void\n isSuccess: boolean\n isSendingActivateEmail: boolean\n }\n subscribe: {\n openSubscribePopup: () => void\n isSuccess: boolean\n }\n uploadReceipt: {\n openUploadReceiptPopup: () => void\n isSuccess: boolean\n }\n}\n"],
|
|
5
|
-
"mappings": "AAmCO,IAAKA,OACVA,EAAA,SAAW,WACXA,EAAA,UAAY,YACZA,EAAA,gBAAkB,kBAClBA,EAAA,cAAgB,gBAChBA,EAAA,cAAgB,gBAChBA,EAAA,KAAO,OANGA,OAAA",
|
|
6
|
-
"names": ["TaskType"]
|
|
7
|
-
}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import type { CreditsWaysToGetCreditsProps } from './type';
|
|
2
|
-
export declare const useActions: ({ copy, subscribe, uploadReceipt, activate, gaParameters, }: CreditsWaysToGetCreditsProps & {
|
|
3
|
-
gaParameters?: {
|
|
4
|
-
position: string;
|
|
5
|
-
};
|
|
6
|
-
}) => {
|
|
7
|
-
actions: {
|
|
8
|
-
activate: {
|
|
9
|
-
finished: any;
|
|
10
|
-
notLogin: {
|
|
11
|
-
buttonLabel: string;
|
|
12
|
-
handleClick: () => void;
|
|
13
|
-
};
|
|
14
|
-
notFinished: {
|
|
15
|
-
buttonLabel: string;
|
|
16
|
-
handleClick: () => void;
|
|
17
|
-
};
|
|
18
|
-
completed: {
|
|
19
|
-
buttonLabel: string;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
subscribe: {
|
|
23
|
-
finished: boolean;
|
|
24
|
-
notLogin: {
|
|
25
|
-
buttonLabel: string;
|
|
26
|
-
handleClick: () => void;
|
|
27
|
-
};
|
|
28
|
-
notFinished: {
|
|
29
|
-
buttonLabel: string;
|
|
30
|
-
handleClick: () => void;
|
|
31
|
-
};
|
|
32
|
-
completed: {
|
|
33
|
-
buttonLabel: string;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
completeProfile: {
|
|
37
|
-
finished: any;
|
|
38
|
-
notLogin: {
|
|
39
|
-
buttonLabel: string;
|
|
40
|
-
handleClick: () => void;
|
|
41
|
-
};
|
|
42
|
-
notFinished: {
|
|
43
|
-
buttonLabel: string;
|
|
44
|
-
link: string;
|
|
45
|
-
handleClick: () => void;
|
|
46
|
-
};
|
|
47
|
-
completed: {
|
|
48
|
-
buttonLabel: string;
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
firstPurchase: {
|
|
52
|
-
finished: boolean;
|
|
53
|
-
notLogin: {
|
|
54
|
-
buttonLabel: string;
|
|
55
|
-
handleClick: () => void;
|
|
56
|
-
};
|
|
57
|
-
notFinished: {
|
|
58
|
-
buttonLabel: string;
|
|
59
|
-
link: string;
|
|
60
|
-
handleClick: () => void;
|
|
61
|
-
};
|
|
62
|
-
completed: {
|
|
63
|
-
buttonLabel: string;
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
uploadReceipt: {
|
|
67
|
-
finished: boolean;
|
|
68
|
-
notLogin: {
|
|
69
|
-
buttonLabel: string;
|
|
70
|
-
handleClick: () => void;
|
|
71
|
-
};
|
|
72
|
-
notFinished: {
|
|
73
|
-
buttonLabel: string;
|
|
74
|
-
handleClick: () => void;
|
|
75
|
-
};
|
|
76
|
-
completed: {
|
|
77
|
-
buttonLabel: string;
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
|
-
shop: {
|
|
81
|
-
finished: boolean;
|
|
82
|
-
notLogin: {
|
|
83
|
-
buttonLabel: string;
|
|
84
|
-
handleClick: () => void;
|
|
85
|
-
};
|
|
86
|
-
notFinished: {
|
|
87
|
-
buttonLabel: string;
|
|
88
|
-
link: string;
|
|
89
|
-
handleClick: () => void;
|
|
90
|
-
};
|
|
91
|
-
completed: {
|
|
92
|
-
buttonLabel: string;
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
};
|
|
96
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{TaskType as t}from"./type";import{useCreditsContext as L}from"../context/provider";import{useMemo as d}from"react";import C from"../context/hooks/useReceiptUploaded";import{useFirstPurchaseFinished as P}from"../context/hooks/useFirstPurchaseFinished";import{useSubscribed as g}from"../context/hooks/useSubscribed";import{useShopifyContext as v}from"@shopify/context/ShopifyProvider";import{gaTrack as F}from"../../../helpers/track";const x=({copy:e,subscribe:u,uploadReceipt:c,activate:m,gaParameters:n})=>{const{openSignUpPopup:a,gtm:p,profile:o}=L(),l=g(),s=P(),b=C(),{appName:h}=v(),r=d(()=>(o?.first_name||o?.last_name)&&o?.phone_number&&o?.dob,[o]);return d(()=>{const i=({buttonName:k,id:f,callback:N})=>{F({event:"ga4Event",event_name:"lp_button",member_active_status:o?.activated?"active":"not active",event_parameters:{page_group:p.pageGroup,position:n?.position||e.title,button_name:k,info:f}}),N()};return{actions:{[t.Activate]:{finished:o?.activated,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>i({buttonName:e?.joinNow,callback:a,id:t.Activate})},notFinished:{buttonLabel:e?.activate,handleClick:()=>i({buttonName:e?.activate,callback:()=>m.openAuthCodePopup(),id:t.Activate})},completed:{buttonLabel:e?.completed}},[t.Subscribe]:{finished:l,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>i({buttonName:e?.joinNow,callback:a,id:t.Subscribe})},notFinished:{buttonLabel:e?.subscribe,handleClick:()=>i({buttonName:e?.subscribe,callback:()=>u.openSubscribePopup(),id:t.Subscribe})},completed:{buttonLabel:e?.completed}},[t.CompleteProfile]:{finished:r,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>i({buttonName:e?.joinNow,callback:a,id:t.CompleteProfile})},notFinished:{buttonLabel:e?.completeProfile,link:`/account/profile?app=${h}`,handleClick:()=>i({buttonName:e?.completeProfile,callback:()=>{},id:t.CompleteProfile})},completed:{buttonLabel:e?.completed}},[t.FirstPurchase]:{finished:s,notLogin:{buttonLabel:e?.makeFirstPurchase,handleClick:()=>i({buttonName:e?.makeFirstPurchase,callback:a,id:t.FirstPurchase})},notFinished:{buttonLabel:e?.makeFirstPurchase,link:e?.goShopLink,handleClick:()=>i({buttonName:e?.makeFirstPurchase,callback:()=>{},id:t.FirstPurchase})},completed:{buttonLabel:e?.completed}},[t.UploadReceipt]:{finished:b,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>i({buttonName:e?.joinNow,callback:a,id:t.UploadReceipt})},notFinished:{buttonLabel:e?.uploadReceipt,handleClick:()=>i({buttonName:e?.uploadReceipt,callback:()=>c.openUploadReceiptPopup(),id:t.UploadReceipt})},completed:{buttonLabel:e?.completed}},[t.Shop]:{finished:!1,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>i({buttonName:e?.joinNow,callback:a,id:t.Shop})},notFinished:{buttonLabel:e?.shopNow,link:e?.goShopLink,handleClick:()=>i({buttonName:e?.shopNow,callback:()=>{},id:t.Shop})},completed:{buttonLabel:e?.completed}}}}},[o?.activated,e?.joinNow,e?.activate,e?.completed,e?.subscribe,e?.completeProfile,e?.makeFirstPurchase,e?.uploadReceipt,e?.shopNow,e.title,e?.goShopLink,l,r,s,b,n?.position,a])};export{x as useActions};
|
|
2
|
-
//# sourceMappingURL=useActions.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/components/credits/creditsWaysToGetCredits/useActions.ts"],
|
|
4
|
-
"sourcesContent": ["import { TaskType } from './type'\nimport { useCreditsContext } from '../context/provider'\nimport { useMemo } from 'react'\nimport useReceiptUploaded from '../context/hooks/useReceiptUploaded'\nimport { useFirstPurchaseFinished } from '../context/hooks/useFirstPurchaseFinished'\nimport { useSubscribed } from '../context/hooks/useSubscribed'\nimport type { CreditsWaysToGetCreditsProps } from './type'\nimport { useShopifyContext } from '@shopify/context/ShopifyProvider'\nimport { gaTrack } from '../../../helpers/track'\n\nexport const useActions = ({\n copy,\n subscribe,\n uploadReceipt,\n activate,\n gaParameters,\n}: CreditsWaysToGetCreditsProps & {\n gaParameters?: {\n position: string\n }\n}) => {\n const { openSignUpPopup, gtm, profile } = useCreditsContext()\n const isSubscribed = useSubscribed()\n const firstPurchaseFinished = useFirstPurchaseFinished()\n const uploadedReceipt = useReceiptUploaded()\n const { appName } = useShopifyContext()\n\n const profileCompleted = useMemo(() => {\n return (profile?.first_name || profile?.last_name) && profile?.phone_number && profile?.dob\n }, [profile])\n\n return useMemo(() => {\n const handleClickWithTrack = ({\n buttonName,\n id,\n callback,\n }: {\n buttonName: string\n id?: string\n callback: () => void\n }) => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n member_active_status: profile?.activated ? 'active' : 'not active',\n event_parameters: {\n page_group: gtm.pageGroup,\n position: gaParameters?.position || copy.title,\n button_name: buttonName,\n info: id,\n },\n })\n callback()\n }\n return {\n actions: {\n [TaskType.Activate]: {\n finished: profile?.activated,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({ buttonName: copy?.joinNow, callback: openSignUpPopup, id: TaskType.Activate }),\n },\n notFinished: {\n buttonLabel: copy?.activate,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.activate,\n callback: () => activate.openAuthCodePopup(),\n id: TaskType.Activate,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.Subscribe]: {\n finished: isSubscribed,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({ buttonName: copy?.joinNow, callback: openSignUpPopup, id: TaskType.Subscribe }),\n },\n notFinished: {\n buttonLabel: copy?.subscribe,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.subscribe,\n callback: () => subscribe.openSubscribePopup(),\n id: TaskType.Subscribe,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.CompleteProfile]: {\n finished: profileCompleted,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.joinNow,\n callback: openSignUpPopup,\n id: TaskType.CompleteProfile,\n }),\n },\n notFinished: {\n buttonLabel: copy?.completeProfile,\n link: `/account/profile?app=${appName}`,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.completeProfile,\n callback: () => {},\n id: TaskType.CompleteProfile,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.FirstPurchase]: {\n finished: firstPurchaseFinished,\n notLogin: {\n buttonLabel: copy?.makeFirstPurchase,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.makeFirstPurchase,\n callback: openSignUpPopup,\n id: TaskType.FirstPurchase,\n }),\n },\n notFinished: {\n buttonLabel: copy?.makeFirstPurchase,\n link: copy?.goShopLink,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.makeFirstPurchase,\n callback: () => {},\n id: TaskType.FirstPurchase,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.UploadReceipt]: {\n finished: uploadedReceipt,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.joinNow,\n callback: openSignUpPopup,\n id: TaskType.UploadReceipt,\n }),\n },\n notFinished: {\n buttonLabel: copy?.uploadReceipt,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.uploadReceipt,\n callback: () => uploadReceipt.openUploadReceiptPopup(),\n id: TaskType.UploadReceipt,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.Shop]: {\n finished: false,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.joinNow,\n callback: openSignUpPopup,\n id: TaskType.Shop,\n }),\n },\n notFinished: {\n buttonLabel: copy?.shopNow,\n link: copy?.goShopLink,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.shopNow,\n callback: () => {},\n id: TaskType.Shop,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n },\n }\n }, [\n profile?.activated,\n copy?.joinNow,\n copy?.activate,\n copy?.completed,\n copy?.subscribe,\n copy?.completeProfile,\n copy?.makeFirstPurchase,\n copy?.uploadReceipt,\n copy?.shopNow,\n copy.title,\n copy?.goShopLink,\n isSubscribed,\n profileCompleted,\n firstPurchaseFinished,\n uploadedReceipt,\n gaParameters?.position,\n openSignUpPopup,\n ])\n}\n"],
|
|
5
|
-
"mappings": "AAAA,OAAS,YAAAA,MAAgB,SACzB,OAAS,qBAAAC,MAAyB,sBAClC,OAAS,WAAAC,MAAe,QACxB,OAAOC,MAAwB,sCAC/B,OAAS,4BAAAC,MAAgC,4CACzC,OAAS,iBAAAC,MAAqB,iCAE9B,OAAS,qBAAAC,MAAyB,mCAClC,OAAS,WAAAC,MAAe,yBAEjB,MAAMC,EAAa,CAAC,CACzB,KAAAC,EACA,UAAAC,EACA,cAAAC,EACA,SAAAC,EACA,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,YAAaS,GAAM,QACnB,YAAa,IACXa,EAAqB,CACnB,WAAYb,GAAM,QAClB,SAAUK,EACV,GAAId,EAAS,IACf,CAAC,CACL,EACA,YAAa,CACX,YAAaS,GAAM,QACnB,KAAMA,GAAM,WACZ,YAAa,IACXa,EAAqB,CACnB,WAAYb,GAAM,QAClB,SAAU,IAAM,CAAC,EACjB,GAAIT,EAAS,IACf,CAAC,CACL,EACA,UAAW,CACT,YAAaS,GAAM,SACrB,CACF,CACF,CACF,CACF,EAAG,CACDO,GAAS,UACTP,GAAM,QACNA,GAAM,SACNA,GAAM,UACNA,GAAM,UACNA,GAAM,gBACNA,GAAM,kBACNA,GAAM,cACNA,GAAM,QACNA,EAAK,MACLA,GAAM,WACNQ,EACAI,EACAH,EACAC,EACAN,GAAc,SACdC,CACF,CAAC,CACH",
|
|
6
|
-
"names": ["TaskType", "useCreditsContext", "useMemo", "useReceiptUploaded", "useFirstPurchaseFinished", "useSubscribed", "useShopifyContext", "gaTrack", "useActions", "copy", "subscribe", "uploadReceipt", "activate", "gaParameters", "openSignUpPopup", "gtm", "profile", "isSubscribed", "firstPurchaseFinished", "uploadedReceipt", "appName", "profileCompleted", "handleClickWithTrack", "buttonName", "id", "callback"]
|
|
7
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { CreditsProvider, useCreditsContext } from './context/provider';
|
|
2
|
-
export { useUploadReceipt as useCreditsUploadReceipt } from './context/hooks/useUploadReceipt';
|
|
3
|
-
export { CreditsUploadReceiptModal } from './modal/creditsUploadReceiptModal';
|
|
4
|
-
export { CreditsBanner } from './creditsBanner';
|
|
5
|
-
export { CreditsBenefits } from './creditsBenefits';
|
|
6
|
-
export { CreditsInfoCard } from './creditsInfoCard';
|
|
7
|
-
export { CreditsWaysToGetCredits } from './creditsWaysToGetCredits';
|
|
8
|
-
export { CreditsFaq } from './creditsFaq';
|
|
9
|
-
export { CreditsCash } from './creditsCash';
|
|
10
|
-
export { CreditsRedeemList } from './creditsRedeemList';
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{CreditsProvider as t,useCreditsContext as o}from"./context/provider";import{useUploadReceipt as d}from"./context/hooks/useUploadReceipt";import{CreditsUploadReceiptModal as p}from"./modal/creditsUploadReceiptModal";import{CreditsBanner as f}from"./creditsBanner";import{CreditsBenefits as x}from"./creditsBenefits";import{CreditsInfoCard as n}from"./creditsInfoCard";import{CreditsWaysToGetCredits as R}from"./creditsWaysToGetCredits";import{CreditsFaq as u}from"./creditsFaq";import{CreditsCash as B}from"./creditsCash";import{CreditsRedeemList as q}from"./creditsRedeemList";export{f as CreditsBanner,x as CreditsBenefits,B as CreditsCash,u as CreditsFaq,n as CreditsInfoCard,t as CreditsProvider,q as CreditsRedeemList,p as CreditsUploadReceiptModal,R as CreditsWaysToGetCredits,o as useCreditsContext,d as useCreditsUploadReceipt};
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/components/credits/index.ts"],
|
|
4
|
-
"sourcesContent": ["export { CreditsProvider, useCreditsContext } from './context/provider'\n\nexport { useUploadReceipt as useCreditsUploadReceipt } from './context/hooks/useUploadReceipt'\nexport { CreditsUploadReceiptModal } from './modal/creditsUploadReceiptModal'\nexport { CreditsBanner } from './creditsBanner'\nexport { CreditsBenefits } from './creditsBenefits'\nexport { CreditsInfoCard } from './creditsInfoCard'\nexport { CreditsWaysToGetCredits } from './creditsWaysToGetCredits'\nexport { CreditsFaq } from './creditsFaq'\nexport { CreditsCash } from './creditsCash'\nexport { CreditsRedeemList } from './creditsRedeemList'\n"],
|
|
5
|
-
"mappings": "AAAA,OAAS,mBAAAA,EAAiB,qBAAAC,MAAyB,qBAEnD,OAA6B,oBAApBC,MAAmD,mCAC5D,OAAS,6BAAAC,MAAiC,oCAC1C,OAAS,iBAAAC,MAAqB,kBAC9B,OAAS,mBAAAC,MAAuB,oBAChC,OAAS,mBAAAC,MAAuB,oBAChC,OAAS,2BAAAC,MAA+B,4BACxC,OAAS,cAAAC,MAAkB,eAC3B,OAAS,eAAAC,MAAmB,gBAC5B,OAAS,qBAAAC,MAAyB",
|
|
6
|
-
"names": ["CreditsProvider", "useCreditsContext", "useUploadReceipt", "CreditsUploadReceiptModal", "CreditsBanner", "CreditsBenefits", "CreditsInfoCard", "CreditsWaysToGetCredits", "CreditsFaq", "CreditsCash", "CreditsRedeemList"]
|
|
7
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { type ModalContainerProps } from './modalContainer';
|
|
2
|
-
export interface MyRewardsMetafields {
|
|
3
|
-
title: string;
|
|
4
|
-
orderNumberLabel: string;
|
|
5
|
-
valueLabel: string;
|
|
6
|
-
receivedLabel: string;
|
|
7
|
-
failedLabel: string;
|
|
8
|
-
approveSuccessLabel: string;
|
|
9
|
-
couponTab: string;
|
|
10
|
-
productTab: string;
|
|
11
|
-
pendingLabel: string;
|
|
12
|
-
unfulfilledLabel: string;
|
|
13
|
-
fulfilledLabel: string;
|
|
14
|
-
confirmedTip: string;
|
|
15
|
-
pendingTip: string;
|
|
16
|
-
processingTip: string;
|
|
17
|
-
ShippedTip: string;
|
|
18
|
-
emptyListImageUrl: string;
|
|
19
|
-
emptyListLabel: string;
|
|
20
|
-
pointUnit: string;
|
|
21
|
-
code: string;
|
|
22
|
-
copied: string;
|
|
23
|
-
copy: string;
|
|
24
|
-
}
|
|
25
|
-
interface MyRewardsModalProps extends ModalContainerProps {
|
|
26
|
-
data: MyRewardsMetafields;
|
|
27
|
-
}
|
|
28
|
-
declare function MyRewardsModal({ data, ...props }: MyRewardsModalProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
-
export default MyRewardsModal;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as i,jsxs as r}from"react/jsx-runtime";import{Tabs as j,TabsList as E,TabsTrigger as $,Picture as z}from"@anker-in/headless-ui";import M from"classnames";import H from"copy-to-clipboard";import K from"dayjs";import{useCallback as w,useMemo as p,useState as u}from"react";import{ApprovalStatus as m,AlpcConsumeType as n,RewardType as t}from"../context/const";import{CreditsModalContainer as V}from"./modalContainer";import q from"./tip";import B from"./loadingDots";import S from"../context/hooks/useMyRewards";function G({data:o,...a}){const[l,R]=u(n.Coupon),[d,F]=u(1),[c,h]=u(1),[_,g]=u(-1),A=p(()=>{const e=[];return o.couponTab&&e.push({title:o.couponTab,type:n.Coupon}),o.productTab&&e.push({title:o.productTab,type:n.Product}),e},[o.couponTab,o.productTab]),D=p(()=>({page:a.isOpen?c:0,pageSize:1e3,consumeType:n.Product}),[a.isOpen,c]),O=p(()=>({page:a.isOpen?d:0,pageSize:1e3,consumeType:n.Coupon}),[a.isOpen,d]),{myRewards:v=[],canNext:b,isLoading:x}=S(O),{myRewards:y=[],canNext:C,isLoading:T}=S(D),N=p(()=>l===n.Coupon?v.map(e=>({title:e.goods_title,value:e.consume_credits,type:t.Received,date:new Date(e.create_time*1e3),couponCode:e.coupon_code,orderNumber:""})):l===n.Product?y.map(e=>{let s=t.Pending;return e.fulfillment_status&&e.fulfillment_status!=="null"?e.fulfillment_status==="fulfilled"?s=t.Fulfilled:s=t.Unfulfilled:e.approval_status===m.Success||e.approval_status===m.DoubleConfirm?s=t.ApproveSuccess:e.approval_status===m.Failed&&(s=t.Failed),{title:e.goods_title,value:e.consume_credits,type:s,date:new Date(e.create_time*1e3),orderNumber:e.order_number,couponCode:""}}):[],[l,y,v]),L=p(()=>l===n.Coupon?b:l===n.Product?C:!1,[l,b,C]),U=p(()=>({[t.Received]:o.receivedLabel,[t.Pending]:o.pendingLabel,[t.ApproveFail]:o.failedLabel,[t.ApproveSuccess]:o.approveSuccessLabel,[t.Unfulfilled]:o.unfulfilledLabel,[t.Fulfilled]:o.fulfilledLabel,[t.Failed]:o.failedLabel}),[o]),P=p(()=>({[t.Received]:"",[t.Pending]:o.pendingTip,[t.ApproveFail]:"",[t.ApproveSuccess]:o.confirmedTip,[t.Unfulfilled]:o.processingTip,[t.Fulfilled]:o.ShippedTip,[t.Failed]:""}),[o]),k=p(()=>({[t.Received]:"#52C41A",[t.Pending]:"#999",[t.ApproveFail]:"#F84D4F",[t.ApproveSuccess]:"#999",[t.Unfulfilled]:"#999",[t.Fulfilled]:"#999",[t.Failed]:"#F84D4F"}),[]),I=w(()=>{L&&(l===n.Coupon?F(d+1):l===n.Product&&h(c+1))},[l,c,d,L]),Y=w((e,s)=>{g(s),H(e),setTimeout(()=>{g(-1)},2e3)},[]);return r(V,{title:o.title,className:M("h-[800px] w-[640px]"),useAnimation:!0,animationClassName:"md:translate-y-[100vh]",scrollClassName:"min-l:px-0 md:mb-0 md:px-0",...a,onScrollEnd:I,children:[i("div",{className:"px-[24px] md:px-[16px]",children:i(j,{align:"left",shape:"rounded",value:l.toString(),onValueChange:e=>{R(Number(e))},children:i(E,{children:A.map(e=>i($,{value:e.type.toString(),children:e.title},e.type))})})}),r("div",{className:"mt-[24px] overflow-auto overscroll-contain px-[24px] md:px-[16px]",children:[!N.length&&!x&&!T&&r("div",{className:"flex h-full flex-col items-center justify-center",children:[i(z,{className:"mb-[12px] w-[160px]",src:o?.emptyListImageUrl}),i("div",{className:"text-[16px] font-semibold leading-[1.4]",children:o?.emptyListLabel})]}),x||T&&i("div",{className:"flex h-full flex-col items-center justify-center",children:i(B,{})}),i("div",{className:"grid gap-[18px] md:gap-[12px]",children:N.map((e,s)=>r("div",{className:"grid gap-[8px]",children:[e?.orderNumber&&r("div",{className:"text-[15px] font-semibold leading-[1.4] text-[#777]",children:[o.orderNumberLabel,": ",e.orderNumber]}),r("div",{className:"flex items-center justify-between rounded-[8px] bg-[#f7f8f9] px-[16px] py-[20px]",children:[r("div",{className:"grid gap-[4px]",children:[i("div",{className:"text-[16px] font-bold leading-[1.4]",children:e.title}),r("div",{className:"text-[14px] font-semibold text-[#999]",children:[o.valueLabel,": ",e.value," ",o?.pointUnit]}),r("div",{className:"text-[14px] font-semibold text-[#999]",children:[e?.couponCode?`${o?.code||"Code"}: ${e.couponCode} `:"",e?.couponCode&&i("span",{className:"cursor-pointer text-[14px] font-semibold text-brand underline",onClick:()=>{Y(e.couponCode,s)},role:"button",tabIndex:0,onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&f.preventDefault()},children:_===s?o?.copied||"COPIED":o?.copy||"COPY"})]})]}),r("div",{className:"grid gap-[4px] text-right",children:[r("div",{className:M("flex items-center justify-end text-[16px] font-bold leading-[1.4]",`text-[${k[e.type]}]`),children:[i("span",{children:U[e.type]}),P[e.type]&&i(q,{info:P[e.type],index:s})]}),i("div",{className:"text-[14px] font-semibold text-[#999]",children:K(e.date).format("YYYY-MM-DD HH:mm").toString()})]})]})]},s))})]})]})}var ne=G;export{ne as default};
|
|
2
|
-
//# sourceMappingURL=MyRewardsModal.js.map
|