@anker-in/campaign-ui 0.3.5 → 0.4.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/credits/context/const.d.ts +10 -2
- package/dist/cjs/components/credits/context/const.js +1 -1
- package/dist/cjs/components/credits/context/const.js.map +2 -2
- package/dist/cjs/components/credits/context/hooks/useMyRewards.js +1 -1
- package/dist/cjs/components/credits/context/hooks/useMyRewards.js.map +3 -3
- package/dist/cjs/components/credits/context/hooks/useRedeemGoGift.d.ts +17 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemGoGift.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemGoGift.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemableList.d.ts +7 -2
- package/dist/cjs/components/credits/context/hooks/useRedeemableList.js +1 -1
- package/dist/cjs/components/credits/context/hooks/useRedeemableList.js.map +3 -3
- package/dist/cjs/components/credits/context/provider.d.ts +5 -1
- package/dist/cjs/components/credits/context/provider.js +1 -1
- package/dist/cjs/components/credits/context/provider.js.map +3 -3
- package/dist/cjs/components/credits/context/response.d.ts +1 -0
- package/dist/cjs/components/credits/context/response.js.map +1 -1
- package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js +1 -1
- package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js.map +2 -2
- package/dist/cjs/components/credits/creditsCash/CreditsCash.js +1 -1
- package/dist/cjs/components/credits/creditsCash/CreditsCash.js.map +2 -2
- package/dist/cjs/components/credits/creditsGoGift/CreditsGoGift.d.ts +5 -0
- package/dist/cjs/components/credits/creditsGoGift/CreditsGoGift.js +2 -0
- package/dist/cjs/components/credits/creditsGoGift/CreditsGoGift.js.map +7 -0
- package/dist/cjs/components/credits/creditsGoGift/index.d.ts +2 -0
- package/dist/cjs/components/credits/creditsGoGift/index.js +2 -0
- package/dist/cjs/components/credits/creditsGoGift/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsGoGift/type.d.ts +22 -0
- package/dist/cjs/components/credits/creditsGoGift/type.js +2 -0
- package/dist/cjs/components/credits/creditsGoGift/type.js.map +7 -0
- package/dist/cjs/components/credits/creditsInfoCard/index.js +1 -1
- package/dist/cjs/components/credits/creditsInfoCard/index.js.map +3 -3
- package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.js +1 -1
- package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.js.map +2 -2
- package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js.map +3 -3
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.d.ts +10 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.d.ts +10 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.d.ts +4 -5
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js.map +3 -3
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.d.ts +2 -3
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +2 -2
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.d.ts +2 -3
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +2 -2
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.d.ts +1 -3
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js.map +3 -3
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.d.ts +3 -4
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +2 -2
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.d.ts +2 -3
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +2 -2
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.d.ts +4 -5
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +3 -3
- package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.d.ts +10 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.d.ts +9 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal.d.ts +8 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js.map +2 -2
- package/dist/cjs/components/credits/creditsRedeemList/type.d.ts +11 -0
- package/dist/cjs/components/credits/creditsRedeemList/type.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/type.js.map +1 -1
- package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +1 -1
- package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +2 -2
- package/dist/cjs/components/credits/creditsWaysToGetCredits/type.d.ts +2 -2
- package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js.map +1 -1
- package/dist/cjs/components/credits/index.d.ts +2 -1
- package/dist/cjs/components/credits/index.js +1 -1
- package/dist/cjs/components/credits/index.js.map +3 -3
- package/dist/{esm/components/credits/modal/activitiesModal.d.ts → cjs/components/credits/modal/ActivitiesModal.d.ts} +1 -1
- package/dist/cjs/components/credits/modal/{activitiesModal.js → ActivitiesModal.js} +2 -2
- package/dist/cjs/components/credits/modal/{activitiesModal.js.map → ActivitiesModal.js.map} +3 -3
- package/dist/cjs/components/credits/modal/{creditsUploadReceiptModal.js → CreditsUploadReceiptModal.js} +2 -2
- package/dist/cjs/components/credits/modal/{creditsUploadReceiptModal.js.map → CreditsUploadReceiptModal.js.map} +3 -3
- package/dist/cjs/components/credits/modal/{loadingDots.js → LoadingDots.js} +1 -1
- package/dist/cjs/components/credits/modal/{loadingDots.js.map → LoadingDots.js.map} +2 -2
- package/dist/cjs/components/credits/modal/ModalContainer.js +2 -0
- package/dist/cjs/components/credits/modal/ModalContainer.js.map +7 -0
- package/dist/cjs/components/credits/modal/RewardsModal.d.ts +64 -0
- package/dist/cjs/components/credits/modal/RewardsModal.js +2 -0
- package/dist/cjs/components/credits/modal/RewardsModal.js.map +7 -0
- package/dist/cjs/components/credits/modal/{rulesModal.d.ts → RulesModal.d.ts} +1 -1
- package/dist/cjs/components/credits/modal/{rulesModal.js → RulesModal.js} +2 -2
- package/dist/cjs/components/credits/modal/{rulesModal.js.map → RulesModal.js.map} +3 -3
- package/dist/cjs/components/credits/modal/{subscribeModal.d.ts → SubscribeModal.d.ts} +1 -1
- package/dist/cjs/components/credits/modal/{subscribeModal.js → SubscribeModal.js} +2 -2
- package/dist/cjs/components/credits/modal/{subscribeModal.js.map → SubscribeModal.js.map} +3 -3
- package/dist/cjs/components/credits/modal/{tip.js → Tip.js} +1 -1
- package/dist/cjs/components/credits/modal/{tip.js.map → Tip.js.map} +2 -2
- package/dist/cjs/components/credits/type.d.ts +67 -5
- package/dist/cjs/components/credits/type.js +1 -1
- package/dist/cjs/components/credits/type.js.map +1 -1
- package/dist/cjs/templates/Credits.d.ts +1 -87
- package/dist/cjs/templates/Credits.js +1 -1
- package/dist/cjs/templates/Credits.js.map +3 -3
- package/dist/cjs/templates/Credits.types.d.ts +96 -0
- package/dist/cjs/templates/Credits.types.js +2 -0
- package/dist/cjs/templates/Credits.types.js.map +7 -0
- package/dist/esm/components/credits/context/const.d.ts +10 -2
- package/dist/esm/components/credits/context/const.js +1 -1
- package/dist/esm/components/credits/context/const.js.map +2 -2
- package/dist/esm/components/credits/context/hooks/useMyRewards.js +1 -1
- package/dist/esm/components/credits/context/hooks/useMyRewards.js.map +3 -3
- package/dist/esm/components/credits/context/hooks/useRedeemGoGift.d.ts +17 -0
- package/dist/esm/components/credits/context/hooks/useRedeemGoGift.js +2 -0
- package/dist/esm/components/credits/context/hooks/useRedeemGoGift.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useRedeemableList.d.ts +7 -2
- package/dist/esm/components/credits/context/hooks/useRedeemableList.js +1 -1
- package/dist/esm/components/credits/context/hooks/useRedeemableList.js.map +3 -3
- package/dist/esm/components/credits/context/provider.d.ts +5 -1
- package/dist/esm/components/credits/context/provider.js +1 -1
- package/dist/esm/components/credits/context/provider.js.map +3 -3
- package/dist/esm/components/credits/context/response.d.ts +1 -0
- package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js +1 -1
- package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js.map +1 -1
- package/dist/esm/components/credits/creditsCash/CreditsCash.js +1 -1
- package/dist/esm/components/credits/creditsCash/CreditsCash.js.map +1 -1
- package/dist/esm/components/credits/creditsGoGift/CreditsGoGift.d.ts +5 -0
- package/dist/esm/components/credits/creditsGoGift/CreditsGoGift.js +2 -0
- package/dist/esm/components/credits/creditsGoGift/CreditsGoGift.js.map +7 -0
- package/dist/esm/components/credits/creditsGoGift/index.d.ts +2 -0
- package/dist/esm/components/credits/creditsGoGift/index.js +2 -0
- package/dist/esm/components/credits/creditsGoGift/index.js.map +7 -0
- package/dist/esm/components/credits/creditsGoGift/type.d.ts +22 -0
- package/dist/esm/components/credits/creditsGoGift/type.js +1 -0
- package/dist/esm/components/credits/creditsGoGift/type.js.map +7 -0
- package/dist/esm/components/credits/creditsInfoCard/index.js +1 -1
- package/dist/esm/components/credits/creditsInfoCard/index.js.map +3 -3
- package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.js +1 -1
- package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.js.map +1 -1
- package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js.map +3 -3
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.d.ts +10 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.d.ts +10 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.d.ts +4 -5
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js.map +3 -3
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.d.ts +2 -3
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +2 -2
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.d.ts +2 -3
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +2 -2
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.d.ts +1 -3
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js.map +3 -3
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.d.ts +3 -4
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +2 -2
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.d.ts +2 -3
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +2 -2
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.d.ts +4 -5
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +3 -3
- package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.d.ts +10 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.d.ts +9 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal.d.ts +8 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js.map +2 -2
- package/dist/esm/components/credits/creditsRedeemList/type.d.ts +11 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +1 -1
- package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +1 -1
- package/dist/esm/components/credits/creditsWaysToGetCredits/type.d.ts +2 -2
- package/dist/esm/components/credits/creditsWaysToGetCredits/type.js.map +1 -1
- package/dist/esm/components/credits/index.d.ts +2 -1
- package/dist/esm/components/credits/index.js +1 -1
- package/dist/esm/components/credits/index.js.map +3 -3
- package/dist/{cjs/components/credits/modal/activitiesModal.d.ts → esm/components/credits/modal/ActivitiesModal.d.ts} +1 -1
- package/dist/esm/components/credits/modal/{activitiesModal.js → ActivitiesModal.js} +2 -2
- package/dist/esm/components/credits/modal/{activitiesModal.js.map → ActivitiesModal.js.map} +3 -3
- package/dist/esm/components/credits/modal/{creditsUploadReceiptModal.js → CreditsUploadReceiptModal.js} +2 -2
- package/dist/esm/components/credits/modal/{creditsUploadReceiptModal.js.map → CreditsUploadReceiptModal.js.map} +2 -2
- package/dist/esm/components/credits/modal/{loadingDots.js → LoadingDots.js} +1 -1
- package/dist/esm/components/credits/modal/{loadingDots.js.map → LoadingDots.js.map} +2 -2
- package/dist/esm/components/credits/modal/ModalContainer.js +2 -0
- package/dist/esm/components/credits/modal/ModalContainer.js.map +7 -0
- package/dist/esm/components/credits/modal/RewardsModal.d.ts +64 -0
- package/dist/esm/components/credits/modal/RewardsModal.js +2 -0
- package/dist/esm/components/credits/modal/RewardsModal.js.map +7 -0
- package/dist/esm/components/credits/modal/{rulesModal.d.ts → RulesModal.d.ts} +1 -1
- package/dist/esm/components/credits/modal/{rulesModal.js → RulesModal.js} +2 -2
- package/dist/esm/components/credits/modal/{rulesModal.js.map → RulesModal.js.map} +3 -3
- package/dist/esm/components/credits/modal/{subscribeModal.d.ts → SubscribeModal.d.ts} +1 -1
- package/dist/esm/components/credits/modal/{subscribeModal.js → SubscribeModal.js} +2 -2
- package/dist/esm/components/credits/modal/{subscribeModal.js.map → SubscribeModal.js.map} +2 -2
- package/dist/esm/components/credits/modal/{tip.js → Tip.js} +1 -1
- package/dist/esm/components/credits/modal/{tip.js.map → Tip.js.map} +2 -2
- package/dist/esm/components/credits/type.d.ts +67 -5
- package/dist/esm/templates/Credits.d.ts +1 -87
- package/dist/esm/templates/Credits.js +1 -1
- package/dist/esm/templates/Credits.js.map +3 -3
- package/dist/esm/templates/Credits.types.d.ts +96 -0
- package/dist/esm/templates/Credits.types.js +2 -0
- package/dist/esm/templates/Credits.types.js.map +7 -0
- package/package.json +1 -1
- package/src/components/credits/context/const.ts +8 -0
- package/src/components/credits/context/hooks/useMyRewards.ts +7 -31
- package/src/components/credits/context/hooks/useRedeemGoGift.ts +36 -0
- package/src/components/credits/context/hooks/useRedeemableList.ts +13 -19
- package/src/components/credits/context/provider.tsx +17 -2
- package/src/components/credits/context/response.ts +1 -0
- package/src/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.tsx +2 -2
- package/src/components/credits/creditsCash/CreditsCash.tsx +1 -1
- package/src/components/credits/creditsGoGift/CreditsGoGift.tsx +210 -0
- package/src/components/credits/creditsGoGift/index.ts +2 -0
- package/src/components/credits/creditsGoGift/type.ts +23 -0
- package/src/components/credits/creditsInfoCard/index.tsx +5 -28
- package/src/components/credits/creditsMemberPrice/CreditsMemberPrice.tsx +1 -1
- package/src/components/credits/creditsRedeemList/CreditsRedeemList.tsx +39 -17
- package/src/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.tsx +77 -0
- package/src/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.tsx +86 -0
- package/src/components/credits/creditsRedeemList/RedeemCouponModal.tsx +29 -138
- package/src/components/credits/creditsRedeemList/RedeemProductModal/Address.tsx +5 -6
- package/src/components/credits/creditsRedeemList/RedeemProductModal/Init.tsx +11 -12
- package/src/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.tsx +23 -14
- package/src/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.tsx +11 -9
- package/src/components/credits/creditsRedeemList/RedeemProductModal/Success.tsx +4 -5
- package/src/components/credits/creditsRedeemList/RedeemProductModal/index.tsx +29 -28
- package/src/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.tsx +101 -0
- package/src/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.tsx +65 -0
- package/src/components/credits/creditsRedeemList/RedeemVirtualProductModal.tsx +156 -0
- package/src/components/credits/creditsRedeemList/RedeemableItem.tsx +1 -1
- package/src/components/credits/creditsRedeemList/type.ts +11 -0
- package/src/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.tsx +2 -2
- package/src/components/credits/creditsWaysToGetCredits/type.ts +2 -2
- package/src/components/credits/index.ts +2 -1
- package/src/components/credits/modal/{activitiesModal.tsx → ActivitiesModal.tsx} +2 -2
- package/src/components/credits/modal/{creditsUploadReceiptModal.tsx → CreditsUploadReceiptModal.tsx} +1 -1
- package/src/components/credits/modal/{modalContainer.tsx → ModalContainer.tsx} +1 -1
- package/src/components/credits/modal/{MyRewardsModal.tsx → RewardsModal.tsx} +145 -103
- package/src/components/credits/modal/{rulesModal.tsx → RulesModal.tsx} +1 -1
- package/src/components/credits/modal/{subscribeModal.tsx → SubscribeModal.tsx} +1 -1
- package/src/components/credits/type.ts +68 -5
- package/src/templates/Credits.tsx +110 -142
- package/src/templates/Credits.types.ts +110 -0
- package/dist/cjs/components/credits/modal/MyRewardsModal.d.ts +0 -32
- 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/modalContainer.js +0 -2
- package/dist/cjs/components/credits/modal/modalContainer.js.map +0 -7
- package/dist/cjs/stories/CartCard.stories.d.ts +0 -33
- package/dist/cjs/stories/CartCard.stories.js +0 -21
- package/dist/cjs/stories/CartCard.stories.js.map +0 -7
- package/dist/esm/components/credits/modal/MyRewardsModal.d.ts +0 -32
- 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/modalContainer.js +0 -2
- package/dist/esm/components/credits/modal/modalContainer.js.map +0 -7
- package/dist/esm/stories/CartCard.stories.d.ts +0 -33
- package/dist/esm/stories/CartCard.stories.js +0 -21
- package/dist/esm/stories/CartCard.stories.js.map +0 -7
- package/dist/index.d.mts +0 -1305
- package/dist/index.d.ts +0 -1305
- package/dist/index.js +0 -26656
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -26641
- package/dist/index.mjs.map +0 -1
- /package/dist/cjs/components/credits/modal/{creditsUploadReceiptModal.d.ts → CreditsUploadReceiptModal.d.ts} +0 -0
- /package/dist/cjs/components/credits/modal/{loadingDots.d.ts → LoadingDots.d.ts} +0 -0
- /package/dist/cjs/components/credits/modal/{modalContainer.d.ts → ModalContainer.d.ts} +0 -0
- /package/dist/cjs/components/credits/modal/{tip.d.ts → Tip.d.ts} +0 -0
- /package/dist/esm/components/credits/modal/{creditsUploadReceiptModal.d.ts → CreditsUploadReceiptModal.d.ts} +0 -0
- /package/dist/esm/components/credits/modal/{loadingDots.d.ts → LoadingDots.d.ts} +0 -0
- /package/dist/esm/components/credits/modal/{modalContainer.d.ts → ModalContainer.d.ts} +0 -0
- /package/dist/esm/components/credits/modal/{tip.d.ts → Tip.d.ts} +0 -0
- /package/src/components/credits/modal/{loadingDots.tsx → LoadingDots.tsx} +0 -0
- /package/src/components/credits/modal/{tip.tsx → Tip.tsx} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Button, Picture, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport type { RedeemModalCommon, RedeemableItem as RedeemableItemType } from '../../type'\nimport { NoneProductValue } from '../RedeemProductModal/NonProductValue'\nimport { useCreditsContext } from '../../context/provider'\n\ntype VirtualProductSuccessProps = {\n item: RedeemableItemType\n copy: RedeemModalCommon\n disabled: boolean\n onClose: () => void\n}\n\nexport const VirtualProductSuccess = ({ item, copy, disabled, onClose }: VirtualProductSuccessProps) => {\n const { locale } = useHeadlessContext()\n const { pageCommon } = useCreditsContext()\n\n return (\n <>\n <div\n className={classNames(\n 'max-h-[500px] overflow-y-auto bg-[#F5F5F7] px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]'\n )}\n >\n <div className=\"relative mx-auto h-[164px] w-[324px]\">\n {pageCommon?.imageMapping?.[item.config?.type]?.url && (\n <Picture source={pageCommon.imageMapping[item.config.type].url} className=\"h-full [&_img]:h-full\" />\n )}\n <div className=\"absolute bottom-[8px] left-[16px] font-extrabold text-white\">\n {item.config.value ? (\n <NoneProductValue item={item} />\n ) : (\n <Text size={3} html={item.alpc?.title} />\n )}\n </div>\n </div>\n </div>\n <div className=\"bg-white px-[48px] pt-[24px] text-center md:px-[16px]\">\n <div className=\"flex flex-col\">\n <Text\n className=\"mb-[4px] text-[24px] font-bold leading-[1.2] md:text-[20px]\"\n html={copy.virtualProduct.successTitle}\n ></Text>\n <Text\n className=\"text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:text-[14px]\"\n html={copy.virtualProduct.successDesc}\n ></Text>\n </div>\n <Button\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[16px] w-full\"\n onClick={() => {\n window.location.href = copy.virtualProduct.successButtonUrl || `/${locale}`\n onClose()\n }}\n disabled={disabled}\n >\n {copy.virtualProduct.successButton}\n </Button>\n </div>\n </>\n )\n}\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,2BAAAE,IAAA,eAAAC,EAAAH,GAmBI,IAAAI,EAAA,6BAnBJC,EAAsC,iCACtCC,EAAuB,yBACvBC,EAAmC,yBAEnCC,EAAiC,iDACjCC,EAAkC,kCAS3B,MAAMP,EAAwB,CAAC,CAAE,KAAAQ,EAAM,KAAAC,EAAM,SAAAC,EAAU,QAAAC,CAAQ,IAAkC,CACtG,KAAM,CAAE,OAAAC,CAAO,KAAI,sBAAmB,EAChC,CAAE,WAAAC,CAAW,KAAI,qBAAkB,EAEzC,SACE,oBACE,oBAAC,OACC,aAAW,EAAAC,SACT,8FACF,EAEA,oBAAC,OAAI,UAAU,uCACZ,UAAAD,GAAY,eAAeL,EAAK,QAAQ,IAAI,GAAG,QAC9C,OAAC,WAAQ,OAAQK,EAAW,aAAaL,EAAK,OAAO,IAAI,EAAE,IAAK,UAAU,wBAAwB,KAEpG,OAAC,OAAI,UAAU,8DACZ,SAAAA,EAAK,OAAO,SACX,OAAC,oBAAiB,KAAMA,EAAM,KAE9B,OAAC,QAAK,KAAM,EAAG,KAAMA,EAAK,MAAM,MAAO,EAE3C,GACF,EACF,KACA,QAAC,OAAI,UAAU,wDACb,qBAAC,OAAI,UAAU,gBACb,oBAAC,QACC,UAAU,8DACV,KAAMC,EAAK,eAAe,aAC3B,KACD,OAAC,QACC,UAAU,oEACV,KAAMA,EAAK,eAAe,YAC3B,GACH,KACA,OAAC,UACC,QAAQ,UACR,KAAK,KACL,UAAU,mBACV,QAAS,IAAM,CACb,OAAO,SAAS,KAAOA,EAAK,eAAe,kBAAoB,IAAIG,CAAM,GACzED,EAAQ,CACV,EACA,SAAUD,EAET,SAAAD,EAAK,eAAe,cACvB,GACF,GACF,CAEJ",
|
|
6
|
+
"names": ["VirtualProductSuccess_exports", "__export", "VirtualProductSuccess", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_classnames", "import_lib", "import_NonProductValue", "import_provider", "item", "copy", "disabled", "onClose", "locale", "pageCommon", "classNames"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ModalContainerProps } from '../modal/ModalContainer';
|
|
2
|
+
import type { RedeemableItem as RedeemableItemType, RedeemModalCommon } from '../type';
|
|
3
|
+
declare function RedeemVirtualProductModal({ item, copy, onError, ...props }: Omit<ModalContainerProps, 'isOpen'> & {
|
|
4
|
+
item: RedeemableItemType;
|
|
5
|
+
copy: RedeemModalCommon;
|
|
6
|
+
onError: (code: number) => void;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default RedeemVirtualProductModal;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var g=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var V=(o,e)=>{for(var s in e)g(o,s,{get:e[s],enumerable:!0})},k=(o,e,s,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of w(e))!A.call(o,n)&&n!==s&&g(o,n,{get:()=>e[n],enumerable:!(l=T(e,n))||l.enumerable});return o};var z=o=>k(g({},"__esModule",{value:!0}),o);var U={};V(U,{default:()=>J});module.exports=z(U);var a=require("react/jsx-runtime"),M=require("@anker-in/headless-ui"),d=require("react"),y=require("../context/provider"),I=require("../context/hooks/useRedeemGoGift"),S=require("../context/hooks/useRedeemProduct"),i=require("../context/const"),P=require("../modal/ModalContainer"),v=require("./RedeemVirtualProductModal/VirtualProductInit"),L=require("./RedeemVirtualProductModal/VirtualProductSuccess");function H({item:o,copy:e,onError:s,...l}){const[n,c]=(0,d.useState)(),[x,m]=(0,d.useState)(),[b,u]=(0,d.useState)(!1),{profile:t,fetchCreditInfo:p}=(0,y.useCreditsContext)(),C=o.config?.type===i.ConsumeType.GoGift,E=o.config?.type===i.ConsumeType.GiftCard,{isMutating:_,trigger:N}=(0,I.useRedeemGoGift)({onSuccess(r){if(!r){m(e?.commonError);return}r?.data?.id?(c(r.data.id),p(t?.user_id)):R(r.code)},onError(r){m(r.message||e?.commonError)}}),{isMutating:F,trigger:h}=(0,S.useRedeemProduct)({onSuccess(r){if(!r){m(e?.commonError);return}r?.code===0?(c("success"),p(t?.user_id)):R(r.code)},onError(){m(e?.commonError)}}),G=C?_:F,R=r=>{let f;r===i.AlpcErrorCode.CodeLpcShopifyCouponRuleRedeemLimit?(f=e?.redeemLimitError,u(!0)):r===i.AlpcErrorCode.CodeLpcRuleInventoryNotEnough?(f=e?.inventoryNotEnough,u(!0)):r===i.AlpcErrorCode.CodeLpcNotEnoughCredits?(f=e?.creditsNotEnough,u(!0),p(t?.user_id)):r===i.AlpcErrorCode.CodeCrossSiteError&&(f=e?.crossSiteError,u(!0)),m(f||e?.commonError||""),s&&s(r)},O=(0,d.useCallback)(async()=>{if(m(""),C)N({user_id:t?.user_id,rule_id:Number(o.alpc?.id)});else if(E){const r={email:t?.email||"",firstName:t?.firstName||"",lastName:t?.lastName||"",address1:"Default Address",city:"Default City",province:"Default Province",country:"US",zip:"00000"};h({address:btoa(JSON.stringify(r)),rule_id:Number(o.alpc?.id)})}},[o,t,N,h,C,E]);return(0,d.useEffect)(()=>()=>{u(!1),m(""),c(void 0)},[]),(0,a.jsxs)(P.CreditsModalContainer,{...l,isOpen:!!o,className:"w-[540px] md:h-auto",scrollClassName:"mb-[40px] min-l:px-0 md:mb-[24px] px-0",titleClassName:"h-[56px] bg-[#F5F5F7]",children:[n&&!G?(0,a.jsx)(L.VirtualProductSuccess,{item:o,copy:e,disabled:b,onClose:l.onClose}):(0,a.jsx)(v.VirtualProductInit,{item:o,copy:e,loading:G,disabled:b,onConfirm:O}),x&&(0,a.jsx)("div",{className:"mx-auto max-w-full bg-white px-[48px] py-[12px] text-center text-[#FF0000] md:px-[16px]",children:(0,a.jsx)(M.Text,{className:"text-[14px] font-semibold text-[#1F2021]",html:x})})]})}var J=H;
|
|
2
|
+
//# sourceMappingURL=RedeemVirtualProductModal.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/credits/creditsRedeemList/RedeemVirtualProductModal.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Text } from '@anker-in/headless-ui'\nimport { useCallback, useEffect, useState } from 'react'\nimport type { ModalContainerProps } from '../modal/ModalContainer'\nimport { useCreditsContext } from '../context/provider'\nimport { useRedeemGoGift } from '../context/hooks/useRedeemGoGift'\nimport { useRedeemProduct } from '../context/hooks/useRedeemProduct'\nimport { AlpcErrorCode, ConsumeType } from '../context/const'\nimport { CreditsModalContainer } from '../modal/ModalContainer'\nimport type { RedeemableItem as RedeemableItemType, RedeemModalCommon } from '../type'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport { VirtualProductInit } from './RedeemVirtualProductModal/VirtualProductInit'\nimport { VirtualProductSuccess } from './RedeemVirtualProductModal/VirtualProductSuccess'\n\nfunction RedeemVirtualProductModal({\n item,\n copy,\n onError,\n ...props\n}: Omit<ModalContainerProps, 'isOpen'> & {\n item: RedeemableItemType\n copy: RedeemModalCommon\n onError: (code: number) => void\n}) {\n const [giftCardId, setGiftCardId] = useState<string>()\n const [errorInfo, setErrorInfo] = useState<string>()\n\n const [disabled, setDisabled] = useState(false)\n\n const { profile, fetchCreditInfo } = useCreditsContext()\n\n // \u5224\u65AD\u662F GoGift \u8FD8\u662F GiftCard \u7C7B\u578B\n const isGoGift = item.config?.type === ConsumeType.GoGift\n const isGiftCard = item.config?.type === ConsumeType.GiftCard\n\n // GoGift \u4F7F\u7528\u4E13\u7528\u63A5\u53E3\n const { isMutating: goGiftLoading, trigger: triggerGoGift } = useRedeemGoGift({\n onSuccess(responseData) {\n if (!responseData) {\n setErrorInfo(copy?.commonError)\n return\n }\n\n if (responseData?.data?.id) {\n setGiftCardId(responseData.data.id)\n fetchCreditInfo(profile?.user_id)\n } else {\n handleRedeemError(responseData.code)\n }\n },\n onError(error) {\n setErrorInfo(error.message || copy?.commonError)\n },\n })\n\n // GiftCard \u4F7F\u7528 Product \u63A5\u53E3\uFF0C\u4F46\u4E0D\u9700\u8981\u5730\u5740\n const { isMutating: productLoading, trigger: triggerProduct } = useRedeemProduct({\n onSuccess(responseData) {\n if (!responseData) {\n setErrorInfo(copy?.commonError)\n return\n }\n\n if (responseData?.code === 0) {\n setGiftCardId('success')\n fetchCreditInfo(profile?.user_id)\n } else {\n handleRedeemError(responseData.code)\n }\n },\n onError() {\n setErrorInfo(copy?.commonError)\n },\n })\n\n const loading = isGoGift ? goGiftLoading : productLoading\n\n const handleRedeemError = (code: number) => {\n let errorMsg: string | undefined\n if (code === AlpcErrorCode.CodeLpcShopifyCouponRuleRedeemLimit) {\n errorMsg = copy?.redeemLimitError\n setDisabled(true)\n } else if (code === AlpcErrorCode.CodeLpcRuleInventoryNotEnough) {\n errorMsg = copy?.inventoryNotEnough\n setDisabled(true)\n } else if (code === AlpcErrorCode.CodeLpcNotEnoughCredits) {\n errorMsg = copy?.creditsNotEnough\n setDisabled(true)\n fetchCreditInfo(profile?.user_id)\n } else if (code === AlpcErrorCode.CodeCrossSiteError) {\n errorMsg = copy?.crossSiteError\n setDisabled(true)\n }\n\n setErrorInfo(errorMsg || copy?.commonError || '')\n onError && onError(code)\n }\n\n const handleConfirm = useCallback(async () => {\n setErrorInfo('')\n\n if (isGoGift) {\n // GoGift \u7C7B\u578B\u4F7F\u7528\u4E13\u7528\u63A5\u53E3\n triggerGoGift({\n user_id: profile?.user_id,\n rule_id: Number(item.alpc?.id),\n })\n } else if (isGiftCard) {\n // GiftCard \u7C7B\u578B\u4F7F\u7528 Product \u63A5\u53E3\uFF0C\u4F20\u9012\u9ED8\u8BA4\u5730\u5740\n const defaultAddress = {\n email: profile?.email || '',\n firstName: profile?.firstName || '',\n lastName: profile?.lastName || '',\n address1: 'Default Address',\n city: 'Default City',\n province: 'Default Province',\n country: 'US',\n zip: '00000',\n }\n triggerProduct({\n address: btoa(JSON.stringify(defaultAddress)),\n rule_id: Number(item.alpc?.id),\n })\n }\n }, [item, profile, triggerGoGift, triggerProduct, isGoGift, isGiftCard])\n\n useEffect(() => {\n return () => {\n setDisabled(false)\n setErrorInfo('')\n setGiftCardId(undefined)\n }\n }, [])\n\n return (\n <CreditsModalContainer\n {...props}\n isOpen={!!item}\n className=\"w-[540px] md:h-auto\"\n scrollClassName=\"mb-[40px] min-l:px-0 md:mb-[24px] px-0\"\n titleClassName=\"h-[56px] bg-[#F5F5F7]\"\n >\n {giftCardId && !loading ? (\n <VirtualProductSuccess item={item} copy={copy} disabled={disabled} onClose={props.onClose} />\n ) : (\n <VirtualProductInit item={item} copy={copy} loading={loading} disabled={disabled} onConfirm={handleConfirm} />\n )}\n {errorInfo && (\n <div className=\"mx-auto max-w-full bg-white px-[48px] py-[12px] text-center text-[#FF0000] md:px-[16px]\">\n <Text className=\"text-[14px] font-semibold text-[#1F2021]\" html={errorInfo} />\n </div>\n )}\n </CreditsModalContainer>\n )\n}\n\nexport default RedeemVirtualProductModal\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAsII,IAAAI,EAAA,6BAtIJC,EAAqB,iCACrBC,EAAiD,iBAEjDC,EAAkC,+BAClCC,EAAgC,4CAChCC,EAAiC,6CACjCC,EAA2C,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["RedeemVirtualProductModal_exports", "__export", "RedeemVirtualProductModal_default", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_react", "import_provider", "import_useRedeemGoGift", "import_useRedeemProduct", "import_const", "import_ModalContainer", "import_VirtualProductInit", "import_VirtualProductSuccess", "RedeemVirtualProductModal", "item", "copy", "onError", "props", "giftCardId", "setGiftCardId", "errorInfo", "setErrorInfo", "disabled", "setDisabled", "profile", "fetchCreditInfo", "isGoGift", "isGiftCard", "goGiftLoading", "triggerGoGift", "responseData", "handleRedeemError", "error", "productLoading", "triggerProduct", "loading", "code", "errorMsg", "handleConfirm", "defaultAddress"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var P=Object.create;var x=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var L=(t,l)=>{for(var e in l)x(t,e,{get:l[e],enumerable:!0})},_=(t,l,e,u)=>{if(l&&typeof l=="object"||typeof l=="function")for(let r of $(l))!E.call(t,r)&&r!==e&&x(t,r,{get:()=>l[r],enumerable:!(u=S(l,r))||u.enumerable});return t};var D=(t,l,e)=>(e=t!=null?P(z(t)):{},_(l||!t||!t.__esModule?x(e,"default",{value:t,enumerable:!0}):e,t)),O=t=>_(x({},"__esModule",{value:!0}),t);var A={};L(A,{RedeemableItem:()=>F});module.exports=O(A);var a=require("react/jsx-runtime"),n=require("@anker-in/headless-ui"),f=require("react"),v=D(require("classnames")),N=require("../context/provider"),o=require("../context/const"),d=require("../context/utils"),c=require("@anker-in/lib"),C=require("./NonProductValue"),R=require("../../../constants");function F({copy:t,className:l,item:e,onRulesOpen:u,onRedeem:r}){const{creditInfo:b,profile:i,gtm:{pageGroup:y,pageHandle:p},pageCommon:s}=(0,N.useCreditsContext)(),{brand:T}=(0,c.useHeadlessContext)(),m=Object.keys(i||{}).length>0,w=R.ROUNDED_BRANDS.includes(T),I=(0,f.useMemo)(()=>!!(e.alpc?.remainingInventory<=0&&e.alpc?.isLimited||e.alpc?.consumeType===o.AlpcConsumeType.Product&&!e.variant?.availableForSale||m&&i?.activated&&e.alpc?.consumeCredits>Number(b?.available_credit||0)),[e.alpc?.remainingInventory,e.alpc?.isLimited,e.alpc?.consumeType,e.alpc?.consumeCredits,m,i?.activated,b?.available_credit,e.variant?.availableForSale]),h=(0,f.useMemo)(()=>m?e.alpc?.consumeType===o.AlpcConsumeType.Product?e.variant?.availableForSale?t.btnRedeem:s?.soldOut||"Sold Out":t.btnRedeem:t.unlockRewards,[m,e.alpc?.consumeType,e.variant?.availableForSale,t.btnRedeem,t.unlockRewards,s?.soldOut]),k=(0,f.useMemo)(()=>{if(!(e.config?.type!==o.ConsumeType.Product||!e.product?.handle))return(0,d.extractVariantId)(e.variant?.id)?`/products/${e.product.handle}?variant=${(0,d.extractVariantId)(e.variant?.id)}${p?`&ref=${p}`:""}`:`/products/${e.product.handle}${p?`?ref=${p}`:""}`},[e.config?.type,e.product?.handle,e.variant?.id,p]);return(0,a.jsxs)("div",{className:(0,v.default)("flex flex-col items-center rounded-[16px] bg-[#EAEAEC] p-[24px] md:rounded-[12px] md:px-[8px] xl:py-[16px] md-xl:px-[16px]",!w&&"rounded-none md:rounded-none",l),children:[e.config?.type===o.ConsumeType.Product?(0,a.jsx)("a",{href:k,className:(0,v.default)("relative mx-auto h-[224px] w-fit md:my-[10px] l:h-[120px] l-xxl:h-[138px]"),children:(0,a.jsx)(n.Picture,{className:"h-full w-auto [&_img]:h-full [&_img]:object-contain",source:e.config?.image?.url||e.product
|
|
1
|
+
"use strict";var P=Object.create;var x=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var L=(t,l)=>{for(var e in l)x(t,e,{get:l[e],enumerable:!0})},_=(t,l,e,u)=>{if(l&&typeof l=="object"||typeof l=="function")for(let r of $(l))!E.call(t,r)&&r!==e&&x(t,r,{get:()=>l[r],enumerable:!(u=S(l,r))||u.enumerable});return t};var D=(t,l,e)=>(e=t!=null?P(z(t)):{},_(l||!t||!t.__esModule?x(e,"default",{value:t,enumerable:!0}):e,t)),O=t=>_(x({},"__esModule",{value:!0}),t);var A={};L(A,{RedeemableItem:()=>F});module.exports=O(A);var a=require("react/jsx-runtime"),n=require("@anker-in/headless-ui"),f=require("react"),v=D(require("classnames")),N=require("../context/provider"),o=require("../context/const"),d=require("../context/utils"),c=require("@anker-in/lib"),C=require("./NonProductValue"),R=require("../../../constants");function F({copy:t,className:l,item:e,onRulesOpen:u,onRedeem:r}){const{creditInfo:b,profile:i,gtm:{pageGroup:y,pageHandle:p},pageCommon:s}=(0,N.useCreditsContext)(),{brand:T}=(0,c.useHeadlessContext)(),m=Object.keys(i||{}).length>0,w=R.ROUNDED_BRANDS.includes(T),I=(0,f.useMemo)(()=>!!(e.alpc?.remainingInventory<=0&&e.alpc?.isLimited||e.alpc?.consumeType===o.AlpcConsumeType.Product&&!e.variant?.availableForSale||m&&i?.activated&&e.alpc?.consumeCredits>Number(b?.available_credit||0)),[e.alpc?.remainingInventory,e.alpc?.isLimited,e.alpc?.consumeType,e.alpc?.consumeCredits,m,i?.activated,b?.available_credit,e.variant?.availableForSale]),h=(0,f.useMemo)(()=>m?e.alpc?.consumeType===o.AlpcConsumeType.Product?e.variant?.availableForSale?t.btnRedeem:s?.soldOut||"Sold Out":t.btnRedeem:t.unlockRewards,[m,e.alpc?.consumeType,e.variant?.availableForSale,t.btnRedeem,t.unlockRewards,s?.soldOut]),k=(0,f.useMemo)(()=>{if(!(e.config?.type!==o.ConsumeType.Product||!e.product?.handle))return(0,d.extractVariantId)(e.variant?.id)?`/products/${e.product.handle}?variant=${(0,d.extractVariantId)(e.variant?.id)}${p?`&ref=${p}`:""}`:`/products/${e.product.handle}${p?`?ref=${p}`:""}`},[e.config?.type,e.product?.handle,e.variant?.id,p]);return(0,a.jsxs)("div",{className:(0,v.default)("flex flex-col items-center rounded-[16px] bg-[#EAEAEC] p-[24px] md:rounded-[12px] md:px-[8px] xl:py-[16px] md-xl:px-[16px]",!w&&"rounded-none md:rounded-none",l),children:[e.config?.type===o.ConsumeType.Product?(0,a.jsx)("a",{href:k,className:(0,v.default)("relative mx-auto h-[224px] w-fit md:my-[10px] l:h-[120px] l-xxl:h-[138px]"),children:(0,a.jsx)(n.Picture,{className:"h-full w-auto [&_img]:h-full [&_img]:object-contain",source:e.config?.image?.url||e.product?.images?.[0]?.url})}):(0,a.jsxs)("div",{className:"relative mx-auto my-[30px] h-[164px] md:my-0 md:h-[66px] l-xxl:h-[138px] md-l:h-[80px]",children:[(0,a.jsx)(n.Picture,{source:s?.imageMapping?.[e.config?.type]?.url,className:"h-full [&_img]:h-full [&_img]:w-auto [&_img]:object-contain"}),(0,a.jsx)(C.NoneProductValue,{item:e})]}),(0,a.jsxs)("div",{className:(0,v.default)("mt-[10px] xl:mt-[8px] flex w-full flex-1 flex-col justify-between"),children:[(0,a.jsx)(n.Text,{html:e.config?.title||e.alpc?.title,title:e.config?.title||e.alpc?.title,size:2,className:"line-clamp-2 h-[58px] text-[24px] leading-[1.2] l:h-[40px] l:text-[16px] l-xxl:h-[48px] l-xxl:text-[20px]"}),e.config?.rules?.length>0&&(0,a.jsx)("button",{type:"button",onClick:()=>{u(e.config?.rules||[]),(0,c.gaTrack)({event:"ga4Event",event_name:"lp_button",member_active_status:i?.activated?"active":"not active",event_parameters:{page_group:y,position:t.title,button_name:s?.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:g=>{(g.key==="Enter"||g.key===" ")&&g.preventDefault()},children:s?.ruleLabel}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"mt-[26px] flex items-center l:mt-[12px] l-xl:mt-[16px]",children:[(0,a.jsx)(n.Picture,{className:"size-[24px] l-xxl:size-[22px] md-l:size-[18px] md:size-[16px]",source:"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/icon_hire_purchase.png?v=1757496783"}),(0,a.jsx)(n.Text,{html:`${(0,d.numberFormat)(e.alpc?.consumeCredits)}`,size:2,as:"p",className:"ml-[4px] text-[24px] font-bold mt-[4px] leading-none l-xxl:text-[20px] l:text-[16px] "})]}),(0,a.jsx)(n.Button,{disabled:I,variant:"primary",size:"lg",className:"mt-[8px] md:px-[8px] l:w-full",onClick:()=>{r(e),(0,c.gaTrack)({event:"ga4Event",event_name:"lp_button",member_active_status:i?.activated?"active":"not active",event_parameters:{page_group:y,position:t.title,button_name:h,info:e.alpc?.id?.toString()}})},children:h})]})]})]})}
|
|
2
2
|
//# sourceMappingURL=RedeemableItem.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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, extractVariantId } from '../context/utils'\nimport type { CreditsRedeemListCopy } from './type'\nimport { gaTrack, useHeadlessContext } from '@anker-in/lib'\nimport { NoneProductValue } from './NonProductValue'\nimport { ROUNDED_BRANDS } from '../../../constants'\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, pageHandle },\n pageCommon,\n } = useCreditsContext()\n const { brand } = useHeadlessContext()\n const isLogin = Object.keys(profile || {}).length > 0\n const rounded = ROUNDED_BRANDS.includes(brand)\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 : pageCommon?.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 pageCommon?.soldOut,\n ])\n\n // \u751F\u6210\u4EA7\u54C1 listing \u9875\u9762\u94FE\u63A5\n const productUrl = useMemo(() => {\n if (item.config?.type !== ConsumeType.Product || !item.product?.handle) {\n return undefined\n }\n return extractVariantId(item.variant?.id)\n ? `/products/${item.product.handle}?variant=${extractVariantId(item.variant?.id)}${pageHandle ? `&ref=${pageHandle}` : ''}`\n : `/products/${item.product.handle}${pageHandle ? `?ref=${pageHandle}` : ''}`\n }, [item.config?.type, item.product?.handle, item.variant?.id, pageHandle])\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 !rounded && 'rounded-none md:rounded-none',\n className\n )}\n >\n {item.config?.type === ConsumeType.Product ? (\n <a\n href={productUrl}\n className={classNames('relative mx-auto h-[224px] w-fit md:my-[10px] l:h-[120px] l-xxl:h-[138px]')}\n >\n <Picture\n className=\"h-full w-auto [&_img]:h-full [&_img]:object-contain\"\n source={item.config?.image?.url || item.product
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,IAAA,eAAAC,EAAAH,GAyGU,IAAAI,EAAA,6BAzGVC,EAAsC,iCAEtCC,EAAwB,iBAExBC,EAAuB,yBACvBC,EAAkC,+BAElCC,EAA6C,4BAC7CC,EAA+C,4BAE/CC,EAA4C,yBAC5CC,EAAiC,6BACjCC,EAA+B,8BAExB,SAASX,EAAe,CAC7B,KAAAY,EACA,UAAAC,EACA,KAAAC,EACA,YAAAC,EACA,SAAAC,CACF,EAMG,CACD,KAAM,CACJ,WAAAC,EACA,QAAAC,EACA,IAAK,CAAE,UAAAC,EAAW,WAAAC,CAAW,EAC7B,WAAAC,CACF,KAAI,qBAAkB,EAChB,CAAE,MAAAC,CAAM,KAAI,sBAAmB,EAC/BC,EAAU,OAAO,KAAKL,GAAW,CAAC,CAAC,EAAE,OAAS,EAC9CM,EAAU,iBAAe,SAASF,CAAK,EAEvCG,KAAa,WAAQ,IACrB,GAAAX,EAAK,MAAM,oBAAsB,GAAKA,EAAK,MAAM,WAKjDA,EAAK,MAAM,cAAgB,kBAAgB,SACzC,CAACA,EAAK,SAAS,kBAIjBS,GAAWL,GAAS,WAAaJ,EAAK,MAAM,eAAiB,OAAOG,GAAY,kBAAoB,CAAC,GAIxG,CACDH,EAAK,MAAM,mBACXA,EAAK,MAAM,UACXA,EAAK,MAAM,YACXA,EAAK,MAAM,eACXS,EACAL,GAAS,UACTD,GAAY,iBACZH,EAAK,SAAS,gBAChB,CAAC,EAEKY,KAAmB,WAAQ,IAC1BH,EAKDT,EAAK,MAAM,cAAgB,kBAAgB,QACtCA,EAAK,SAAS,iBAAmBF,EAAK,UAAYS,GAAY,SAAW,WAE3ET,EAAK,UAPHA,EAAK,cAQb,CACDW,EACAT,EAAK,MAAM,YACXA,EAAK,SAAS,iBACdF,EAAK,UACLA,EAAK,cACLS,GAAY,OACd,CAAC,EAGKM,KAAa,WAAQ,IAAM,CAC/B,GAAI,EAAAb,EAAK,QAAQ,OAAS,cAAY,SAAW,CAACA,EAAK,SAAS,QAGhE,SAAO,oBAAiBA,EAAK,SAAS,EAAE,EACpC,aAAaA,EAAK,QAAQ,MAAM,eAAY,oBAAiBA,EAAK,SAAS,EAAE,CAAC,GAAGM,EAAa,QAAQA,CAAU,GAAK,EAAE,GACvH,aAAaN,EAAK,QAAQ,MAAM,GAAGM,EAAa,QAAQA,CAAU,GAAK,EAAE,EAC/E,EAAG,CAACN,EAAK,QAAQ,KAAMA,EAAK,SAAS,OAAQA,EAAK,SAAS,GAAIM,CAAU,CAAC,EAE1E,SACE,QAAC,OACC,aAAW,EAAAQ,SACT,6HACA,CAACJ,GAAW,+BACZX,CACF,EAEC,UAAAC,EAAK,QAAQ,OAAS,cAAY,WACjC,OAAC,KACC,KAAMa,EACN,aAAW,EAAAC,SAAW,2EAA2E,EAEjG,mBAAC,WACC,UAAU,sDACV,OAAQd,EAAK,QAAQ,OAAO,KAAOA,EAAK,
|
|
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, extractVariantId } from '../context/utils'\nimport type { CreditsRedeemListCopy } from './type'\nimport { gaTrack, useHeadlessContext } from '@anker-in/lib'\nimport { NoneProductValue } from './NonProductValue'\nimport { ROUNDED_BRANDS } from '../../../constants'\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, pageHandle },\n pageCommon,\n } = useCreditsContext()\n const { brand } = useHeadlessContext()\n const isLogin = Object.keys(profile || {}).length > 0\n const rounded = ROUNDED_BRANDS.includes(brand)\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 : pageCommon?.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 pageCommon?.soldOut,\n ])\n\n // \u751F\u6210\u4EA7\u54C1 listing \u9875\u9762\u94FE\u63A5\n const productUrl = useMemo(() => {\n if (item.config?.type !== ConsumeType.Product || !item.product?.handle) {\n return undefined\n }\n return extractVariantId(item.variant?.id)\n ? `/products/${item.product.handle}?variant=${extractVariantId(item.variant?.id)}${pageHandle ? `&ref=${pageHandle}` : ''}`\n : `/products/${item.product.handle}${pageHandle ? `?ref=${pageHandle}` : ''}`\n }, [item.config?.type, item.product?.handle, item.variant?.id, pageHandle])\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 !rounded && 'rounded-none md:rounded-none',\n className\n )}\n >\n {item.config?.type === ConsumeType.Product ? (\n <a\n href={productUrl}\n className={classNames('relative mx-auto h-[224px] w-fit md:my-[10px] l:h-[120px] l-xxl:h-[138px]')}\n >\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 </a>\n ) : (\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={pageCommon?.imageMapping?.[item.config?.type]?.url}\n className=\"h-full [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n ></Picture>\n\n <NoneProductValue item={item} />\n </div>\n )}\n <div className={classNames('mt-[10px] xl:mt-[8px] 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=\"line-clamp-2 h-[58px] text-[24px] leading-[1.2] l:h-[40px] l:text-[16px] l-xxl:h-[48px] 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: pageCommon?.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 {pageCommon?.ruleLabel}\n </button>\n )}\n <div>\n <div className=\"mt-[26px] flex items-center l:mt-[12px] l-xl:mt-[16px]\">\n <Picture\n className=\"size-[24px] l-xxl:size-[22px] md-l:size-[18px] md:size-[16px]\"\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-[24px] font-bold mt-[4px] leading-none l-xxl:text-[20px] l:text-[16px] \"\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 )\n}\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,IAAA,eAAAC,EAAAH,GAyGU,IAAAI,EAAA,6BAzGVC,EAAsC,iCAEtCC,EAAwB,iBAExBC,EAAuB,yBACvBC,EAAkC,+BAElCC,EAA6C,4BAC7CC,EAA+C,4BAE/CC,EAA4C,yBAC5CC,EAAiC,6BACjCC,EAA+B,8BAExB,SAASX,EAAe,CAC7B,KAAAY,EACA,UAAAC,EACA,KAAAC,EACA,YAAAC,EACA,SAAAC,CACF,EAMG,CACD,KAAM,CACJ,WAAAC,EACA,QAAAC,EACA,IAAK,CAAE,UAAAC,EAAW,WAAAC,CAAW,EAC7B,WAAAC,CACF,KAAI,qBAAkB,EAChB,CAAE,MAAAC,CAAM,KAAI,sBAAmB,EAC/BC,EAAU,OAAO,KAAKL,GAAW,CAAC,CAAC,EAAE,OAAS,EAC9CM,EAAU,iBAAe,SAASF,CAAK,EAEvCG,KAAa,WAAQ,IACrB,GAAAX,EAAK,MAAM,oBAAsB,GAAKA,EAAK,MAAM,WAKjDA,EAAK,MAAM,cAAgB,kBAAgB,SACzC,CAACA,EAAK,SAAS,kBAIjBS,GAAWL,GA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ACX,KAED,OAAC,oBAAiB,KAAMA,EAAM,GAChC,KAEF,QAAC,OAAI,aAAW,EAAAc,SAAW,mEAAmE,EAC5F,oBAAC,QACC,KAAMd,EAAK,QAAQ,OAASA,EAAK,MAAM,MACvC,MAAOA,EAAK,QAAQ,OAASA,EAAK,MAAM,MACxC,KAAM,EACN,UAAU,4GACZ,EACCA,EAAK,QAAQ,OAAO,OAAS,MAC5B,OAAC,UACC,KAAK,SACL,QAAS,IAAM,CACbC,EAAYD,EAAK,QAAQ,OAAS,CAAC,CAAC,KACpC,WAAQ,CACN,MAAO,WACP,WAAY,YACZ,qBAAsBI,GAAS,UAAY,SAAW,aACtD,iBAAkB,CAChB,WAAYC,EACZ,SAAUP,EAAK,MACf,YAAaS,GAAY,UACzB,KAAMP,EAAK,MAAM,IAAI,SAAS,CAChC,CACF,CAAC,CACH,EACA,UAAU,uEACV,SAAU,EACV,UAAWe,GAAK,EACVA,EAAE,MAAQ,SAAWA,EAAE,MAAQ,MACjCA,EAAE,eAAe,CAErB,EAEC,SAAAR,GAAY,UACf,KAEF,QAAC,OACC,qBAAC,OAAI,UAAU,yDACb,oBAAC,WACC,UAAU,gEACV,OAAO,6FACT,KACA,OAAC,QACC,KAAM,MAAG,gBAAaP,EAAK,MAAM,cAAc,CAAC,GAChD,KAAM,EACN,GAAG,IACH,UAAU,wFACZ,GACF,KAEA,OAAC,UACC,SAAUW,EACV,QAAQ,UACR,KAAK,KACL,UAAU,gCACV,QAAS,IAAM,CACbT,EAASF,CAAI,KACb,WAAQ,CACN,MAAO,WACP,WAAY,YACZ,qBAAsBI,GAAS,UAAY,SAAW,aACtD,iBAAkB,CAChB,WAAYC,EACZ,SAAUP,EAAK,MACf,YAAac,EACb,KAAMZ,EAAK,MAAM,IAAI,SAAS,CAChC,CACF,CAAC,CACH,EAEC,SAAAY,EACH,GACF,GACF,GACF,CAEJ",
|
|
6
6
|
"names": ["RedeemableItem_exports", "__export", "RedeemableItem", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_react", "import_classnames", "import_provider", "import_const", "import_utils", "import_lib", "import_NonProductValue", "import_constants", "copy", "className", "item", "onRulesOpen", "onRedeem", "creditInfo", "profile", "pageGroup", "pageHandle", "pageCommon", "brand", "isLogin", "rounded", "isDisabled", "redeemButtonText", "productUrl", "classNames", "e"]
|
|
7
7
|
}
|
|
@@ -27,6 +27,17 @@ export type CreditsRedeemListCopy = {
|
|
|
27
27
|
successButton: string;
|
|
28
28
|
successButtonUrl: string;
|
|
29
29
|
};
|
|
30
|
+
virtualProduct: {
|
|
31
|
+
successDesc: string;
|
|
32
|
+
successTitle: string;
|
|
33
|
+
successButton: string;
|
|
34
|
+
successButtonUrl: string;
|
|
35
|
+
stepTitle?: string;
|
|
36
|
+
steps?: {
|
|
37
|
+
imageUrl: string;
|
|
38
|
+
title: string;
|
|
39
|
+
}[];
|
|
40
|
+
};
|
|
30
41
|
product: {
|
|
31
42
|
required: string;
|
|
32
43
|
invalidEmail: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var
|
|
1
|
+
"use strict";var e=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var c=(t,s,n,i)=>{if(s&&typeof s=="object"||typeof s=="function")for(let r of l(s))!o.call(t,r)&&r!==n&&e(t,r,{get:()=>s[r],enumerable:!(i=g(s,r))||i.enumerable});return t};var a=t=>c(e({},"__esModule",{value:!0}),t);var u={};module.exports=a(u);
|
|
2
2
|
//# sourceMappingURL=type.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/components/credits/creditsRedeemList/type.ts"],
|
|
4
|
-
"sourcesContent": ["export type CreditsRedeemListCopy = {\n title: string\n availableCredits: string\n unlockRewards: string\n btnRedeem: string\n list: {\n label: string\n list: {\n id: string\n type: string\n value: string\n rules: string[]\n }[]\n }[]\n redeemModal: {\n confirmTitle: string\n confirmButton: string\n commonError: string\n redeemLimitError: string\n inventoryNotEnough: string\n creditsNotEnough: string\n crossSiteError: string\n errorImageUrl: string\n coupon: {\n successDesc: string\n successTitle: string\n successButton: string\n successButtonUrl: string\n }\n product: {\n required: string\n invalidEmail: string\n shippingAddress: string\n shippingProduct: string\n addressForm: {\n key: string\n type: string\n label: string\n isSelect: boolean\n required: boolean\n placeholder: string\n }[][]\n form: {\n key: string\n type: string\n isSelect: boolean\n required: boolean\n placeholder: string\n }[][]\n successDesc: string[]\n rules: string[]\n steps: {\n imageUrl: string\n title: string\n }[]\n quantityLabel: string\n totalPriceLabel: string\n variantLabel: string\n shippingFeeLabel: string\n paymentButton: string\n stepTitle: string\n }\n }\n}\n"],
|
|
4
|
+
"sourcesContent": ["export type CreditsRedeemListCopy = {\n title: string\n availableCredits: string\n unlockRewards: string\n btnRedeem: string\n list: {\n label: string\n list: {\n id: string\n type: string\n value: string\n rules: string[]\n }[]\n }[]\n redeemModal: {\n confirmTitle: string\n confirmButton: string\n commonError: string\n redeemLimitError: string\n inventoryNotEnough: string\n creditsNotEnough: string\n crossSiteError: string\n errorImageUrl: string\n coupon: {\n successDesc: string\n successTitle: string\n successButton: string\n successButtonUrl: string\n }\n virtualProduct: {\n successDesc: string\n successTitle: string\n successButton: string\n successButtonUrl: string\n stepTitle?: string\n steps?: {\n imageUrl: string\n title: string\n }[]\n }\n product: {\n required: string\n invalidEmail: string\n shippingAddress: string\n shippingProduct: string\n addressForm: {\n key: string\n type: string\n label: string\n isSelect: boolean\n required: boolean\n placeholder: string\n }[][]\n form: {\n key: string\n type: string\n isSelect: boolean\n required: boolean\n placeholder: string\n }[][]\n successDesc: string[]\n rules: string[]\n steps: {\n imageUrl: string\n title: string\n }[]\n quantityLabel: string\n totalPriceLabel: string\n variantLabel: string\n shippingFeeLabel: string\n paymentButton: string\n stepTitle: string\n }\n }\n}\n"],
|
|
5
5
|
"mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
|
|
6
6
|
"names": ["type_exports", "__toCommonJS"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var k=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var q=Object.prototype.hasOwnProperty;var V=(t,n)=>{for(var p in n)k(t,p,{get:n[p],enumerable:!0})},J=(t,n,p,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of j(n))!q.call(t,a)&&a!==p&&k(t,a,{get:()=>n[a],enumerable:!(o=_(n,a))||o.enumerable});return t};var K=t=>J(k({},"__esModule",{value:!0}),t);var X={};V(X,{CreditsWaysToGetCredits:()=>Q});module.exports=K(X);var e=require("react/jsx-runtime"),i=require("@anker-in/headless-ui"),f=require("@heroicons/react/24/outline"),l=require("react"),x=require("./type"),I=require("./useActions"),R=require("../context/provider"),r=require("@anker-in/lib"),T=require("../../registration"),y=require("../modal/
|
|
1
|
+
"use strict";var k=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var q=Object.prototype.hasOwnProperty;var V=(t,n)=>{for(var p in n)k(t,p,{get:n[p],enumerable:!0})},J=(t,n,p,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of j(n))!q.call(t,a)&&a!==p&&k(t,a,{get:()=>n[a],enumerable:!(o=_(n,a))||o.enumerable});return t};var K=t=>J(k({},"__esModule",{value:!0}),t);var X={};V(X,{CreditsWaysToGetCredits:()=>Q});module.exports=K(X);var e=require("react/jsx-runtime"),i=require("@anker-in/headless-ui"),f=require("@heroicons/react/24/outline"),l=require("react"),x=require("./type"),I=require("./useActions"),R=require("../context/provider"),r=require("@anker-in/lib"),T=require("../../registration"),y=require("../modal/CreditsUploadReceiptModal"),D=require("../modal/SubscribeModal"),L=require("../../../constants");const Q=({copy:t,classNames:n,id:p})=>{const[o,a]=(0,l.useState)(!1),M=(0,l.useRef)(null),{profile:U}=(0,R.useCreditsContext)(),{authCodeActivate:O}=(0,T.useRegistration)(),{brand:B}=(0,r.useHeadlessContext)(),C=L.ROUNDED_BRANDS.includes(B),b=!!U,[A,N]=(0,l.useState)(!1),[P,h]=(0,l.useState)(!1),[w,E]=(0,l.useState)(!1),[F,W]=(0,l.useState)(!1),{actions:v}=(0,I.useActions)({copy:t,subscribe:{openSubscribePopup:()=>h(!0),isSuccess:w},uploadReceipt:{openUploadReceiptPopup:()=>N(!0),isSuccess:F}}),G=(0,l.useMemo)(()=>{const s=(t.list||[]).map(d=>{if(!v[d.id])return;const{finished:c,notLogin:S,notFinished:g,completed:H}=v[d.id];let u="",m,z;return b?c?(u=H.buttonLabel,m=void 0):(u=g.buttonLabel,m=g.handleClick,z=g.link):(u=S.buttonLabel,m=S.handleClick),{...d,buttonLabel:u,handleClick:m,finished:c,link:z}}).filter(Boolean);return b?s.sort((d,c)=>d?.finished&&!c?.finished?1:!d?.finished&&c?.finished?-1:0):s},[v,t.list,b]);return(0,l.useEffect)(()=>{if(!o&&window.innerWidth<768){const s=document.getElementById("ways-to-get-credits");if(s){const d=setTimeout(()=>{s.scrollIntoView({behavior:"smooth",block:"end"})},300);return()=>clearTimeout(d)}}},[o]),(0,e.jsxs)(i.Container,{id:p,className:" bg-[#F5F5F7] [&>div]:l:!px-0",children:[(0,e.jsxs)("div",{className:(0,r.classNames)("rounded-[16px] bg-[#1D1D1F] py-[64px] px-[140px] text-white md:px-[16px] l:rounded-none md-l:px-[32px] l-xl:px-[77px]",!C&&"rounded-none"),children:[(0,e.jsx)(i.Heading,{as:"h2",size:4,html:t?.title,className:"text-center l:pl-[16px] l:text-left"}),(0,e.jsxs)("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:[(0,e.jsxs)("div",{className:"pl-[16px] l:mt-[40px] desktop:pl-[24px] lg-desktop:pl-[32px]",children:[(0,e.jsx)(i.Heading,{size:3,as:"h3",html:t.subtitle,className:n?.subtitle}),(0,e.jsxs)("div",{className:"mt-[8px] flex items-center",children:[t.creditsIcon?.url&&(0,e.jsx)(i.Picture,{className:"size-[48px] mr-[8px] stroke-brand xl:size-[30px] [&_path]:stroke-brand",source:t.creditsIcon.url,alt:t.creditsIcon.alt||"credits"}),(0,e.jsx)(i.Heading,{html:t.equalCredits,size:4,as:"h3",className:(0,r.classNames)("mt-2 text-white md:text-[24px]",n?.equalCreditsText)})]})]}),(0,e.jsx)(i.Picture,{className:"w-full laptop:w-[50%]",source:t.mainImage?.url})]}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsxs)("div",{ref:M,className:(0,r.classNames)("relative mt-[64px] grid grid-cols-3 gap-[16px] overflow-hidden transition-all duration-300 md:mt-[16px] md:grid-cols-1 l:gap-[12px] md-l:mt-[32px] md-l:grid-cols-2",o?"min-md:!h-auto md:h-auto":"md:h-[512px] min-md:!h-auto"),children:[G.map(s=>(0,e.jsxs)("div",{className:(0,r.classNames)("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]",!C&&"rounded-none"),children:[(0,e.jsxs)("div",{children:[(0,e.jsx)(i.Text,{as:"p",html:s.title,size:2,className:"text-pretty text-[24px] font-bold xl:text-[20px]"}),(0,e.jsxs)("div",{className:"mt-[4px] flex items-center",children:[(0,e.jsx)(i.Picture,{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"}),(0,e.jsx)(i.Text,{as:"p",html:s.credits,size:2,className:"ml-[4px] mt-[6px] text-[18px] l:text-[14px]"})]})]}),s.handleClick&&!(s.id===x.TaskType.UploadReceipt&&F)&&!(s.id===x.TaskType.Activate&&O.isActivateSuccess)&&!(s.id===x.TaskType.Subscribe&&w)?(0,e.jsx)(i.Button,{as:s.link?"a":"button",...s.link&&{href:s.link},...s.handleClick&&{onClick:s.handleClick},variant:"primary",size:"lg",className:"mt-[24px] w-fit",children:s.buttonLabel}):(0,e.jsx)(i.Button,{variant:"primary",size:"lg",className:"mt-[24px] w-fit",disabled:!0,children:s.buttonLabel})]},s.id)),!o&&(0,e.jsx)("div",{className:"absolute inset-0 pointer-events-none min-md:hidden",style:{background:"linear-gradient(180deg, rgba(29, 29, 31, 0) 66.37%, #1D1D1F 100%)"}})]}),o?(0,e.jsx)("button",{className:"mx-auto mt-[12px] block w-fit min-md:hidden",onClick:()=>{a(!1)},children:(0,e.jsx)(f.ChevronUpIcon,{className:"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]"})}):(0,e.jsx)(e.Fragment,{children:(0,e.jsx)("div",{className:"absolute bottom-0 flex w-full translate-y-1/2 justify-center min-md:hidden",children:(0,e.jsx)("button",{className:"w-fit",onClick:()=>a(!o),children:(0,e.jsx)(f.ChevronDownIcon,{className:"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]"})})})})]})]}),t.receipt&&(0,e.jsx)(y.CreditsUploadReceiptModal,{isOpen:A,onClose:()=>{N(!1)},copy:t.receipt,onSuccess:()=>{W(!0)}}),t.subscribe&&(0,e.jsx)(D.CreditsSubscribeModal,{copy:t.subscribe,onSuccess:()=>{E(!0),setTimeout(()=>{h(!1)},3e3)},isOpen:P,onClose:()=>{h(!1)}})]})};
|
|
2
2
|
//# sourceMappingURL=CreditsWaysToGetCredits.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Button, Container, Heading, Picture, Text } from '@anker-in/headless-ui'\nimport { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/24/outline'\nimport { useEffect, useMemo, useRef, useState } from 'react'\n\nimport { TaskType, type CreditsWaysToGetCreditsProps } from './type'\nimport { useActions } from './useActions'\nimport { useCreditsContext } from '../context/provider'\nimport { classNames as cn, useHeadlessContext } from '@anker-in/lib'\nimport { useRegistration } from '../../registration'\nimport { CreditsUploadReceiptModal } from '../modal/creditsUploadReceiptModal'\nimport { CreditsSubscribeModal } from '../modal/subscribeModal'\nimport { ROUNDED_BRANDS } from '../../../constants'\n\nexport const CreditsWaysToGetCredits = ({ copy, classNames, id }: CreditsWaysToGetCreditsProps & { id?: string }) => {\n const [showMore, setShowMore] = useState(false)\n const containerRef = useRef<HTMLDivElement>(null)\n const { profile } = useCreditsContext()\n const { authCodeActivate } = useRegistration()\n const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n const isLogin = !!profile\n\n const [isUploadReceiptModalOpen, setIsUploadReceiptModalOpen] = useState(false)\n const [isSubscribeModalOpen, setIsSubscribeModalOpen] = useState(false)\n const [isSubscribeSuccess, setIsSubscribeSuccess] = useState(false)\n const [isUploadReceiptSuccess, setIsUploadReceiptSuccess] = useState(false)\n\n const { actions } = useActions({\n copy,\n subscribe: {\n openSubscribePopup: () => setIsSubscribeModalOpen(true),\n isSuccess: isSubscribeSuccess,\n },\n uploadReceipt: {\n openUploadReceiptPopup: () => setIsUploadReceiptModalOpen(true),\n isSuccess: isUploadReceiptSuccess,\n },\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 useEffect(() => {\n if (!showMore && window.innerWidth < 768) {\n const section = document.getElementById('ways-to-get-credits')\n if (section) {\n const timer = setTimeout(() => {\n section.scrollIntoView({ behavior: 'smooth', block: 'end' })\n }, 300)\n return () => clearTimeout(timer)\n }\n }\n }, [showMore])\n\n return (\n <Container id={id} className=\" bg-[#F5F5F7] [&>div]:l:!px-0\">\n <div\n className={cn(\n '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 !rounded && 'rounded-none'\n )}\n >\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 <div\n ref={containerRef}\n className={cn(\n 'relative mt-[64px] grid grid-cols-3 gap-[16px] overflow-hidden transition-all duration-300 md:mt-[16px] md:grid-cols-1 l:gap-[12px] md-l:mt-[32px] md-l:grid-cols-2',\n showMore ? 'min-md:!h-auto md:h-auto' : 'md:h-[512px] min-md:!h-auto'\n )}\n >\n {list.map(item => (\n <div\n key={item.id}\n className={cn(\n '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 !rounded && 'rounded-none'\n )}\n >\n <div>\n <Text\n as=\"p\"\n html={item.title}\n size={2}\n className=\"text-pretty text-[24px] font-bold xl:text-[20px]\"\n />\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\n as=\"p\"\n html={item.credits}\n size={2}\n className=\"ml-[4px] mt-[6px] text-[18px] l:text-[14px]\"\n />\n </div>\n </div>\n\n {item.handleClick &&\n !(item.id === TaskType.UploadReceipt && isUploadReceiptSuccess) &&\n !(item.id === TaskType.Activate && authCodeActivate.isActivateSuccess) &&\n !(item.id === TaskType.Subscribe && isSubscribeSuccess) ? (\n <Button\n as={item.link ? 'a' : 'button'}\n {...(item.link && { href: item.link })}\n {...(item.handleClick && { onClick: item.handleClick })}\n variant=\"primary\"\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 pointer-events-none min-md:hidden\"\n style={{ background: 'linear-gradient(180deg, rgba(29, 29, 31, 0) 66.37%, #1D1D1F 100%)' }}\n ></div>\n )}\n </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 {copy.receipt && (\n <CreditsUploadReceiptModal\n isOpen={isUploadReceiptModalOpen}\n onClose={() => {\n setIsUploadReceiptModalOpen(false)\n }}\n copy={copy.receipt}\n onSuccess={() => {\n setIsUploadReceiptSuccess(true)\n }}\n />\n )}\n {copy.subscribe && (\n <CreditsSubscribeModal\n copy={copy.subscribe}\n onSuccess={() => {\n setIsSubscribeSuccess(true)\n setTimeout(() => {\n setIsSubscribeModalOpen(false)\n }, 3000)\n }}\n isOpen={isSubscribeModalOpen}\n onClose={() => {\n setIsSubscribeModalOpen(false)\n }}\n />\n )}\n </Container>\n )\n}\n"],
|
|
4
|
+
"sourcesContent": ["import { Button, Container, Heading, Picture, Text } from '@anker-in/headless-ui'\nimport { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/24/outline'\nimport { useEffect, useMemo, useRef, useState } from 'react'\n\nimport { TaskType, type CreditsWaysToGetCreditsProps } from './type'\nimport { useActions } from './useActions'\nimport { useCreditsContext } from '../context/provider'\nimport { classNames as cn, useHeadlessContext } from '@anker-in/lib'\nimport { useRegistration } from '../../registration'\nimport { CreditsUploadReceiptModal } from '../modal/CreditsUploadReceiptModal'\nimport { CreditsSubscribeModal } from '../modal/SubscribeModal'\nimport { ROUNDED_BRANDS } from '../../../constants'\n\nexport const CreditsWaysToGetCredits = ({ copy, classNames, id }: CreditsWaysToGetCreditsProps & { id?: string }) => {\n const [showMore, setShowMore] = useState(false)\n const containerRef = useRef<HTMLDivElement>(null)\n const { profile } = useCreditsContext()\n const { authCodeActivate } = useRegistration()\n const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n const isLogin = !!profile\n\n const [isUploadReceiptModalOpen, setIsUploadReceiptModalOpen] = useState(false)\n const [isSubscribeModalOpen, setIsSubscribeModalOpen] = useState(false)\n const [isSubscribeSuccess, setIsSubscribeSuccess] = useState(false)\n const [isUploadReceiptSuccess, setIsUploadReceiptSuccess] = useState(false)\n\n const { actions } = useActions({\n copy,\n subscribe: {\n openSubscribePopup: () => setIsSubscribeModalOpen(true),\n isSuccess: isSubscribeSuccess,\n },\n uploadReceipt: {\n openUploadReceiptPopup: () => setIsUploadReceiptModalOpen(true),\n isSuccess: isUploadReceiptSuccess,\n },\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 useEffect(() => {\n if (!showMore && window.innerWidth < 768) {\n const section = document.getElementById('ways-to-get-credits')\n if (section) {\n const timer = setTimeout(() => {\n section.scrollIntoView({ behavior: 'smooth', block: 'end' })\n }, 300)\n return () => clearTimeout(timer)\n }\n }\n }, [showMore])\n\n return (\n <Container id={id} className=\" bg-[#F5F5F7] [&>div]:l:!px-0\">\n <div\n className={cn(\n '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 !rounded && 'rounded-none'\n )}\n >\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 <div\n ref={containerRef}\n className={cn(\n 'relative mt-[64px] grid grid-cols-3 gap-[16px] overflow-hidden transition-all duration-300 md:mt-[16px] md:grid-cols-1 l:gap-[12px] md-l:mt-[32px] md-l:grid-cols-2',\n showMore ? 'min-md:!h-auto md:h-auto' : 'md:h-[512px] min-md:!h-auto'\n )}\n >\n {list.map(item => (\n <div\n key={item.id}\n className={cn(\n '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 !rounded && 'rounded-none'\n )}\n >\n <div>\n <Text\n as=\"p\"\n html={item.title}\n size={2}\n className=\"text-pretty text-[24px] font-bold xl:text-[20px]\"\n />\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\n as=\"p\"\n html={item.credits}\n size={2}\n className=\"ml-[4px] mt-[6px] text-[18px] l:text-[14px]\"\n />\n </div>\n </div>\n\n {item.handleClick &&\n !(item.id === TaskType.UploadReceipt && isUploadReceiptSuccess) &&\n !(item.id === TaskType.Activate && authCodeActivate.isActivateSuccess) &&\n !(item.id === TaskType.Subscribe && isSubscribeSuccess) ? (\n <Button\n as={item.link ? 'a' : 'button'}\n {...(item.link && { href: item.link })}\n {...(item.handleClick && { onClick: item.handleClick })}\n variant=\"primary\"\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 pointer-events-none min-md:hidden\"\n style={{ background: 'linear-gradient(180deg, rgba(29, 29, 31, 0) 66.37%, #1D1D1F 100%)' }}\n ></div>\n )}\n </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 {copy.receipt && (\n <CreditsUploadReceiptModal\n isOpen={isUploadReceiptModalOpen}\n onClose={() => {\n setIsUploadReceiptModalOpen(false)\n }}\n copy={copy.receipt}\n onSuccess={() => {\n setIsUploadReceiptSuccess(true)\n }}\n />\n )}\n {copy.subscribe && (\n <CreditsSubscribeModal\n copy={copy.subscribe}\n onSuccess={() => {\n setIsSubscribeSuccess(true)\n setTimeout(() => {\n setIsSubscribeModalOpen(false)\n }, 3000)\n }}\n isOpen={isSubscribeModalOpen}\n onClose={() => {\n setIsSubscribeModalOpen(false)\n }}\n />\n )}\n </Container>\n )\n}\n"],
|
|
5
5
|
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,6BAAAE,IAAA,eAAAC,EAAAH,GAiHQ,IAAAI,EAAA,6BAjHRC,EAA0D,iCAC1DC,EAA+C,uCAC/CC,EAAqD,iBAErDC,EAA4D,kBAC5DC,EAA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,EAAK,YACJ,OAAC,6BACC,OAAQW,EACR,QAAS,IAAM,CACbC,EAA4B,EAAK,CACnC,EACA,KAAMZ,EAAK,QACX,UAAW,IAAM,CACfkB,EAA0B,EAAI,CAChC,EACF,EAEDlB,EAAK,cACJ,OAAC,yBACC,KAAMA,EAAK,UACX,UAAW,IAAM,CACfgB,EAAsB,EAAI,EAC1B,WAAW,IAAM,CACfF,EAAwB,EAAK,CAC/B,EAAG,GAAI,CACT,EACA,OAAQD,EACR,QAAS,IAAM,CACbC,EAAwB,EAAK,CAC/B,EACF,GAEJ,CAEJ",
|
|
6
|
-
"names": ["CreditsWaysToGetCredits_exports", "__export", "CreditsWaysToGetCredits", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_outline", "import_react", "import_type", "import_useActions", "import_provider", "import_lib", "import_registration", "
|
|
6
|
+
"names": ["CreditsWaysToGetCredits_exports", "__export", "CreditsWaysToGetCredits", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_outline", "import_react", "import_type", "import_useActions", "import_provider", "import_lib", "import_registration", "import_CreditsUploadReceiptModal", "import_SubscribeModal", "import_constants", "copy", "classNames", "id", "showMore", "setShowMore", "containerRef", "profile", "authCodeActivate", "brand", "rounded", "isLogin", "isUploadReceiptModalOpen", "setIsUploadReceiptModalOpen", "isSubscribeModalOpen", "setIsSubscribeModalOpen", "isSubscribeSuccess", "setIsSubscribeSuccess", "isUploadReceiptSuccess", "setIsUploadReceiptSuccess", "actions", "list", "item", "finished", "notLogin", "notFinished", "completed", "buttonLabel", "handleClick", "link", "a", "b", "section", "timer", "cn"]
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ReceiptCopy } from '../modal/
|
|
2
|
-
import type { CreditsSubscribeModalCopy } from '../modal/
|
|
1
|
+
import type { ReceiptCopy } from '../modal/CreditsUploadReceiptModal';
|
|
2
|
+
import type { CreditsSubscribeModalCopy } from '../modal/SubscribeModal';
|
|
3
3
|
export type BenefitItem = {
|
|
4
4
|
title: string;
|
|
5
5
|
credits: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/components/credits/creditsWaysToGetCredits/type.ts"],
|
|
4
|
-
"sourcesContent": ["import type { ReceiptCopy } from '../modal/
|
|
4
|
+
"sourcesContent": ["import type { ReceiptCopy } from '../modal/CreditsUploadReceiptModal'\nimport type { CreditsSubscribeModalCopy } from '../modal/SubscribeModal'\n\nexport type BenefitItem = {\n title: string\n credits: string\n id: string\n}\n\nexport type CreditsWaysToGetCreditsCopy = {\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 subscribeLabel: string\n sendEmailSuccess: string\n creditsIcon: {\n url: string\n alt: string\n }\n receipt: ReceiptCopy\n subscribe: CreditsSubscribeModalCopy\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: CreditsWaysToGetCreditsCopy\n classNames?: {\n equalCreditsText?: string\n subtitle?: string\n }\n}\n"],
|
|
5
5
|
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,cAAAE,IAAA,eAAAC,EAAAH,GAqCO,IAAKE,OACVA,EAAA,SAAW,WACXA,EAAA,UAAY,YACZA,EAAA,gBAAkB,kBAClBA,EAAA,cAAgB,gBAChBA,EAAA,cAAgB,gBAChBA,EAAA,KAAO,OANGA,OAAA",
|
|
6
6
|
"names": ["type_exports", "__export", "TaskType", "__toCommonJS"]
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { CreditsProvider, useCreditsContext } from './context/provider';
|
|
2
2
|
export { useUploadReceipt as useCreditsUploadReceipt } from './context/hooks/useUploadReceipt';
|
|
3
|
-
export { CreditsUploadReceiptModal } from './modal/
|
|
3
|
+
export { CreditsUploadReceiptModal } from './modal/CreditsUploadReceiptModal';
|
|
4
4
|
export { CreditsBanner } from './creditsBanner';
|
|
5
5
|
export { CreditsBenefits } from './creditsBenefits';
|
|
6
6
|
export { CreditsInfoCard } from './creditsInfoCard';
|
|
@@ -8,3 +8,4 @@ export { CreditsWaysToGetCredits } from './creditsWaysToGetCredits';
|
|
|
8
8
|
export { CreditsFaq } from './creditsFaq';
|
|
9
9
|
export { CreditsCash } from './creditsCash';
|
|
10
10
|
export { CreditsRedeemList } from './creditsRedeemList';
|
|
11
|
+
export { CreditsGoGift } from './creditsGoGift';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var d=Object.defineProperty;var
|
|
1
|
+
"use strict";var d=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var U=Object.prototype.hasOwnProperty;var B=(r,e)=>{for(var o in e)d(r,o,{get:e[o],enumerable:!0})},h=(r,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of G(e))!U.call(r,t)&&t!==o&&d(r,t,{get:()=>e[t],enumerable:!(i=u(e,t))||i.enumerable});return r};var q=r=>h(d({},"__esModule",{value:!0}),r);var v={};B(v,{CreditsBanner:()=>f.CreditsBanner,CreditsBenefits:()=>m.CreditsBenefits,CreditsCash:()=>l.CreditsCash,CreditsFaq:()=>n.CreditsFaq,CreditsGoGift:()=>c.CreditsGoGift,CreditsInfoCard:()=>x.CreditsInfoCard,CreditsProvider:()=>s.CreditsProvider,CreditsRedeemList:()=>R.CreditsRedeemList,CreditsUploadReceiptModal:()=>C.CreditsUploadReceiptModal,CreditsWaysToGetCredits:()=>a.CreditsWaysToGetCredits,useCreditsContext:()=>s.useCreditsContext,useCreditsUploadReceipt:()=>p.useUploadReceipt});module.exports=q(v);var s=require("./context/provider"),p=require("./context/hooks/useUploadReceipt"),C=require("./modal/CreditsUploadReceiptModal"),f=require("./creditsBanner"),m=require("./creditsBenefits"),x=require("./creditsInfoCard"),a=require("./creditsWaysToGetCredits"),n=require("./creditsFaq"),l=require("./creditsCash"),R=require("./creditsRedeemList"),c=require("./creditsGoGift");
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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/
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,
|
|
6
|
-
"names": ["credits_exports", "__export", "__toCommonJS", "import_provider", "import_useUploadReceipt", "
|
|
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'\nexport { CreditsGoGift } from './creditsGoGift'\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qfAAAE,EAAAF,GAAA,IAAAG,EAAmD,8BAEnDC,EAA4D,4CAC5DC,EAA0C,6CAC1CC,EAA8B,2BAC9BC,EAAgC,6BAChCC,EAAgC,6BAChCC,EAAwC,qCACxCC,EAA2B,wBAC3BC,EAA4B,yBAC5BC,EAAkC,+BAClCC,EAA8B",
|
|
6
|
+
"names": ["credits_exports", "__export", "__toCommonJS", "import_provider", "import_useUploadReceipt", "import_CreditsUploadReceiptModal", "import_creditsBanner", "import_creditsBenefits", "import_creditsInfoCard", "import_creditsWaysToGetCredits", "import_creditsFaq", "import_creditsCash", "import_creditsRedeemList", "import_creditsGoGift"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var I=Object.create;var f=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty;var z=(e,r)=>{for(var a in r)f(e,a,{get:r[a],enumerable:!0})},_=(e,r,a,m)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of j(r))!H.call(e,n)&&n!==a&&f(e,n,{get:()=>r[n],enumerable:!(m=O(r,n))||m.enumerable});return e};var x=(e,r,a)=>(a=e!=null?I(F(e)):{},_(r||!e||!e.__esModule?f(a,"default",{value:e,enumerable:!0}):a,e)),q=e=>_(f({},"__esModule",{value:!0}),e);var $={};z($,{default:()=>V});module.exports=q($);var i=require("react/jsx-runtime"),o=require("react"),M=require("../context/provider"),t=require("../context/const"),P=x(require("../context/hooks/useActivities")),C=require("./
|
|
2
|
-
//# sourceMappingURL=
|
|
1
|
+
"use strict";var I=Object.create;var f=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty;var z=(e,r)=>{for(var a in r)f(e,a,{get:r[a],enumerable:!0})},_=(e,r,a,m)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of j(r))!H.call(e,n)&&n!==a&&f(e,n,{get:()=>r[n],enumerable:!(m=O(r,n))||m.enumerable});return e};var x=(e,r,a)=>(a=e!=null?I(F(e)):{},_(r||!e||!e.__esModule?f(a,"default",{value:e,enumerable:!0}):a,e)),q=e=>_(f({},"__esModule",{value:!0}),e);var $={};z($,{default:()=>V});module.exports=q($);var i=require("react/jsx-runtime"),o=require("react"),M=require("../context/provider"),t=require("../context/const"),P=x(require("../context/hooks/useActivities")),C=require("./ModalContainer"),d=require("@anker-in/lib"),c=require("@anker-in/headless-ui"),D=x(require("./LoadingDots")),T=require("@anker-in/headless-ui"),S=require("../../../constants"),y=x(require("dayjs"));function K({data:e,...r}){const[a,m]=(0,o.useState)(1),{taskIdToTypeMapping:n}=(0,M.useCreditsContext)(),{brand:U}=(0,d.useHeadlessContext)(),b=S.ROUNDED_BRANDS.includes(U),L=(0,o.useMemo)(()=>({page:r.isOpen?a:0,pageSize:1e3}),[r.isOpen,a]),[u,E]=(0,o.useState)(t.CreditType.All),R=(0,o.useMemo)(()=>{const p=[{title:e.allTab,type:t.CreditType.All},{title:e.earnedTab,type:t.CreditType.Earned},{title:e.deductedTab,type:t.CreditType.Deducted}];return e.expiredTab&&p.push({title:e.expiredTab,type:t.CreditType.Expired}),p},[e]),{activities:h=[],canNext:N,isLoading:A}=(0,P.default)(L),v=(0,o.useMemo)(()=>{const p={[t.TaskSubType.Activation]:e.activationTask,[t.TaskSubType.UpdateName]:e.updateNameTask,[t.TaskSubType.UpdatePhone]:e.updatePhoneTask,[t.TaskSubType.UpdateBirthday]:e.updateBirthdayTask,[t.TaskSubType.Subscription]:e.subscriptionTask,[t.TaskSubType.UpadteAppName]:e.updateAppNameTask,[t.TaskSubType.Refund]:e.refundTask,[t.TaskSubType.ProductUnApproved]:e.productUnApprovedTask},k={[t.DTC_TASK_TYPE.FirstPurchase]:e.firstPurchaseTask,[t.DTC_TASK_TYPE.UploadReceipt]:e.uploadReceiptTask,[t.DTC_TASK_TYPE.Shopping]:e.shoppingTask};function w(s){return s.task_type===t.TaskType.Redeem&&s.task_sub_type===t.TaskSubType.ProductUnApproved&&e.productUnApprovedTask?s.task_name.replace("Refund",e.productUnApprovedTask):n?.[String(s.task_rule_id)]?k[n?.[String(s.task_rule_id)]]:p[s.task_sub_type]||s.task_name}let l=h.map(s=>({title:w(s),date:new Date(s.create_time*1e3),value:s.credit,type:s.credit_type,pending_time:s.pending_time,credit_type:s.credit_type,status:s.status}))||[];return u===t.CreditType.Earned?l=l?.filter(s=>s.type===1):u===t.CreditType.Deducted?l=l?.filter(s=>s.type===2&&s.status!==3):u===t.CreditType.Expired&&(l=l?.filter(s=>s.type===2&&s.status===3)),l.map(s=>{let{value:g,...B}=s;return s.type===t.CreditType.Deducted&&g>0&&(g=-g),{value:g,...B}})},[e.activationTask,e.updateNameTask,e.updatePhoneTask,e.updateBirthdayTask,e.subscriptionTask,e.updateAppNameTask,e.refundTask,e.productUnApprovedTask,e.firstPurchaseTask,e.uploadReceiptTask,e.shoppingTask,h,u,n]),Y=(0,o.useCallback)(()=>{N&&m(a+1)},[a,N]);return(0,i.jsxs)(C.CreditsModalContainer,{title:e.title,className:(0,d.classNames)("h-[800px] w-[640px]"),useAnimation:!0,animationClassName:"md:translate-y-[100vh]",scrollClassName:"",...r,onScrollEnd:Y,children:[(0,i.jsx)("div",{className:"w-full sticky top-0 bg-white z-10 pb-[24px] overflow-x-auto",children:(0,i.jsx)(c.Tabs,{align:"left",shape:b?"rounded":"square",value:u.toString(),onValueChange:p=>{E(Number(p))},className:"",children:(0,i.jsx)(c.TabsList,{children:R.map(p=>(0,i.jsx)(c.TabsTrigger,{value:p.type.toString(),children:p.title},p.type))})})}),(0,i.jsxs)("div",{className:"grid gap-[18px] overflow-auto overscroll-contain md:gap-[12px]",children:[A&&(0,i.jsx)("div",{className:"flex h-full flex-col items-center justify-center",children:(0,i.jsx)(D.default,{})}),!A&&(0,i.jsx)(i.Fragment,{children:v.length>0?v.map((p,k)=>(0,i.jsxs)("div",{className:(0,d.classNames)("flex h-fit items-center justify-between rounded-[8px] bg-[#f2f0f1] px-[16px] py-[20px] text-[16px]",!b&&"rounded-none"),children:[(0,i.jsxs)("div",{className:"grid gap-[6px]",children:[(0,i.jsx)("div",{className:"font-bold",children:p.title}),(0,i.jsx)("div",{className:"text-[14px] font-semibold text-[#999]",children:(0,y.default)(p.date).format("YYYY-MM-DD HH:mm").toString()}),!e.pendingTips&&(0,i.jsxs)("div",{className:`hidden text-[14px] font-semibold text-[#777] ${p.status===2&&p.credit_type===1?"!flex":""}`,children:[(0,i.jsx)(T.Text,{html:e.pendingTips}),(0,i.jsx)("span",{children:y.default.unix(p.pending_time).add(1,"day").format("YYYY-MM-DD")}),e.pendingTips2&&(0,i.jsx)(T.Text,{html:e.pendingTips2})]})]}),(0,i.jsxs)("div",{className:(0,d.classNames)("font-bold",p.value>=0||p.credit_type===t.CreditType.Expired?"text-[#52C41A]":"text-[#F84D4F]"),children:[p.value>=0&&"+",p.value]})]},k)):(0,i.jsxs)("div",{className:"flex h-full flex-col items-center justify-center",children:[(0,i.jsx)(T.Picture,{className:"mb-[16px] h-[120px] w-[160px]",source:e?.emptyListImage?.url,alt:e?.emptyListImage?.alt||"empty list image"}),(0,i.jsx)("div",{className:"leading-1.4 text-[16px] font-semibold",children:e?.emptyListLabel})]})})]}),v.length>0&&(0,i.jsx)("div",{className:"mt-[12px] pb-[24px] text-[14px] font-semibold text-[#999]",children:e.tips})]})}var V=K;
|
|
2
|
+
//# sourceMappingURL=ActivitiesModal.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/components/credits/modal/
|
|
4
|
-
"sourcesContent": ["import { useCallback, useMemo, useState } from 'react'\nimport { useCreditsContext } from '../context/provider'\nimport { CreditType, DTC_TASK_TYPE, TaskSubType, TaskType } from '../context/const'\nimport useActivities from '../context/hooks/useActivities'\nimport type { Task } from '../context/response'\nimport { CreditsModalContainer, type ModalContainerProps } from './
|
|
3
|
+
"sources": ["../../../../../src/components/credits/modal/ActivitiesModal.tsx"],
|
|
4
|
+
"sourcesContent": ["import { useCallback, useMemo, useState } from 'react'\nimport { useCreditsContext } from '../context/provider'\nimport { CreditType, DTC_TASK_TYPE, TaskSubType, TaskType } from '../context/const'\nimport useActivities from '../context/hooks/useActivities'\nimport type { Task } from '../context/response'\nimport { CreditsModalContainer, type ModalContainerProps } from './ModalContainer'\nimport { classNames as cn, useHeadlessContext } from '@anker-in/lib'\nimport { Tabs, TabsList, TabsTrigger } from '@anker-in/headless-ui'\nimport LoadingDots from './LoadingDots'\nimport { Picture, Text } from '@anker-in/headless-ui'\nimport { ROUNDED_BRANDS } from '../../../constants'\nimport dayjs from 'dayjs'\n\nexport interface MyActivitiesMetafields {\n title: string\n tips: string\n allTab: string\n earnedTab: string\n deductedTab: string\n expiredTab: string\n activationTask: string\n updateNameTask: string\n updatePhoneTask: string\n updateBirthdayTask: string\n updateAppNameTask: string\n subscriptionTask: string\n refundTask: string\n productUnApprovedTask: string\n pendingTips?: string\n pendingTips2?: string\n firstPurchaseTask: string\n uploadReceiptTask: string\n shoppingTask: string\n emptyListImage: {\n url: string\n alt?: string\n }\n emptyListLabel: string\n}\n\ninterface ActivitiesModalProps extends ModalContainerProps {\n data: MyActivitiesMetafields\n}\n\nfunction ActivitiesModal({ data, ...props }: ActivitiesModalProps) {\n const [page, setPage] = useState(1)\n const { taskIdToTypeMapping } = useCreditsContext()\n const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n\n const myActivitiesOptions = useMemo(() => {\n return {\n page: props.isOpen ? page : 0,\n pageSize: 1000,\n }\n }, [props.isOpen, page])\n\n const [activeTab, setActiveTab] = useState(CreditType.All)\n const tabs = useMemo(() => {\n const tabs = [\n {\n title: data.allTab,\n type: CreditType.All,\n },\n {\n title: data.earnedTab,\n type: CreditType.Earned,\n },\n {\n title: data.deductedTab,\n type: CreditType.Deducted,\n },\n ]\n if (data.expiredTab) {\n tabs.push({\n title: data.expiredTab,\n type: CreditType.Expired,\n })\n }\n return tabs\n }, [data])\n\n const { activities = [], canNext, isLoading } = useActivities(myActivitiesOptions)\n\n const list = useMemo(() => {\n const taskNameMap = {\n [TaskSubType.Activation]: data.activationTask,\n [TaskSubType.UpdateName]: data.updateNameTask,\n [TaskSubType.UpdatePhone]: data.updatePhoneTask,\n [TaskSubType.UpdateBirthday]: data.updateBirthdayTask,\n [TaskSubType.Subscription]: data.subscriptionTask,\n [TaskSubType.UpadteAppName]: data.updateAppNameTask,\n [TaskSubType.Refund]: data.refundTask,\n [TaskSubType.ProductUnApproved]: data.productUnApprovedTask,\n }\n const dtcTaskTypeToNameMap = {\n [DTC_TASK_TYPE.FirstPurchase]: data.firstPurchaseTask,\n [DTC_TASK_TYPE.UploadReceipt]: data.uploadReceiptTask,\n [DTC_TASK_TYPE.Shopping]: data.shoppingTask,\n }\n\n function getTitle(item: Task) {\n if (\n item.task_type === TaskType.Redeem &&\n item.task_sub_type === TaskSubType.ProductUnApproved &&\n data.productUnApprovedTask\n ) {\n // \u65B0\u589E\u7684\u90E8\u5206\u4EFB\u52A1\u90FD\u4F7F\u7528\u4E86 alpc \u540C\u4E00\u4E2A\u4EFB\u52A1\u7C7B\u578B\uFF0C\u9700\u8981\u7528\u4EFB\u52A1 id \u6765\u533A\u5206\n return item.task_name.replace('Refund', data.productUnApprovedTask)\n } else if (taskIdToTypeMapping?.[String(item.task_rule_id)]) {\n return dtcTaskTypeToNameMap[taskIdToTypeMapping?.[String(item.task_rule_id)]]\n } else {\n return taskNameMap[item.task_sub_type] || item.task_name\n }\n }\n\n const all = activities.map(item => ({\n title: getTitle(item),\n date: new Date(item.create_time * 1000),\n value: item.credit,\n type: item.credit_type,\n pending_time: item.pending_time,\n credit_type: item.credit_type,\n status: item.status,\n }))\n\n let filtered = all || []\n if (activeTab === CreditType.Earned) {\n filtered = filtered?.filter(item => item.type === 1)\n } else if (activeTab === CreditType.Deducted) {\n filtered = filtered?.filter(item => item.type === 2 && item.status !== 3)\n } else if (activeTab === CreditType.Expired) {\n filtered = filtered?.filter(item => item.type === 2 && item.status === 3)\n }\n\n return filtered.map(item => {\n let { value, ...otherItem } = item\n if (item.type === CreditType.Deducted && value > 0) {\n value = -value\n }\n\n return {\n value,\n ...otherItem,\n }\n })\n }, [\n data.activationTask,\n data.updateNameTask,\n data.updatePhoneTask,\n data.updateBirthdayTask,\n data.subscriptionTask,\n data.updateAppNameTask,\n data.refundTask,\n data.productUnApprovedTask,\n data.firstPurchaseTask,\n data.uploadReceiptTask,\n data.shoppingTask,\n activities,\n activeTab,\n taskIdToTypeMapping,\n ])\n\n const handleScrollEnd = useCallback(() => {\n if (!canNext) {\n return\n }\n setPage(page + 1)\n }, [page, canNext])\n\n return (\n <CreditsModalContainer\n title={data.title}\n className={cn('h-[800px] w-[640px]')}\n useAnimation\n animationClassName=\"md:translate-y-[100vh]\"\n scrollClassName=\"\"\n {...props}\n onScrollEnd={handleScrollEnd}\n >\n <div className=\"w-full sticky top-0 bg-white z-10 pb-[24px] overflow-x-auto\">\n <Tabs\n align=\"left\"\n shape={rounded ? 'rounded' : 'square'}\n value={activeTab.toString()}\n onValueChange={value => {\n setActiveTab(Number(value))\n }}\n className=\"\"\n >\n <TabsList>\n {tabs.map(tab => (\n <TabsTrigger key={tab.type} value={tab.type.toString()}>\n {tab.title}\n </TabsTrigger>\n ))}\n </TabsList>\n </Tabs>\n </div>\n\n <div className=\"grid gap-[18px] overflow-auto overscroll-contain md:gap-[12px]\">\n {isLoading && (\n <div className=\"flex h-full flex-col items-center justify-center\">\n <LoadingDots />\n </div>\n )}\n\n {!isLoading && (\n <>\n {list.length > 0 ? (\n list.map((item, index) => (\n <div\n key={index}\n className={cn(\n 'flex h-fit items-center justify-between rounded-[8px] bg-[#f2f0f1] px-[16px] py-[20px] text-[16px]',\n !rounded && 'rounded-none'\n )}\n >\n <div className=\"grid gap-[6px]\">\n <div className=\"font-bold\">{item.title}</div>\n <div className=\"text-[14px] font-semibold text-[#999]\">\n {dayjs(item.date).format('YYYY-MM-DD HH:mm').toString()}\n </div>\n {!data.pendingTips && (\n <div\n className={`hidden text-[14px] font-semibold text-[#777] ${item.status === 2 && item.credit_type === 1 ? '!flex' : ''}`}\n >\n <Text html={data.pendingTips} />\n <span>{dayjs.unix(item.pending_time).add(1, 'day').format('YYYY-MM-DD')}</span>\n {data.pendingTips2 && <Text html={data.pendingTips2} />}\n </div>\n )}\n </div>\n <div\n className={cn(\n 'font-bold',\n item.value >= 0 || item.credit_type === CreditType.Expired ? 'text-[#52C41A]' : 'text-[#F84D4F]'\n )}\n >\n {item.value >= 0 && '+'}\n {item.value}\n </div>\n </div>\n ))\n ) : (\n <div className=\"flex h-full flex-col items-center justify-center\">\n <Picture\n className=\"mb-[16px] h-[120px] w-[160px]\"\n source={data?.emptyListImage?.url}\n alt={data?.emptyListImage?.alt || 'empty list image'}\n ></Picture>\n <div className=\"leading-1.4 text-[16px] font-semibold\">{data?.emptyListLabel}</div>\n </div>\n )}\n </>\n )}\n </div>\n {/* \u79EF\u5206\u5230\u8D26\u65F6\u95F4\u63D0\u9192 */}\n {list.length > 0 && <div className=\"mt-[12px] pb-[24px] text-[14px] font-semibold text-[#999]\">{data.tips}</div>}\n </CreditsModalContainer>\n )\n}\n\nexport default ActivitiesModal\n"],
|
|
5
5
|
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAgMc,IAAAI,EAAA,6BAhMdC,EAA+C,iBAC/CC,EAAkC,+BAClCC,EAAiE,4BACjEC,EAA0B,6CAE1BC,EAAgE,4BAChEC,EAAqD,yBACrDC,EAA4C,iCAC5CC,EAAwB,4BACxBD,EAA8B,iCAC9BE,EAA+B,8BAC/BC,EAAkB,oBAiClB,SAASC,EAAgB,CAAE,KAAAC,EAAM,GAAGC,CAAM,EAAyB,CACjE,KAAM,CAACC,EAAMC,CAAO,KAAI,YAAS,CAAC,EAC5B,CAAE,oBAAAC,CAAoB,KAAI,qBAAkB,EAC5C,CAAE,MAAAC,CAAM,KAAI,sBAAmB,EAC/BC,EAAU,iBAAe,SAASD,CAAK,EAEvCE,KAAsB,WAAQ,KAC3B,CACL,KAAMN,EAA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B,GAAM,gBAAgB,IAC9B,IAAKA,GAAM,gBAAgB,KAAO,mBACnC,KACD,OAAC,OAAI,UAAU,wCAAyC,SAAAA,GAAM,eAAe,GAC/E,EAEJ,GAEJ,EAECe,EAAK,OAAS,MAAK,OAAC,OAAI,UAAU,4DAA6D,SAAAf,EAAK,KAAK,GAC5G,CAEJ,CAEA,IAAOd,EAAQa",
|
|
6
|
-
"names": ["
|
|
6
|
+
"names": ["ActivitiesModal_exports", "__export", "ActivitiesModal_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_provider", "import_const", "import_useActivities", "import_ModalContainer", "import_lib", "import_headless_ui", "import_LoadingDots", "import_constants", "import_dayjs", "ActivitiesModal", "data", "props", "page", "setPage", "taskIdToTypeMapping", "brand", "rounded", "myActivitiesOptions", "activeTab", "setActiveTab", "tabs", "activities", "canNext", "isLoading", "useActivities", "list", "taskNameMap", "dtcTaskTypeToNameMap", "getTitle", "item", "filtered", "value", "otherItem", "handleScrollEnd", "cn", "tab", "LoadingDots", "index", "dayjs"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var O=Object.create;var d=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var w=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var F=(s,t)=>{for(var e in t)d(s,e,{get:t[e],enumerable:!0})},N=(s,t,e,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of k(t))!B.call(s,o)&&o!==e&&d(s,o,{get:()=>t[o],enumerable:!(a=P(t,o))||a.enumerable});return s};var H=(s,t,e)=>(e=s!=null?O(w(s)):{},N(t||!s||!s.__esModule?d(e,"default",{value:s,enumerable:!0}):e,s)),U=s=>N(d({},"__esModule",{value:!0}),s);var E={};F(E,{CreditsUploadReceiptModal:()=>A});module.exports=U(E);var i=require("react/jsx-runtime"),n=require("@anker-in/headless-ui"),l=require("react"),m=require("./
|
|
2
|
-
//# sourceMappingURL=
|
|
1
|
+
"use strict";var O=Object.create;var d=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var w=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var F=(s,t)=>{for(var e in t)d(s,e,{get:t[e],enumerable:!0})},N=(s,t,e,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of k(t))!B.call(s,o)&&o!==e&&d(s,o,{get:()=>t[o],enumerable:!(a=P(t,o))||a.enumerable});return s};var H=(s,t,e)=>(e=s!=null?O(w(s)):{},N(t||!s||!s.__esModule?d(e,"default",{value:s,enumerable:!0}):e,s)),U=s=>N(d({},"__esModule",{value:!0}),s);var E={};F(E,{CreditsUploadReceiptModal:()=>A});module.exports=U(E);var i=require("react/jsx-runtime"),n=require("@anker-in/headless-ui"),l=require("react"),m=require("./ModalContainer"),h=require("../context/hooks/useUploadReceipt"),b=require("@anker-in/lib"),D=H(require("classnames")),R=require("../../../constants");function A({isOpen:s,onClose:t,copy:e,onSuccess:a}){const{trigger:o,isMutating:S}=(0,h.useUploadReceipt)(),[p,u]=(0,l.useState)(""),[x,f]=(0,l.useState)(!1),[r,g]=(0,l.useState)({icon:"",title:"",description:"",isSuccess:!1}),{brand:T}=(0,b.useHeadlessContext)(),v=R.ROUNDED_BRANDS.includes(T),I=(0,l.useCallback)(()=>{o({orderName:p},{onSuccess:c=>{if(f(!0),c?.ok)a(),g({icon:e.successIcon,title:e.successTitle||"Success",description:e.successDescription||"Your receipt has been uploaded successfully",isSuccess:!0});else{const z=e.failedReasons.find(M=>M.code===c.code?.toString());g({icon:e.failedIcon,title:e.failedTitle||"Failed",description:z?.description||"Please try again",isSuccess:!1})}}})},[o,p,a,e.successIcon,e.successTitle,e.successDescription,e.failedReasons,e.failedIcon,e.failedTitle]),C=()=>{f(!1),u(""),r.isSuccess&&t()};return(0,i.jsxs)(m.CreditsModalContainer,{isOpen:s,onClose:t,className:"w-[540px] md:h-auto",scrollClassName:"mb-[40px] min-l:px-[48px] md:mb-0 md:pb-[24px] md:px-[16px]",titleClassName:"h-[56px]",useAnimation:!0,animationClassName:"md:translate-y-[100vh]",children:[(0,i.jsx)(n.Heading,{size:"3",children:e.title}),(0,i.jsx)(n.Text,{size:"3",className:"mt-[8px] md:mt-[4px]",children:e.description}),(0,i.jsx)("input",{placeholder:e.placeholder,className:(0,D.default)("mt-[24px] h-[50px] w-full rounded-[2px] border border-[#6D6D6F] pl-[14px] text-[16px] font-bold placeholder:text-[16px] placeholder:font-bold placeholder:text-[#6D6D6F] focus:outline-none focus:ring-0 md:rounded-[4px] md:placeholder:text-[14px]",!v&&"rounded-none"),value:p,onChange:c=>u(c.target.value)}),(0,i.jsx)(n.Text,{size:"1",as:"p",className:"mt-[8px] text-[#6D6D6F]",children:e.note}),(0,i.jsx)(n.Button,{variant:"primary",className:"mt-[24px] w-full",loading:S,onClick:I,children:e.submit}),x&&(0,i.jsxs)(m.CreditsModalContainer,{isOpen:x,onClose:C,className:"w-[540px] md:h-auto",scrollClassName:"mb-[40px] min-l:px-[48px] md:mb-0 md:pb-[24px] md:px-[16px] flex flex-col items-center text-center",titleClassName:"h-[56px]",children:[(0,i.jsx)(n.Text,{size:"3",className:"size-[64px]",as:"div",html:r.icon}),(0,i.jsx)(n.Heading,{size:"3",className:"mt-[16px]",children:r.title}),(0,i.jsx)(n.Text,{size:"3",className:"mt-[8px] md:mt-[4px]",children:r.description}),(0,i.jsx)(n.Button,{variant:"primary",className:"mt-[24px]",onClick:C,children:e.gotIt})]})]})}
|
|
2
|
+
//# sourceMappingURL=CreditsUploadReceiptModal.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/components/credits/modal/
|
|
4
|
-
"sourcesContent": ["import { Button, Heading, Text } from '@anker-in/headless-ui'\nimport { useCallback, useState } from 'react'\nimport { CreditsModalContainer } from './
|
|
3
|
+
"sources": ["../../../../../src/components/credits/modal/CreditsUploadReceiptModal.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Button, Heading, Text } from '@anker-in/headless-ui'\nimport { useCallback, useState } from 'react'\nimport { CreditsModalContainer } from './ModalContainer'\nimport { useUploadReceipt } from '../context/hooks/useUploadReceipt'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport classNames from 'classnames'\nimport { ROUNDED_BRANDS } from '../../../constants'\n\nexport type ReceiptCopy = {\n title: string\n description: string\n placeholder: string\n note: string\n submit: string\n successTitle: string\n successDescription: string\n gotIt: string\n failedTitle: string\n successIcon: string\n failedIcon: string\n failedReasons: {\n code: string\n id: string\n description: string\n }[]\n}\n\nexport function CreditsUploadReceiptModal({\n isOpen,\n onClose,\n copy,\n onSuccess,\n}: {\n isOpen: boolean\n onClose: () => void\n copy: ReceiptCopy\n onSuccess: () => void\n}) {\n const { trigger, isMutating } = useUploadReceipt()\n const [orderName, setOrderName] = useState('')\n const [resultPopup, setResultPopup] = useState(false)\n const [resultPopupContent, setResultPopupContent] = useState({\n icon: '',\n title: '',\n description: '',\n isSuccess: false,\n })\n\n const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n\n const handleSubmit = useCallback(() => {\n trigger(\n { orderName },\n {\n onSuccess: result => {\n setResultPopup(true)\n if (result?.ok) {\n onSuccess()\n setResultPopupContent({\n icon: copy.successIcon,\n title: copy.successTitle || 'Success',\n description: copy.successDescription || 'Your receipt has been uploaded successfully',\n isSuccess: true,\n })\n } else {\n const error = copy.failedReasons.find(reason => reason.code === result.code?.toString())\n setResultPopupContent({\n icon: copy.failedIcon,\n title: copy.failedTitle || 'Failed',\n description: error?.description || 'Please try again',\n isSuccess: false,\n })\n }\n },\n }\n )\n }, [\n trigger,\n orderName,\n onSuccess,\n copy.successIcon,\n copy.successTitle,\n copy.successDescription,\n copy.failedReasons,\n copy.failedIcon,\n copy.failedTitle,\n ])\n\n const handleResultClose = () => {\n setResultPopup(false)\n setOrderName('')\n // \u5982\u679C\u4E0A\u4F20\u6210\u529F\uFF0C\u5168\u90E8\u5F39\u7A97\u5173\u95ED\n if (resultPopupContent.isSuccess) {\n onClose()\n }\n }\n\n return (\n <CreditsModalContainer\n isOpen={isOpen}\n onClose={onClose}\n className=\"w-[540px] md:h-auto\"\n scrollClassName=\"mb-[40px] min-l:px-[48px] md:mb-0 md:pb-[24px] md:px-[16px]\"\n titleClassName=\"h-[56px]\"\n useAnimation\n animationClassName=\"md:translate-y-[100vh]\"\n >\n <Heading size=\"3\">{copy.title}</Heading>\n <Text size=\"3\" className=\"mt-[8px] md:mt-[4px]\">\n {copy.description}\n </Text>\n <input\n placeholder={copy.placeholder}\n className={classNames(\n 'mt-[24px] h-[50px] w-full rounded-[2px] border border-[#6D6D6F] pl-[14px] text-[16px] font-bold placeholder:text-[16px] placeholder:font-bold placeholder:text-[#6D6D6F] focus:outline-none focus:ring-0 md:rounded-[4px] md:placeholder:text-[14px]',\n !rounded && 'rounded-none'\n )}\n value={orderName}\n onChange={e => setOrderName(e.target.value)}\n />\n <Text size=\"1\" as=\"p\" className=\"mt-[8px] text-[#6D6D6F]\">\n {copy.note}\n </Text>\n <Button variant=\"primary\" className=\"mt-[24px] w-full\" loading={isMutating} onClick={handleSubmit}>\n {copy.submit}\n </Button>\n {resultPopup && (\n <CreditsModalContainer\n isOpen={resultPopup}\n onClose={handleResultClose}\n className=\"w-[540px] md:h-auto\"\n scrollClassName=\"mb-[40px] min-l:px-[48px] md:mb-0 md:pb-[24px] md:px-[16px] flex flex-col items-center text-center\"\n titleClassName=\"h-[56px]\"\n >\n <Text size=\"3\" className=\"size-[64px]\" as=\"div\" html={resultPopupContent.icon} />\n <Heading size=\"3\" className=\"mt-[16px]\">\n {resultPopupContent.title}\n </Heading>\n <Text size=\"3\" className=\"mt-[8px] md:mt-[4px]\">\n {resultPopupContent.description}\n </Text>\n <Button variant=\"primary\" className=\"mt-[24px]\" onClick={handleResultClose}>\n {copy.gotIt}\n </Button>\n </CreditsModalContainer>\n )}\n </CreditsModalContainer>\n )\n}\n"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,EAAK,EACpBF,EAAa,EAAE,EAEXG,EAAmB,WACrBT,EAAQ,CAEZ,EAEA,SACE,QAAC,yBACC,OAAQD,EACR,QAASC,EACT,UAAU,sBACV,gBAAgB,8DAChB,eAAe,WACf,aAAY,GACZ,mBAAmB,yBAEnB,oBAAC,WAAQ,KAAK,IAAK,SAAAC,EAAK,MAAM,KAC9B,OAAC,QAAK,KAAK,IAAI,UAAU,uBACtB,SAAAA,EAAK,YACR,KACA,OAAC,SACC,YAAaA,EAAK,YAClB,aAAW,EAAAiB,SACT,uPACA,CAACN,GAAW,cACd,EACA,MAAOP,EACP,SAAUc,GAAKb,EAAaa,EAAE,OAAO,KAAK,EAC5C,KACA,OAAC,QAAK,KAAK,IAAI,GAAG,IAAI,UAAU,0BAC7B,SAAAlB,EAAK,KACR,KACA,OAAC,UAAO,QAAQ,UAAU,UAAU,mBAAmB,QAASG,EAAY,QAASS,EAClF,SAAAZ,EAAK,OACR,EACCM,MACC,QAAC,yBACC,OAAQA,EACR,QAASU,EACT,UAAU,sBACV,gBAAgB,qGAChB,eAAe,WAEf,oBAAC,QAAK,KAAK,IAAI,UAAU,cAAc,GAAG,MAAM,KAAMR,EAAmB,KAAM,KAC/E,OAAC,WAAQ,KAAK,IAAI,UAAU,YACzB,SAAAA,EAAmB,MACtB,KACA,OAAC,QAAK,KAAK,IAAI,UAAU,uBACtB,SAAAA,EAAmB,YACtB,KACA,OAAC,UAAO,QAAQ,UAAU,UAAU,YAAY,QAASQ,EACtD,SAAAhB,EAAK,MACR,GACF,GAEJ,CAEJ",
|
|
6
|
-
"names": ["
|
|
6
|
+
"names": ["CreditsUploadReceiptModal_exports", "__export", "CreditsUploadReceiptModal", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_react", "import_ModalContainer", "import_useUploadReceipt", "import_lib", "import_classnames", "import_constants", "isOpen", "onClose", "copy", "onSuccess", "trigger", "isMutating", "orderName", "setOrderName", "resultPopup", "setResultPopup", "resultPopupContent", "setResultPopupContent", "brand", "rounded", "handleSubmit", "result", "error", "reason", "handleResultClose", "classNames", "e"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";var r=Object.create;var l=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var p=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty;var f=(a,n)=>{for(var e in n)l(a,e,{get:n[e],enumerable:!0})},o=(a,n,e,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of c(n))!u.call(a,t)&&t!==e&&l(a,t,{get:()=>n[t],enumerable:!(i=d(n,t))||i.enumerable});return a};var g=(a,n,e)=>(e=a!=null?r(p(a)):{},o(n||!a||!a.__esModule?l(e,"default",{value:a,enumerable:!0}):e,a)),N=a=>o(l({},"__esModule",{value:!0}),a);var x={};f(x,{default:()=>k});module.exports=N(x);var s=require("react/jsx-runtime"),m=g(require("classnames"));const b=a=>{const{className:n}=a;return(0,s.jsxs)("span",{className:(0,m.default)("inline-flex min-h-[19px] items-center text-center leading-7",n),children:[(0,s.jsx)("span",{className:"animate-blink mx-0.5 h-2 w-2 rounded-full bg-current"},"dot_1"),(0,s.jsx)("span",{className:"animate-blink mx-0.5 h-2 w-2 rounded-full bg-current [animation-delay:0.2s]"},"dot_2"),(0,s.jsx)("span",{className:"animate-blink mx-0.5 h-2 w-2 rounded-full bg-current [animation-delay:0.4s]"},"dot_3")]})};var k=b;
|
|
2
|
-
//# sourceMappingURL=
|
|
2
|
+
//# sourceMappingURL=LoadingDots.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/components/credits/modal/
|
|
3
|
+
"sources": ["../../../../../src/components/credits/modal/LoadingDots.tsx"],
|
|
4
4
|
"sourcesContent": ["import classNames from 'classnames'\nimport { FC } from 'react'\n\ninterface LoadingProps {\n className?: string\n}\n\nconst LoadingDots: FC<LoadingProps> = props => {\n const { className } = props\n return (\n <span className={classNames('inline-flex min-h-[19px] items-center text-center leading-7', className)}>\n <span className=\"animate-blink mx-0.5 h-2 w-2 rounded-full bg-current\" key={`dot_1`} />\n <span className=\"animate-blink mx-0.5 h-2 w-2 rounded-full bg-current [animation-delay:0.2s]\" key={`dot_2`} />\n <span className=\"animate-blink mx-0.5 h-2 w-2 rounded-full bg-current [animation-delay:0.4s]\" key={`dot_3`} />\n </span>\n )\n}\n\nexport default LoadingDots\n"],
|
|
5
5
|
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAUI,IAAAI,EAAA,6BAVJC,EAAuB,yBAOvB,MAAMC,EAAgCC,GAAS,CAC7C,KAAM,CAAE,UAAAC,CAAU,EAAID,EACtB,SACE,QAAC,QAAK,aAAW,EAAAE,SAAW,8DAA+DD,CAAS,EAClG,oBAAC,QAAK,UAAU,wDAA4D,OAAS,KACrF,OAAC,QAAK,UAAU,+EAAmF,OAAS,KAC5G,OAAC,QAAK,UAAU,+EAAmF,OAAS,GAC9G,CAEJ,EAEA,IAAON,EAAQI",
|
|
6
|
-
"names": ["
|
|
6
|
+
"names": ["LoadingDots_exports", "__export", "LoadingDots_default", "__toCommonJS", "import_jsx_runtime", "import_classnames", "LoadingDots", "props", "className", "classNames"]
|
|
7
7
|
}
|