@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
|
@@ -1,91 +1,116 @@
|
|
|
1
|
-
import { classNames,
|
|
1
|
+
import { classNames, HeadlessProvider } from '@anker-in/lib'
|
|
2
2
|
import { RegistrationProvider } from '../components/registration/context/provider'
|
|
3
|
+
import { CreditsProvider, useCreditsContext } from '../components/credits/context/provider'
|
|
4
|
+
import { CreditsBanner } from '../components/credits/creditsBanner'
|
|
5
|
+
import { CreditsInfoCard } from '../components/credits/creditsInfoCard'
|
|
6
|
+
import { CreditsBenefits } from '../components/credits/creditsBenefits'
|
|
7
|
+
import { CreditsWaysToGetCredits } from '../components/credits/creditsWaysToGetCredits'
|
|
8
|
+
import { CreditsAnkersolixTask } from '../components/credits/creditsAnkersolixTask'
|
|
9
|
+
import { CreditsRedeemList } from '../components/credits/creditsRedeemList'
|
|
10
|
+
import { CreditsGoGift } from '../components/credits/creditsGoGift'
|
|
11
|
+
import { CreditsCash } from '../components/credits/creditsCash'
|
|
12
|
+
import { CreditsMemberPrice } from '../components/credits/creditsMemberPrice'
|
|
13
|
+
import { CreditsFaq } from '../components/credits/creditsFaq'
|
|
14
|
+
import { CreditsNavigation } from '../components/credits/creditsNavigation'
|
|
15
|
+
import ActivitiesModal from '../components/credits/modal/ActivitiesModal'
|
|
16
|
+
import RewardsModal from '../components/credits/modal/RewardsModal'
|
|
17
|
+
import { ComponentKey } from './Credits.types'
|
|
18
|
+
import type {
|
|
19
|
+
CreditsTemplateProps,
|
|
20
|
+
CreditsContentProps,
|
|
21
|
+
CreditsBannerCopy,
|
|
22
|
+
CreditsInfoCardCopy,
|
|
23
|
+
CreditsBenefitsCopy,
|
|
24
|
+
CreditsWaysToGetCreditsCopy,
|
|
25
|
+
CreditsAnkersolixTaskCopy,
|
|
26
|
+
CreditsRedeemListCopy,
|
|
27
|
+
CreditsGoGiftCopy,
|
|
28
|
+
CreditsCashCopy,
|
|
29
|
+
CreditsMemberPriceCopy,
|
|
30
|
+
CreditsFaqCopy,
|
|
31
|
+
} from './Credits.types'
|
|
3
32
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { CreditsPageCommon } from '../components/credits/type'
|
|
7
|
-
import { FunctionMemberPriceConfig } from '../components/credits/context/memberPriceTypes'
|
|
33
|
+
const CreditsContent = ({ headlessConfig, pageConfig, userContext }: CreditsContentProps) => {
|
|
34
|
+
const { openMyRewardsModal, setOpenMyRewardsModal, openActivitiesModal, setOpenActivitiesModal, pageCommon } = useCreditsContext()
|
|
8
35
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
36
|
+
return (
|
|
37
|
+
<>
|
|
38
|
+
{/* 导航组件 - 固定位置,不参与 order 排序 */}
|
|
39
|
+
{pageConfig.components[ComponentKey.Navigation] && (
|
|
40
|
+
<CreditsNavigation copy={pageConfig.components[ComponentKey.Navigation]} />
|
|
41
|
+
)}
|
|
42
|
+
<div className={classNames('bg-[#f5f5f7] leading-[1.2]')}>
|
|
43
|
+
{pageConfig.order.map(key => {
|
|
44
|
+
// 跳过导航组件,因为它已经固定渲染在上方
|
|
45
|
+
if (key === ComponentKey.Navigation) return null
|
|
46
|
+
const componentCopy = pageConfig.components?.[key]
|
|
47
|
+
if (!componentCopy) return null
|
|
48
|
+
return (
|
|
49
|
+
<>
|
|
50
|
+
{key === ComponentKey.Banner && <CreditsBanner copy={componentCopy as CreditsBannerCopy} id={key} />}
|
|
51
|
+
{key === ComponentKey.InfoCard && userContext?.profile && (
|
|
52
|
+
<CreditsInfoCard copy={componentCopy as CreditsInfoCardCopy} id={key} />
|
|
53
|
+
)}
|
|
54
|
+
{key === ComponentKey.Benefits && (
|
|
55
|
+
<CreditsBenefits copy={componentCopy as CreditsBenefitsCopy} id={key} />
|
|
56
|
+
)}
|
|
57
|
+
{key === ComponentKey.WaysToGetCredits && (
|
|
58
|
+
<CreditsWaysToGetCredits
|
|
59
|
+
copy={componentCopy as CreditsWaysToGetCreditsCopy}
|
|
60
|
+
id={key}
|
|
61
|
+
classNames={
|
|
62
|
+
headlessConfig.brand === 'anker'
|
|
63
|
+
? {
|
|
64
|
+
subtitle: 'text-white',
|
|
65
|
+
equalCreditsText:
|
|
66
|
+
'bg-gradient-to-r from-[#3AD1FF] to-[#008CD6] bg-clip-text text-transparent',
|
|
67
|
+
}
|
|
68
|
+
: {
|
|
69
|
+
subtitle: 'text-[#D1D1D1]',
|
|
70
|
+
equalCreditsText: 'text-[#F6EAD0]',
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/>
|
|
74
|
+
)}
|
|
75
|
+
{key === ComponentKey.AnkersolixTask && (
|
|
76
|
+
<CreditsAnkersolixTask copy={componentCopy as CreditsAnkersolixTaskCopy} id={key} />
|
|
77
|
+
)}
|
|
78
|
+
{key === ComponentKey.RedeemList && (
|
|
79
|
+
<CreditsRedeemList copy={componentCopy as CreditsRedeemListCopy} id={key} />
|
|
80
|
+
)}
|
|
81
|
+
{key === ComponentKey.GoGift && <CreditsGoGift copy={componentCopy as CreditsGoGiftCopy} id={key} />}
|
|
82
|
+
{key === ComponentKey.SpendCreditsLikeCash && (
|
|
83
|
+
<CreditsCash copy={componentCopy as CreditsCashCopy} id={key} />
|
|
84
|
+
)}
|
|
85
|
+
{key === ComponentKey.MemberPrice && (
|
|
86
|
+
<CreditsMemberPrice copy={componentCopy as CreditsMemberPriceCopy} id={key} />
|
|
87
|
+
)}
|
|
88
|
+
{key === ComponentKey.Faqs && <CreditsFaq copy={componentCopy as CreditsFaqCopy} id={key} />}
|
|
89
|
+
{key !== ComponentKey.Banner && (
|
|
90
|
+
<div className="laptop:h-16 desktop:h-[96px] lg-desktop:h-[128px] tablet:h-16 h-16" />
|
|
91
|
+
)}
|
|
92
|
+
</>
|
|
93
|
+
)
|
|
94
|
+
})}
|
|
95
|
+
</div>
|
|
20
96
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>
|
|
40
|
-
memberPriceDiscount?: FunctionMemberPriceConfig[]
|
|
41
|
-
}
|
|
42
|
-
creditsConfig?: {
|
|
43
|
-
alpcBrand?: string
|
|
44
|
-
}
|
|
45
|
-
pageConfig: {
|
|
46
|
-
order: ComponentKey[]
|
|
47
|
-
common: CreditsPageCommon
|
|
48
|
-
components: {
|
|
49
|
-
[ComponentKey.Navigation]?: CreditsNavigationCopy
|
|
50
|
-
[ComponentKey.Banner]?: CreditsBannerCopy
|
|
51
|
-
[ComponentKey.InfoCard]?: CreditsInfoCardCopy
|
|
52
|
-
[ComponentKey.Benefits]?: CreditsBenefitsCopy
|
|
53
|
-
[ComponentKey.WaysToGetCredits]?: CreditsWaysToGetCreditsCopy
|
|
54
|
-
[ComponentKey.AnkersolixTask]?: CreditsAnkersolixTaskCopy
|
|
55
|
-
[ComponentKey.RedeemList]?: CreditsRedeemListCopy
|
|
56
|
-
[ComponentKey.SpendCreditsLikeCash]?: CreditsCashCopy
|
|
57
|
-
[ComponentKey.MemberPrice]?: CreditsMemberPriceCopy
|
|
58
|
-
[ComponentKey.Faqs]?: CreditsFaqCopy
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
userContext: {
|
|
62
|
-
profile: any
|
|
63
|
-
removeProfile: () => void
|
|
64
|
-
isLoadingProfile: boolean
|
|
65
|
-
creditInfo: any
|
|
66
|
-
customer: any
|
|
67
|
-
customerLoading: boolean
|
|
68
|
-
fetchCreditInfo: () => void
|
|
69
|
-
}
|
|
70
|
-
registrationContext: {
|
|
71
|
-
openSignUpPopup: () => void
|
|
72
|
-
openSignInPopup: () => void
|
|
73
|
-
}
|
|
74
|
-
gtm: {
|
|
75
|
-
pageGroup: string
|
|
76
|
-
pageHandle?: string
|
|
77
|
-
}
|
|
78
|
-
cartConfig?: {
|
|
79
|
-
addToCart: (params: {
|
|
80
|
-
variantList: Array<{
|
|
81
|
-
variant: any
|
|
82
|
-
quantity: number
|
|
83
|
-
attributes?: Array<{ key: string; value: string }>
|
|
84
|
-
}>
|
|
85
|
-
cartAttributes?: Record<string, string>
|
|
86
|
-
discountCodes?: string[]
|
|
87
|
-
}) => void | Promise<any>
|
|
88
|
-
}
|
|
97
|
+
{/* Global Modals */}
|
|
98
|
+
{pageCommon?.activitiesModal && (
|
|
99
|
+
<ActivitiesModal
|
|
100
|
+
isOpen={openActivitiesModal}
|
|
101
|
+
data={pageCommon.activitiesModal}
|
|
102
|
+
onClose={() => setOpenActivitiesModal(false)}
|
|
103
|
+
/>
|
|
104
|
+
)}
|
|
105
|
+
{pageCommon?.rewardsModal && (
|
|
106
|
+
<RewardsModal
|
|
107
|
+
isOpen={openMyRewardsModal}
|
|
108
|
+
data={pageCommon.rewardsModal}
|
|
109
|
+
onClose={() => setOpenMyRewardsModal(false)}
|
|
110
|
+
/>
|
|
111
|
+
)}
|
|
112
|
+
</>
|
|
113
|
+
)
|
|
89
114
|
}
|
|
90
115
|
|
|
91
116
|
export const CreditsTemplate = ({
|
|
@@ -98,7 +123,6 @@ export const CreditsTemplate = ({
|
|
|
98
123
|
gtm,
|
|
99
124
|
cartConfig,
|
|
100
125
|
}: CreditsTemplateProps) => {
|
|
101
|
-
console.log('siteConfig', siteConfig)
|
|
102
126
|
return (
|
|
103
127
|
<HeadlessProvider headlessConfig={headlessConfig}>
|
|
104
128
|
<RegistrationProvider copy={siteConfig.registrationsSettings} email={userContext?.profile?.email}>
|
|
@@ -119,63 +143,7 @@ export const CreditsTemplate = ({
|
|
|
119
143
|
alpcBrand={creditsConfig?.alpcBrand}
|
|
120
144
|
cartConfig={cartConfig}
|
|
121
145
|
>
|
|
122
|
-
{
|
|
123
|
-
{pageConfig.components[ComponentKey.Navigation] && (
|
|
124
|
-
<CreditsNavigation copy={pageConfig.components[ComponentKey.Navigation]} />
|
|
125
|
-
)}
|
|
126
|
-
<div className={classNames('bg-[#f5f5f7] leading-[1.2]')}>
|
|
127
|
-
{pageConfig.order.map(key => {
|
|
128
|
-
// 跳过导航组件,因为它已经固定渲染在上方
|
|
129
|
-
if (key === ComponentKey.Navigation) return null
|
|
130
|
-
const componentCopy = pageConfig.components?.[key]
|
|
131
|
-
if (!componentCopy) return null
|
|
132
|
-
return (
|
|
133
|
-
<>
|
|
134
|
-
{key === ComponentKey.Banner && <CreditsBanner copy={componentCopy as CreditsBannerCopy} id={key} />}
|
|
135
|
-
{key === ComponentKey.InfoCard && userContext?.profile && (
|
|
136
|
-
<CreditsInfoCard copy={componentCopy as CreditsInfoCardCopy} id={key} />
|
|
137
|
-
)}
|
|
138
|
-
{key === ComponentKey.Benefits && (
|
|
139
|
-
<CreditsBenefits copy={componentCopy as CreditsBenefitsCopy} id={key} />
|
|
140
|
-
)}
|
|
141
|
-
{key === ComponentKey.WaysToGetCredits && (
|
|
142
|
-
<CreditsWaysToGetCredits
|
|
143
|
-
copy={componentCopy as CreditsWaysToGetCreditsCopy}
|
|
144
|
-
id={key}
|
|
145
|
-
classNames={
|
|
146
|
-
headlessConfig.brand === 'anker'
|
|
147
|
-
? {
|
|
148
|
-
subtitle: 'text-white',
|
|
149
|
-
equalCreditsText:
|
|
150
|
-
'bg-gradient-to-r from-[#3AD1FF] to-[#008CD6] bg-clip-text text-transparent',
|
|
151
|
-
}
|
|
152
|
-
: {
|
|
153
|
-
subtitle: 'text-[#D1D1D1]',
|
|
154
|
-
equalCreditsText: 'text-[#F6EAD0]',
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
/>
|
|
158
|
-
)}
|
|
159
|
-
{key === ComponentKey.AnkersolixTask && (
|
|
160
|
-
<CreditsAnkersolixTask copy={componentCopy as CreditsAnkersolixTaskCopy} id={key} />
|
|
161
|
-
)}
|
|
162
|
-
{key === ComponentKey.RedeemList && (
|
|
163
|
-
<CreditsRedeemList copy={componentCopy as CreditsRedeemListCopy} id={key} />
|
|
164
|
-
)}
|
|
165
|
-
{key === ComponentKey.SpendCreditsLikeCash && (
|
|
166
|
-
<CreditsCash copy={componentCopy as CreditsCashCopy} id={key} />
|
|
167
|
-
)}
|
|
168
|
-
{key === ComponentKey.MemberPrice && (
|
|
169
|
-
<CreditsMemberPrice copy={componentCopy as CreditsMemberPriceCopy} id={key} />
|
|
170
|
-
)}
|
|
171
|
-
{key === ComponentKey.Faqs && <CreditsFaq copy={componentCopy as CreditsFaqCopy} id={key} />}
|
|
172
|
-
{key !== ComponentKey.Banner && (
|
|
173
|
-
<div className="laptop:h-16 desktop:h-[96px] lg-desktop:h-[128px] tablet:h-16 h-16" />
|
|
174
|
-
)}
|
|
175
|
-
</>
|
|
176
|
-
)
|
|
177
|
-
})}
|
|
178
|
-
</div>
|
|
146
|
+
<CreditsContent headlessConfig={headlessConfig} pageConfig={pageConfig} userContext={userContext} />
|
|
179
147
|
</CreditsProvider>
|
|
180
148
|
</RegistrationProvider>
|
|
181
149
|
</HeadlessProvider>
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { HeadlessConfig } from '@anker-in/lib'
|
|
2
|
+
import { DTC_TASK_TYPE } from '../components/credits/context/const'
|
|
3
|
+
import { CreditsPageCommon } from '../components/credits/type'
|
|
4
|
+
import { FunctionMemberPriceConfig } from '../components/credits/context/memberPriceTypes'
|
|
5
|
+
import { AuthCodeActivateCopy } from 'src/components/registration/authCodeActivate/type'
|
|
6
|
+
import type { CreditsBannerCopy } from '../components/credits/creditsBanner'
|
|
7
|
+
import type { CreditsInfoCardCopy } from '../components/credits/creditsInfoCard'
|
|
8
|
+
import type { CreditsBenefitsCopy } from '../components/credits/creditsBenefits'
|
|
9
|
+
import type { CreditsWaysToGetCreditsCopy } from '../components/credits/creditsWaysToGetCredits'
|
|
10
|
+
import type { CreditsAnkersolixTaskCopy } from '../components/credits/creditsAnkersolixTask'
|
|
11
|
+
import type { CreditsRedeemListCopy } from '../components/credits/creditsRedeemList'
|
|
12
|
+
import type { CreditsGoGiftCopy } from '../components/credits/creditsGoGift'
|
|
13
|
+
import type { CreditsCashCopy } from '../components/credits/creditsCash'
|
|
14
|
+
import type { CreditsMemberPriceCopy } from '../components/credits/creditsMemberPrice'
|
|
15
|
+
import type { CreditsFaqCopy } from '../components/credits/creditsFaq'
|
|
16
|
+
import type { CreditsNavigationCopy } from '../components/credits/creditsNavigation'
|
|
17
|
+
|
|
18
|
+
// Re-export copy types for convenience
|
|
19
|
+
export type {
|
|
20
|
+
CreditsBannerCopy,
|
|
21
|
+
CreditsInfoCardCopy,
|
|
22
|
+
CreditsBenefitsCopy,
|
|
23
|
+
CreditsWaysToGetCreditsCopy,
|
|
24
|
+
CreditsAnkersolixTaskCopy,
|
|
25
|
+
CreditsRedeemListCopy,
|
|
26
|
+
CreditsGoGiftCopy,
|
|
27
|
+
CreditsCashCopy,
|
|
28
|
+
CreditsMemberPriceCopy,
|
|
29
|
+
CreditsFaqCopy,
|
|
30
|
+
CreditsNavigationCopy,
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export enum ComponentKey {
|
|
34
|
+
Navigation = 'creditsNavigation',
|
|
35
|
+
Banner = 'creditsBanner',
|
|
36
|
+
InfoCard = 'creditsInfoCard',
|
|
37
|
+
Benefits = 'creditsBenefits',
|
|
38
|
+
WaysToGetCredits = 'creditsWaysToGetCredits',
|
|
39
|
+
AnkersolixTask = 'creditsAnkersolixTask',
|
|
40
|
+
RedeemList = 'creditsRedeemList',
|
|
41
|
+
GoGift = 'creditsGoGift',
|
|
42
|
+
SpendCreditsLikeCash = 'creditsCash',
|
|
43
|
+
MemberPrice = 'creditsMemberPrice',
|
|
44
|
+
Faqs = 'creditsFaq',
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export type CreditsTemplateProps = {
|
|
48
|
+
headlessConfig: HeadlessConfig
|
|
49
|
+
siteConfig: {
|
|
50
|
+
registrationsSettings: {
|
|
51
|
+
authCodeActivate: AuthCodeActivateCopy
|
|
52
|
+
}
|
|
53
|
+
taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>
|
|
54
|
+
memberPriceDiscount?: FunctionMemberPriceConfig[]
|
|
55
|
+
}
|
|
56
|
+
creditsConfig?: {
|
|
57
|
+
alpcBrand?: string
|
|
58
|
+
}
|
|
59
|
+
pageConfig: {
|
|
60
|
+
order: ComponentKey[]
|
|
61
|
+
common: CreditsPageCommon
|
|
62
|
+
components: {
|
|
63
|
+
[ComponentKey.Navigation]?: CreditsNavigationCopy
|
|
64
|
+
[ComponentKey.Banner]?: CreditsBannerCopy
|
|
65
|
+
[ComponentKey.InfoCard]?: CreditsInfoCardCopy
|
|
66
|
+
[ComponentKey.Benefits]?: CreditsBenefitsCopy
|
|
67
|
+
[ComponentKey.WaysToGetCredits]?: CreditsWaysToGetCreditsCopy
|
|
68
|
+
[ComponentKey.AnkersolixTask]?: CreditsAnkersolixTaskCopy
|
|
69
|
+
[ComponentKey.RedeemList]?: CreditsRedeemListCopy
|
|
70
|
+
[ComponentKey.GoGift]?: CreditsGoGiftCopy
|
|
71
|
+
[ComponentKey.SpendCreditsLikeCash]?: CreditsCashCopy
|
|
72
|
+
[ComponentKey.MemberPrice]?: CreditsMemberPriceCopy
|
|
73
|
+
[ComponentKey.Faqs]?: CreditsFaqCopy
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
userContext: {
|
|
77
|
+
profile: any
|
|
78
|
+
removeProfile: () => void
|
|
79
|
+
isLoadingProfile: boolean
|
|
80
|
+
creditInfo: any
|
|
81
|
+
customer: any
|
|
82
|
+
customerLoading: boolean
|
|
83
|
+
fetchCreditInfo: () => void
|
|
84
|
+
}
|
|
85
|
+
registrationContext: {
|
|
86
|
+
openSignUpPopup: () => void
|
|
87
|
+
openSignInPopup: () => void
|
|
88
|
+
}
|
|
89
|
+
gtm: {
|
|
90
|
+
pageGroup: string
|
|
91
|
+
pageHandle?: string
|
|
92
|
+
}
|
|
93
|
+
cartConfig?: {
|
|
94
|
+
addToCart: (params: {
|
|
95
|
+
variantList: Array<{
|
|
96
|
+
variant: any
|
|
97
|
+
quantity: number
|
|
98
|
+
attributes?: Array<{ key: string; value: string }>
|
|
99
|
+
}>
|
|
100
|
+
cartAttributes?: Record<string, string>
|
|
101
|
+
discountCodes?: string[]
|
|
102
|
+
}) => void | Promise<any>
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export type CreditsContentProps = {
|
|
107
|
+
headlessConfig: HeadlessConfig
|
|
108
|
+
pageConfig: CreditsTemplateProps['pageConfig']
|
|
109
|
+
userContext: CreditsTemplateProps['userContext']
|
|
110
|
+
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { type ModalContainerProps } from './modalContainer';
|
|
2
|
-
export interface MyRewardsMetafields {
|
|
3
|
-
title: string;
|
|
4
|
-
orderNumberLabel: string;
|
|
5
|
-
valueLabel: string;
|
|
6
|
-
receivedLabel: string;
|
|
7
|
-
failedLabel: string;
|
|
8
|
-
approveSuccessLabel: string;
|
|
9
|
-
couponTab: string;
|
|
10
|
-
productTab: string;
|
|
11
|
-
pendingLabel: string;
|
|
12
|
-
unfulfilledLabel: string;
|
|
13
|
-
fulfilledLabel: string;
|
|
14
|
-
confirmedTip: string;
|
|
15
|
-
pendingTip: string;
|
|
16
|
-
processingTip: string;
|
|
17
|
-
ShippedTip: string;
|
|
18
|
-
emptyListLabel: string;
|
|
19
|
-
pointUnit: string;
|
|
20
|
-
code: string;
|
|
21
|
-
copied: string;
|
|
22
|
-
copy: string;
|
|
23
|
-
emptyListImage: {
|
|
24
|
-
url: string;
|
|
25
|
-
alt?: string;
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
interface MyRewardsModalProps extends ModalContainerProps {
|
|
29
|
-
data: MyRewardsMetafields;
|
|
30
|
-
}
|
|
31
|
-
declare function MyRewardsModal({ data, ...props }: MyRewardsModalProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
-
export default MyRewardsModal;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var G=Object.create;var m=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var W=Object.getPrototypeOf,X=Object.prototype.hasOwnProperty;var Z=(o,n)=>{for(var s in n)m(o,s,{get:n[s],enumerable:!0})},S=(o,n,s,u)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of Q(n))!X.call(o,a)&&a!==s&&m(o,a,{get:()=>n[a],enumerable:!(u=J(n,a))||u.enumerable});return o};var d=(o,n,s)=>(s=o!=null?G(W(o)):{},S(n||!o||!o.__esModule?m(s,"default",{value:o,enumerable:!0}):s,o)),ee=o=>S(m({},"__esModule",{value:!0}),o);var ie={};Z(ie,{default:()=>te});module.exports=ee(ie);var i=require("react/jsx-runtime"),p=require("@anker-in/headless-ui"),g=d(require("classnames")),F=d(require("copy-to-clipboard")),_=d(require("dayjs")),r=require("react"),e=require("../context/const"),h=require("./modalContainer"),D=d(require("./tip")),A=d(require("./loadingDots")),v=d(require("../context/hooks/useMyRewards")),O=require("@anker-in/lib"),I=require("../../../constants");function oe({data:o,...n}){const[s,u]=(0,r.useState)(e.AlpcConsumeType.Coupon),{brand:a}=(0,O.useHeadlessContext)(),x=I.ROUNDED_BRANDS.includes(a),[c,U]=(0,r.useState)(1),[f,k]=(0,r.useState)(1),[E,y]=(0,r.useState)(-1),Y=(0,r.useMemo)(()=>{const t=[];return o.couponTab&&t.push({title:o.couponTab,type:e.AlpcConsumeType.Coupon}),o.productTab&&t.push({title:o.productTab,type:e.AlpcConsumeType.Product}),t},[o.couponTab,o.productTab]),j=(0,r.useMemo)(()=>({page:n.isOpen?f:0,pageSize:1e3,consumeType:e.AlpcConsumeType.Product}),[n.isOpen,f]),H=(0,r.useMemo)(()=>({page:n.isOpen?c:0,pageSize:1e3,consumeType:e.AlpcConsumeType.Coupon}),[n.isOpen,c]),{myRewards:C=[],canNext:N,isLoading:$}=(0,v.default)(H),{myRewards:T=[],canNext:L,isLoading:z}=(0,v.default)(j),P=(0,r.useMemo)(()=>s===e.AlpcConsumeType.Coupon?C.map(t=>({title:t.goods_title,value:t.consume_credits,type:e.RewardType.Received,date:new Date(t.create_time*1e3),couponCode:t.coupon_code,orderNumber:""})):s===e.AlpcConsumeType.Product?T.map(t=>{let l=e.RewardType.Pending;return t.fulfillment_status&&t.fulfillment_status!=="null"?t.fulfillment_status==="fulfilled"?l=e.RewardType.Fulfilled:l=e.RewardType.Unfulfilled:t.approval_status===e.ApprovalStatus.Success||t.approval_status===e.ApprovalStatus.DoubleConfirm?l=e.RewardType.ApproveSuccess:t.approval_status===e.ApprovalStatus.Failed&&(l=e.RewardType.Failed),{title:t.goods_title,value:t.consume_credits,type:l,date:new Date(t.create_time*1e3),orderNumber:t.order_number,couponCode:""}}):[],[s,T,C]),M=(0,r.useMemo)(()=>s===e.AlpcConsumeType.Coupon?N:s===e.AlpcConsumeType.Product?L:!1,[s,N,L]),q=(0,r.useMemo)(()=>({[e.RewardType.Received]:o.receivedLabel,[e.RewardType.Pending]:o.pendingLabel,[e.RewardType.ApproveFail]:o.failedLabel,[e.RewardType.ApproveSuccess]:o.approveSuccessLabel,[e.RewardType.Unfulfilled]:o.unfulfilledLabel,[e.RewardType.Fulfilled]:o.fulfilledLabel,[e.RewardType.Failed]:o.failedLabel}),[o]),w=(0,r.useMemo)(()=>({[e.RewardType.Received]:"",[e.RewardType.Pending]:o.pendingTip,[e.RewardType.ApproveFail]:"",[e.RewardType.ApproveSuccess]:o.confirmedTip,[e.RewardType.Unfulfilled]:o.processingTip,[e.RewardType.Fulfilled]:o.ShippedTip,[e.RewardType.Failed]:""}),[o]),B=(0,r.useMemo)(()=>({[e.RewardType.Received]:"#52C41A",[e.RewardType.Pending]:"#999",[e.RewardType.ApproveFail]:"#F84D4F",[e.RewardType.ApproveSuccess]:"#999",[e.RewardType.Unfulfilled]:"#999",[e.RewardType.Fulfilled]:"#999",[e.RewardType.Failed]:"#F84D4F"}),[]),K=(0,r.useCallback)(()=>{M&&(s===e.AlpcConsumeType.Coupon?U(c+1):s===e.AlpcConsumeType.Product&&k(f+1))},[s,f,c,M]),V=(0,r.useCallback)((t,l)=>{y(l),(0,F.default)(t),setTimeout(()=>{y(-1)},2e3)},[]),R=s===e.AlpcConsumeType.Coupon?$:z;return(0,i.jsxs)(h.CreditsModalContainer,{title:o.title,className:(0,g.default)("h-[800px] w-[640px]"),useAnimation:!0,animationClassName:"md:translate-y-[100vh]",scrollClassName:"md:mb-0",...n,onScrollEnd:K,children:[(0,i.jsx)("div",{className:"",children:(0,i.jsx)(p.Tabs,{align:"left",shape:x?"rounded":"square",value:s.toString(),onValueChange:t=>{u(Number(t))},children:(0,i.jsx)(p.TabsList,{children:Y.map(t=>(0,i.jsx)(p.TabsTrigger,{value:t.type.toString(),children:t.title},t.type))})})}),R&&(0,i.jsx)("div",{className:"flex h-full flex-col items-center justify-center",children:(0,i.jsx)(A.default,{})}),!R&&(0,i.jsx)("div",{className:"mt-[24px] overflow-auto overscroll-contain",children:P.length>0?(0,i.jsx)("div",{className:"grid gap-[18px] md:gap-[12px]",children:P.map((t,l)=>(0,i.jsxs)("div",{className:"grid gap-[8px]",children:[t?.orderNumber&&(0,i.jsxs)("div",{className:"text-[15px] font-semibold leading-[1.4] text-[#777]",children:[o.orderNumberLabel,": ",t.orderNumber]}),(0,i.jsxs)("div",{className:(0,g.default)("flex items-center justify-between rounded-[8px] bg-[#f7f8f9] px-[16px] py-[20px]",!x&&"rounded-none"),children:[(0,i.jsxs)("div",{className:"grid gap-[4px]",children:[(0,i.jsx)("div",{className:"text-[16px] font-bold leading-[1.4]",children:t.title}),(0,i.jsxs)("div",{className:"text-[14px] font-semibold text-[#999]",children:[o.valueLabel,": ",t.value," ",o?.pointUnit]}),(0,i.jsxs)("div",{className:"text-[14px] font-semibold text-[#999]",children:[t?.couponCode?`${o?.code||"Code"}: ${t.couponCode} `:"",t?.couponCode&&(0,i.jsx)("span",{className:"cursor-pointer text-[14px] font-semibold text-brand underline",onClick:()=>{V(t.couponCode,l)},role:"button",tabIndex:0,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&b.preventDefault()},children:E===l?o?.copied||"COPIED":o?.copy||"COPY"})]})]}),(0,i.jsxs)("div",{className:"grid gap-[4px] text-right",children:[(0,i.jsxs)("div",{className:(0,g.default)("flex items-center justify-end text-[16px] font-bold leading-[1.4]",`text-[${B[t.type]}]`),children:[(0,i.jsx)("span",{children:q[t.type]}),w[t.type]&&(0,i.jsx)(D.default,{info:w[t.type],index:l})]}),(0,i.jsx)("div",{className:"text-[14px] font-semibold text-[#999]",children:(0,_.default)(t.date).format("YYYY-MM-DD HH:mm").toString()})]})]})]},l))}):(0,i.jsxs)("div",{className:"flex h-full flex-col items-center justify-center",children:[(0,i.jsx)(p.Picture,{className:"mb-[12px] w-[160px]",source:o?.emptyListImage?.url,alt:o?.emptyListImage?.alt||"empty list image"}),(0,i.jsx)("div",{className:"text-[16px] font-semibold leading-[1.4]",children:o?.emptyListLabel})]})})]})}var te=oe;
|
|
2
|
-
//# sourceMappingURL=MyRewardsModal.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/components/credits/modal/MyRewardsModal.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Tabs, TabsList, TabsTrigger, Picture } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport clipboard from 'copy-to-clipboard'\nimport dayjs from 'dayjs'\nimport { useCallback, useMemo, useState } from 'react'\n\nimport { ApprovalStatus, AlpcConsumeType, RewardType } from '../context/const'\nimport { CreditsModalContainer, type ModalContainerProps } from './modalContainer'\nimport Tip from './tip'\nimport LoadingDots from './loadingDots'\nimport useMyRewards from '../context/hooks/useMyRewards'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport { ROUNDED_BRANDS } from '../../../constants'\n\nexport interface MyRewardsMetafields {\n title: string\n orderNumberLabel: string\n valueLabel: string\n receivedLabel: string\n failedLabel: string\n approveSuccessLabel: string\n couponTab: string\n productTab: string\n pendingLabel: string\n unfulfilledLabel: string\n fulfilledLabel: string\n confirmedTip: string\n pendingTip: string\n processingTip: string\n ShippedTip: string\n emptyListLabel: string\n pointUnit: string\n code: string\n copied: string\n copy: string\n emptyListImage: {\n url: string\n alt?: string\n }\n}\ninterface MyRewardsModalProps extends ModalContainerProps {\n data: MyRewardsMetafields\n}\n\nfunction MyRewardsModal({ data, ...props }: MyRewardsModalProps) {\n const [activeTab, setActiveTab] = useState(AlpcConsumeType.Coupon)\n const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n\n const [couponPage, setCouponPage] = useState(1)\n const [productPage, setProductPage] = useState(1)\n const [copied, setCopied] = useState(-1)\n\n const tabs = useMemo(() => {\n const availableTabs: { title: string; type: number }[] = []\n\n if (data.couponTab) {\n availableTabs.push({\n title: data.couponTab,\n type: AlpcConsumeType.Coupon,\n })\n }\n\n if (data.productTab) {\n availableTabs.push({\n title: data.productTab,\n type: AlpcConsumeType.Product,\n })\n }\n\n return availableTabs\n }, [data.couponTab, data.productTab])\n\n const myProductRewardsOptions = useMemo(() => {\n return {\n page: props.isOpen ? productPage : 0,\n pageSize: 1000,\n consumeType: AlpcConsumeType.Product,\n }\n }, [props.isOpen, productPage])\n const myCouponRewardsOptions = useMemo(() => {\n return {\n page: props.isOpen ? couponPage : 0,\n pageSize: 1000,\n consumeType: AlpcConsumeType.Coupon,\n }\n }, [props.isOpen, couponPage])\n\n const {\n myRewards: myCouponRewards = [],\n canNext: couponCanNext,\n isLoading: couponIsLoading,\n } = useMyRewards(myCouponRewardsOptions)\n const {\n myRewards: myProductRewards = [],\n canNext: productCanNext,\n isLoading: productIsLoading,\n } = useMyRewards(myProductRewardsOptions)\n\n const list = useMemo(() => {\n if (activeTab === AlpcConsumeType.Coupon) {\n return myCouponRewards.map(item => ({\n title: item.goods_title,\n value: item.consume_credits,\n type: RewardType.Received,\n date: new Date(item.create_time * 1000),\n couponCode: item.coupon_code,\n orderNumber: '',\n }))\n }\n\n if (activeTab === AlpcConsumeType.Product) {\n return myProductRewards.map(item => {\n let type = RewardType.Pending\n\n if (item.fulfillment_status && item.fulfillment_status !== 'null') {\n // \u7269\u6D41\u72B6\u6001\n if (item.fulfillment_status === 'fulfilled') {\n type = RewardType.Fulfilled\n } else {\n type = RewardType.Unfulfilled\n }\n } else {\n if (\n item.approval_status === ApprovalStatus.Success ||\n item.approval_status === ApprovalStatus.DoubleConfirm\n ) {\n type = RewardType.ApproveSuccess\n } else if (item.approval_status === ApprovalStatus.Failed) {\n type = RewardType.Failed\n }\n }\n\n return {\n title: item.goods_title,\n value: item.consume_credits,\n type,\n date: new Date(item.create_time * 1000),\n orderNumber: item.order_number,\n couponCode: '',\n }\n })\n }\n\n return []\n }, [activeTab, myProductRewards, myCouponRewards])\n\n const canNext = useMemo(() => {\n if (activeTab === AlpcConsumeType.Coupon) {\n return couponCanNext\n }\n\n if (activeTab === AlpcConsumeType.Product) {\n return productCanNext\n }\n\n return false\n }, [activeTab, couponCanNext, productCanNext])\n\n const TypeMap = useMemo(() => {\n return {\n [RewardType.Received]: data.receivedLabel,\n [RewardType.Pending]: data.pendingLabel,\n [RewardType.ApproveFail]: data.failedLabel,\n [RewardType.ApproveSuccess]: data.approveSuccessLabel,\n [RewardType.Unfulfilled]: data.unfulfilledLabel,\n [RewardType.Fulfilled]: data.fulfilledLabel,\n [RewardType.Failed]: data.failedLabel,\n }\n }, [data])\n\n const TipMap = useMemo(() => {\n return {\n [RewardType.Received]: '',\n [RewardType.Pending]: data.pendingTip,\n [RewardType.ApproveFail]: '',\n [RewardType.ApproveSuccess]: data.confirmedTip,\n [RewardType.Unfulfilled]: data.processingTip,\n [RewardType.Fulfilled]: data.ShippedTip,\n [RewardType.Failed]: '',\n }\n }, [data])\n\n const ColorMap = useMemo(() => {\n return {\n [RewardType.Received]: '#52C41A',\n [RewardType.Pending]: '#999',\n [RewardType.ApproveFail]: '#F84D4F',\n [RewardType.ApproveSuccess]: '#999',\n [RewardType.Unfulfilled]: '#999',\n [RewardType.Fulfilled]: '#999',\n [RewardType.Failed]: '#F84D4F',\n }\n }, [])\n\n const handleScrollEnd = useCallback(() => {\n if (!canNext) {\n return\n }\n\n if (activeTab === AlpcConsumeType.Coupon) {\n setCouponPage(couponPage + 1)\n } else if (activeTab === AlpcConsumeType.Product) {\n setProductPage(productPage + 1)\n }\n }, [activeTab, productPage, couponPage, canNext])\n\n const handleCopy = useCallback((code: string, idx: number) => {\n setCopied(idx)\n clipboard(code)\n setTimeout(() => {\n setCopied(-1)\n }, 2000)\n }, [])\n\n const isLoading = activeTab === AlpcConsumeType.Coupon ? couponIsLoading : productIsLoading\n\n return (\n <CreditsModalContainer\n title={data.title}\n className={classNames('h-[800px] w-[640px]')}\n useAnimation\n animationClassName=\"md:translate-y-[100vh]\"\n scrollClassName=\"md:mb-0\"\n {...props}\n onScrollEnd={handleScrollEnd}\n >\n <div className=\"\">\n <Tabs\n align=\"left\"\n shape={rounded ? 'rounded' : 'square'}\n value={activeTab.toString()}\n onValueChange={value => {\n setActiveTab(Number(value))\n }}\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 {isLoading && (\n <div className=\"flex h-full flex-col items-center justify-center\">\n <LoadingDots />\n </div>\n )}\n\n {!isLoading && (\n <div className=\"mt-[24px] overflow-auto overscroll-contain\">\n {list.length > 0 ? (\n <div className=\"grid gap-[18px] md:gap-[12px]\">\n {list.map((item, index) => (\n <div key={index} className=\"grid gap-[8px]\">\n {item?.orderNumber && (\n <div className=\"text-[15px] font-semibold leading-[1.4] text-[#777]\">\n {data.orderNumberLabel}: {item.orderNumber}\n </div>\n )}\n <div\n className={classNames(\n 'flex items-center justify-between rounded-[8px] bg-[#f7f8f9] px-[16px] py-[20px]',\n !rounded && 'rounded-none'\n )}\n >\n <div className=\"grid gap-[4px]\">\n <div className=\"text-[16px] font-bold leading-[1.4]\">{item.title}</div>\n <div className=\"text-[14px] font-semibold text-[#999]\">\n {data.valueLabel}: {item.value} {data?.pointUnit}\n </div>\n <div className=\"text-[14px] font-semibold text-[#999]\">\n {item?.couponCode ? `${data?.code || 'Code'}: ${item.couponCode} ` : ''}\n {item?.couponCode && (\n <span\n className=\"cursor-pointer text-[14px] font-semibold text-brand underline\"\n onClick={() => {\n handleCopy(item.couponCode, index)\n }}\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n {copied === index ? data?.copied || 'COPIED' : data?.copy || 'COPY'}\n </span>\n )}\n </div>\n </div>\n <div className=\"grid gap-[4px] text-right\">\n <div\n className={classNames(\n 'flex items-center justify-end text-[16px] font-bold leading-[1.4]',\n `text-[${ColorMap[item.type]}]`\n )}\n >\n <span>{TypeMap[item.type]}</span>\n {TipMap[item.type] && <Tip info={TipMap[item.type]} index={index} />}\n </div>\n <div className=\"text-[14px] font-semibold text-[#999]\">\n {dayjs(item.date).format('YYYY-MM-DD HH:mm').toString()}\n </div>\n </div>\n </div>\n </div>\n ))}\n </div>\n ) : (\n <div className=\"flex h-full flex-col items-center justify-center\">\n <Picture\n className=\"mb-[12px] w-[160px]\"\n source={data?.emptyListImage?.url}\n alt={data?.emptyListImage?.alt || 'empty list image'}\n ></Picture>\n <div className=\"text-[16px] font-semibold leading-[1.4]\">{data?.emptyListLabel}</div>\n </div>\n )}\n </div>\n )}\n </CreditsModalContainer>\n )\n}\n\nexport default MyRewardsModal\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": ["MyRewardsModal_exports", "__export", "MyRewardsModal_default", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_classnames", "import_copy_to_clipboard", "import_dayjs", "import_react", "import_const", "import_modalContainer", "import_tip", "import_loadingDots", "import_useMyRewards", "import_lib", "import_constants", "MyRewardsModal", "data", "props", "activeTab", "setActiveTab", "brand", "rounded", "couponPage", "setCouponPage", "productPage", "setProductPage", "copied", "setCopied", "tabs", "availableTabs", "myProductRewardsOptions", "myCouponRewardsOptions", "myCouponRewards", "couponCanNext", "couponIsLoading", "useMyRewards", "myProductRewards", "productCanNext", "productIsLoading", "list", "item", "type", "canNext", "TypeMap", "TipMap", "ColorMap", "handleScrollEnd", "handleCopy", "code", "idx", "clipboard", "isLoading", "classNames", "value", "tab", "LoadingDots", "index", "e", "Tip", "dayjs"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var M=Object.create;var d=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var D=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty;var k=(e,t)=>{for(var n in t)d(e,n,{get:t[n],enumerable:!0})},C=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of R(t))!H.call(e,l)&&l!==n&&d(e,l,{get:()=>t[l],enumerable:!(r=E(t,l))||r.enumerable});return e};var S=(e,t,n)=>(n=e!=null?M(D(e)):{},C(t||!e||!e.__esModule?d(n,"default",{value:e,enumerable:!0}):n,e)),Z=e=>C(d({},"__esModule",{value:!0}),e);var I={};k(I,{CreditsModalContainer:()=>A});module.exports=Z(I);var o=require("react/jsx-runtime"),i=require("@anker-in/lib"),m=require("react"),f=S(require("react-modal")),v=require("../../../constants");const A=({isOpen:e,title:t,className:n="",overlayClassName:r="",scrollClassName:l="",onClose:c,onScrollEnd:p,children:u,useAnimation:x,animationClassName:h,titleClassName:L="",...g})=>{const[b,w]=(0,m.useState)(!1);(0,m.useEffect)(()=>{x&&requestAnimationFrame(()=>{w(e??!1)})},[e,x]);const{brand:N}=(0,i.useHeadlessContext)(),y=v.ROUNDED_BRANDS.includes(N);return(0,o.jsxs)(f.default,{isOpen:e??!1,overlayClassName:(0,i.classNames)("fixed inset-0 z-[999] flex items-center justify-center bg-black/70 leading-[1.2] md:items-end",r),className:(0,i.classNames)("min-md:max-h-[calc(100vh-96px)] relative flex min-h-[200px] flex-col overflow-hidden rounded-[16px] bg-white outline-none transition-all duration-300 md:h-[88.27vh] md:w-full md:rounded-b-none",!y&&"rounded-none",b?"":h,n),onRequestClose:c,...g,children:[(0,o.jsxs)("div",{className:(0,i.classNames)("flex w-full shrink-0 items-center justify-between",t?"min-l:px-[32px] h-[70px] border-b border-[#e2e2e2] px-[24px]":"h-[48px] px-[16px]",L),children:[(0,o.jsx)("div",{className:"text-[18px] font-bold",children:t}),(0,o.jsx)("div",{className:"size-[22px] cursor-pointer",onClick:c,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),c?.())},role:"button",tabIndex:0,children:(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:(0,o.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.8525 5.31015C16.4558 4.91337 15.8125 4.91338 15.4157 5.31015L11.1268 9.5991L6.83815 5.31049C6.44138 4.91372 5.79808 4.91372 5.40131 5.31049C5.00454 5.70726 5.00455 6.35055 5.40131 6.74732L9.68993 11.0359L5.40105 15.3248C5.00428 15.7216 5.00428 16.3649 5.40105 16.7616C5.79782 17.1584 6.44111 17.1584 6.83788 16.7616L11.1268 12.4728L15.416 16.762C15.8128 17.1588 16.456 17.1588 16.8528 16.762C17.2496 16.3652 17.2496 15.7219 16.8528 15.3252L12.5636 11.0359L16.8525 6.74698C17.2493 6.35021 17.2493 5.70692 16.8525 5.31015ZM16.921 6.02856C16.921 6.22992 16.8441 6.43127 16.6905 6.5849L14.465 8.8104L12.2395 11.0359L12.2395 11.0359L16.6905 6.58493C16.8441 6.43129 16.921 6.22993 16.921 6.02856ZM5.34966 6.19087C5.37992 6.3354 5.45115 6.47307 5.56336 6.58528L10.014 11.0359L10.014 11.0359L5.56336 6.58524C5.45116 6.47304 5.37992 6.33539 5.34966 6.19087ZM5.35087 16.2121C5.38193 16.3541 5.45267 16.4891 5.56309 16.5996C5.87037 16.9068 6.36856 16.9068 6.67583 16.5996L11.1268 12.1486L15.578 16.5999C15.8853 16.9072 16.3835 16.9072 16.6908 16.5999C16.8498 16.4409 16.9265 16.2307 16.9209 16.0223C16.9265 16.2307 16.8498 16.4409 16.6908 16.5999C16.3835 16.9072 15.8853 16.9072 15.578 16.5999L11.1268 12.1487L6.67583 16.5996C6.36856 16.9069 5.87037 16.9069 5.56309 16.5996C5.45267 16.4892 5.38192 16.3541 5.35087 16.2121Z",fill:"#333333"})})})]}),(0,o.jsx)("div",{className:(0,i.classNames)("my-[32px] flex-1 overflow-auto overscroll-contain px-[24px] md:mb-[48px]",!t&&"mt-0","min-l:px-[32px]",l),onScroll:s=>{const a=s.target;a.scrollHeight<=a.clientHeight||a.scrollTop+a.clientHeight>=a.scrollHeight-50&&p&&p(s)},children:u})]})};
|
|
2
|
-
//# sourceMappingURL=modalContainer.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/components/credits/modal/modalContainer.tsx"],
|
|
4
|
-
"sourcesContent": ["import { classNames as cn, useHeadlessContext } from '@anker-in/lib'\nimport { useEffect, useState, type UIEvent } from 'react'\nimport ReactModal from 'react-modal'\nimport { ROUNDED_BRANDS } from '../../../constants'\n\nexport type ModalContainerProps = {\n overlayClassName?: string\n className?: string\n scrollClassName?: string\n title?: string\n titleClassName?: string\n useAnimation?: boolean // \u4F7F\u7528\u52A8\u753B\u5C55\u793A\n animationClassName?: string // \u52A8\u753B\u5C55\u793A\u63A7\u5236\u7684classname\n isOpen: boolean\n children?: any\n onClose: () => void\n onScrollEnd?: (event: UIEvent<HTMLDivElement>) => void\n}\n\nexport const CreditsModalContainer = ({\n isOpen,\n title,\n className = '',\n overlayClassName = '',\n scrollClassName = '',\n onClose,\n onScrollEnd,\n children,\n useAnimation,\n animationClassName,\n titleClassName = '',\n ...props\n}: ModalContainerProps): React.ReactElement => {\n const [animationShow, setAnimationShow] = useState(false)\n\n useEffect(() => {\n if (!useAnimation) {\n return\n }\n requestAnimationFrame(() => {\n setAnimationShow(isOpen ?? false)\n })\n }, [isOpen, useAnimation])\n\n const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n\n return (\n <ReactModal\n isOpen={isOpen ?? false}\n overlayClassName={cn(\n 'fixed inset-0 z-[999] flex items-center justify-center bg-black/70 leading-[1.2] md:items-end',\n overlayClassName\n )}\n className={cn(\n 'min-md:max-h-[calc(100vh-96px)] relative flex min-h-[200px] flex-col overflow-hidden rounded-[16px] bg-white outline-none transition-all duration-300 md:h-[88.27vh] md:w-full md:rounded-b-none',\n !rounded && 'rounded-none',\n animationShow ? '' : animationClassName,\n className\n )}\n onRequestClose={onClose}\n {...props}\n >\n <div\n className={cn(\n 'flex w-full shrink-0 items-center justify-between',\n title ? 'min-l:px-[32px] h-[70px] border-b border-[#e2e2e2] px-[24px]' : 'h-[48px] px-[16px]',\n titleClassName\n )}\n >\n <div className=\"text-[18px] font-bold\">{title}</div>\n <div\n className=\"size-[22px] cursor-pointer\"\n onClick={onClose}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n onClose?.()\n }\n }}\n role=\"button\"\n tabIndex={0}\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"22\" height=\"22\" viewBox=\"0 0 22 22\" fill=\"none\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M16.8525 5.31015C16.4558 4.91337 15.8125 4.91338 15.4157 5.31015L11.1268 9.5991L6.83815 5.31049C6.44138 4.91372 5.79808 4.91372 5.40131 5.31049C5.00454 5.70726 5.00455 6.35055 5.40131 6.74732L9.68993 11.0359L5.40105 15.3248C5.00428 15.7216 5.00428 16.3649 5.40105 16.7616C5.79782 17.1584 6.44111 17.1584 6.83788 16.7616L11.1268 12.4728L15.416 16.762C15.8128 17.1588 16.456 17.1588 16.8528 16.762C17.2496 16.3652 17.2496 15.7219 16.8528 15.3252L12.5636 11.0359L16.8525 6.74698C17.2493 6.35021 17.2493 5.70692 16.8525 5.31015ZM16.921 6.02856C16.921 6.22992 16.8441 6.43127 16.6905 6.5849L14.465 8.8104L12.2395 11.0359L12.2395 11.0359L16.6905 6.58493C16.8441 6.43129 16.921 6.22993 16.921 6.02856ZM5.34966 6.19087C5.37992 6.3354 5.45115 6.47307 5.56336 6.58528L10.014 11.0359L10.014 11.0359L5.56336 6.58524C5.45116 6.47304 5.37992 6.33539 5.34966 6.19087ZM5.35087 16.2121C5.38193 16.3541 5.45267 16.4891 5.56309 16.5996C5.87037 16.9068 6.36856 16.9068 6.67583 16.5996L11.1268 12.1486L15.578 16.5999C15.8853 16.9072 16.3835 16.9072 16.6908 16.5999C16.8498 16.4409 16.9265 16.2307 16.9209 16.0223C16.9265 16.2307 16.8498 16.4409 16.6908 16.5999C16.3835 16.9072 15.8853 16.9072 15.578 16.5999L11.1268 12.1487L6.67583 16.5996C6.36856 16.9069 5.87037 16.9069 5.56309 16.5996C5.45267 16.4892 5.38192 16.3541 5.35087 16.2121Z\"\n fill=\"#333333\"\n />\n </svg>\n </div>\n </div>\n <div\n className={cn(\n 'my-[32px] flex-1 overflow-auto overscroll-contain px-[24px] md:mb-[48px]',\n !title && 'mt-0',\n 'min-l:px-[32px]',\n scrollClassName\n )}\n onScroll={event => {\n const targetElement = event.target as HTMLDivElement\n\n if (targetElement.scrollHeight <= targetElement.clientHeight) {\n return\n }\n\n if (targetElement.scrollTop + targetElement.clientHeight >= targetElement.scrollHeight - 50) {\n onScrollEnd && onScrollEnd(event)\n }\n }}\n >\n {children}\n </div>\n </ReactModal>\n )\n}\n"],
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,2BAAAE,IAAA,eAAAC,EAAAH,GA+DM,IAAAI,EAAA,6BA/DNC,EAAqD,yBACrDC,EAAkD,iBAClDC,EAAuB,0BACvBC,EAA+B,8BAgBxB,MAAMN,EAAwB,CAAC,CACpC,OAAAO,EACA,MAAAC,EACA,UAAAC,EAAY,GACZ,iBAAAC,EAAmB,GACnB,gBAAAC,EAAkB,GAClB,QAAAC,EACA,YAAAC,EACA,SAAAC,EACA,aAAAC,EACA,mBAAAC,EACA,eAAAC,EAAiB,GACjB,GAAGC,CACL,IAA+C,CAC7C,KAAM,CAACC,EAAeC,CAAgB,KAAI,YAAS,EAAK,KAExD,aAAU,IAAM,CACTL,GAGL,sBAAsB,IAAM,CAC1BK,EAAiBb,GAAU,EAAK,CAClC,CAAC,CACH,EAAG,CAACA,EAAQQ,CAAY,CAAC,EAEzB,KAAM,CAAE,MAAAM,CAAM,KAAI,sBAAmB,EAC/BC,EAAU,iBAAe,SAASD,CAAK,EAE7C,SACE,QAAC,EAAAE,QAAA,CACC,OAAQhB,GAAU,GAClB,oBAAkB,EAAAiB,YAChB,gGACAd,CACF,EACA,aAAW,EAAAc,YACT,mMACA,CAACF,GAAW,eACZH,EAAgB,GAAKH,EACrBP,CACF,EACA,eAAgBG,EACf,GAAGM,EAEJ,qBAAC,OACC,aAAW,EAAAM,YACT,oDACAhB,EAAQ,+DAAiE,qBACzES,CACF,EAEA,oBAAC,OAAI,UAAU,wBAAyB,SAAAT,EAAM,KAC9C,OAAC,OACC,UAAU,6BACV,QAASI,EACT,UAAWa,GAAK,EACVA,EAAE,MAAQ,SAAWA,EAAE,MAAQ,OACjCA,EAAE,eAAe,EACjBb,IAAU,EAEd,EACA,KAAK,SACL,SAAU,EAEV,mBAAC,OAAI,MAAM,6BAA6B,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OACtF,mBAAC,QACC,SAAS,UACT,SAAS,UACT,EAAE,syCACF,KAAK,UACP,EACF,EACF,GACF,KACA,OAAC,OACC,aAAW,EAAAY,YACT,2EACA,CAAChB,GAAS,OACV,kBACAG,CACF,EACA,SAAUe,GAAS,CACjB,MAAMC,EAAgBD,EAAM,OAExBC,EAAc,cAAgBA,EAAc,cAI5CA,EAAc,UAAYA,EAAc,cAAgBA,EAAc,aAAe,IACvFd,GAAeA,EAAYa,CAAK,CAEpC,EAEC,SAAAZ,EACH,GACF,CAEJ",
|
|
6
|
-
"names": ["modalContainer_exports", "__export", "CreditsModalContainer", "__toCommonJS", "import_jsx_runtime", "import_lib", "import_react", "import_react_modal", "import_constants", "isOpen", "title", "className", "overlayClassName", "scrollClassName", "onClose", "onScrollEnd", "children", "useAnimation", "animationClassName", "titleClassName", "props", "animationShow", "setAnimationShow", "brand", "rounded", "ReactModal", "cn", "e", "event", "targetElement"]
|
|
7
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CartCard Storybook Stories
|
|
3
|
-
* 展示购物车卡片组件的各种状态
|
|
4
|
-
*/
|
|
5
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import type { CartContent } from '../components/LiveChatWidget/types';
|
|
8
|
-
declare const CartCardWrapper: React.FC<{
|
|
9
|
-
content: CartContent;
|
|
10
|
-
}>;
|
|
11
|
-
declare const meta: Meta<typeof CartCardWrapper>;
|
|
12
|
-
export default meta;
|
|
13
|
-
type Story = StoryObj<typeof CartCardWrapper>;
|
|
14
|
-
/**
|
|
15
|
-
* 空购物车状态
|
|
16
|
-
*/
|
|
17
|
-
export declare const Empty: Story;
|
|
18
|
-
/**
|
|
19
|
-
* 单件商品
|
|
20
|
-
*/
|
|
21
|
-
export declare const SingleItem: Story;
|
|
22
|
-
/**
|
|
23
|
-
* 多件商品
|
|
24
|
-
*/
|
|
25
|
-
export declare const MultipleItems: Story;
|
|
26
|
-
/**
|
|
27
|
-
* 有折扣码的购物车
|
|
28
|
-
*/
|
|
29
|
-
export declare const WithDiscount: Story;
|
|
30
|
-
/**
|
|
31
|
-
* 多个折扣码(部分失效)
|
|
32
|
-
*/
|
|
33
|
-
export declare const WithMultipleDiscounts: Story;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";var c=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var p=(t,e)=>{for(var a in e)c(t,a,{get:e[a],enumerable:!0})},m=(t,e,a,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of d(e))!s.call(t,o)&&o!==a&&c(t,o,{get:()=>e[o],enumerable:!(n=i(e,o))||n.enumerable});return t};var y=t=>m(c({},"__esModule",{value:!0}),t);var A={};p(A,{Empty:()=>S,MultipleItems:()=>g,SingleItem:()=>f,WithDiscount:()=>U,WithMultipleDiscounts:()=>D,default:()=>C});module.exports=y(A);var r=require("react/jsx-runtime"),u=require("../components/LiveChatWidget/components/MessageContent/CartCard.js");const l=({content:t})=>(0,r.jsx)("div",{className:"flex min-h-screen items-center justify-center bg-gray-100 p-4",children:(0,r.jsx)("div",{className:"w-full max-w-md",children:u.CartCard.render(t,!1,!1)})}),h={title:"Campaign/LiveChatWidget/MessageContent/CartCard",component:l,parameters:{layout:"fullscreen",docs:{description:{component:`
|
|
2
|
-
# \u8D2D\u7269\u8F66\u5361\u7247\u7EC4\u4EF6
|
|
3
|
-
|
|
4
|
-
\u663E\u793A\u7528\u6237\u8D2D\u7269\u8F66\u5185\u5BB9\uFF0C\u5305\u62EC\u5546\u54C1\u5217\u8868\u3001\u4EF7\u683C\u6C47\u603B\u548C\u7ED3\u8D26\u6309\u94AE\u3002
|
|
5
|
-
|
|
6
|
-
## \u529F\u80FD\u7279\u6027
|
|
7
|
-
|
|
8
|
-
- \u{1F4E6} **\u5546\u54C1\u5217\u8868**: \u5C55\u793A\u8D2D\u7269\u8F66\u4E2D\u7684\u6240\u6709\u5546\u54C1
|
|
9
|
-
- \u{1F4B0} **\u4EF7\u683C\u6C47\u603B**: \u663E\u793A\u5C0F\u8BA1\u3001\u6298\u6263\u548C\u603B\u8BA1
|
|
10
|
-
- \u{1F39F}\uFE0F **\u6298\u6263\u7801**: \u663E\u793A\u5DF2\u5E94\u7528\u7684\u6298\u6263\u7801\u53CA\u5176\u72B6\u6001
|
|
11
|
-
- \u{1F6D2} **\u7ED3\u8D26\u6309\u94AE**: \u4E00\u952E\u8DF3\u8F6C\u5230 Shopify \u7ED3\u8D26\u9875\u9762
|
|
12
|
-
- \u{1F233} **\u7A7A\u72B6\u6001**: \u4F18\u96C5\u7684\u7A7A\u8D2D\u7269\u8F66\u63D0\u793A
|
|
13
|
-
|
|
14
|
-
## \u4F7F\u7528\u573A\u666F
|
|
15
|
-
|
|
16
|
-
- \u7528\u6237\u6DFB\u52A0\u5546\u54C1\u5230\u8D2D\u7269\u8F66\u540E (add_to_cart)
|
|
17
|
-
- \u7528\u6237\u67E5\u8BE2\u8D2D\u7269\u8F66\u5185\u5BB9 (get_cart)
|
|
18
|
-
- \u7528\u6237\u4FEE\u6539\u8D2D\u7269\u8F66\u6570\u91CF (update_cart_item)
|
|
19
|
-
- \u7528\u6237\u5E94\u7528\u6298\u6263\u7801 (update_discount_codes)
|
|
20
|
-
`}}},tags:["autodocs"]};var C=h;const S={args:{content:{type:"cart",data:{isEmpty:!0,cartId:"gid://shopify/Cart/empty",totalQuantity:0,lines:[],cost:{totalAmount:{amount:"0.00",currencyCode:"USD"},subtotalAmount:{amount:"0.00",currencyCode:"USD"}}}}}},f={args:{content:{type:"cart",data:{isEmpty:!1,cartId:"gid://shopify/Cart/Z2NwLXVzLWVhc3QxOjAxSkZHRjA4VkFRQkhON1dBMTNLREZEVEZH",totalQuantity:1,lines:[{id:"gid://shopify/CartLine/12345",quantity:1,cost:{totalAmount:{amount:"99.99",currencyCode:"USD"},amountPerQuantity:{amount:"99.99",currencyCode:"USD"},subtotalAmount:{amount:"99.99",currencyCode:"USD"}},merchandise:{id:"gid://shopify/ProductVariant/43234567890",title:"Black",price:{amount:"99.99",currencyCode:"USD"},image:{url:"https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=400&h=400&fit=crop",altText:"Soundcore Space One"},product:{id:"gid://shopify/Product/8179159826618",title:"Soundcore Space One",handle:"soundcore-space-one"}}}],cost:{totalAmount:{amount:"99.99",currencyCode:"USD"},subtotalAmount:{amount:"99.99",currencyCode:"USD"}},checkoutUrl:"https://checkout.shopify.com/example"}}}},g={args:{content:{type:"cart",data:{isEmpty:!1,cartId:"gid://shopify/Cart/Z2NwLXVzLWVhc3QxOjAxSkZHRjA4VkFRQkhON1dBMTNLREZEVEZH",totalQuantity:5,lines:[{id:"gid://shopify/CartLine/12345",quantity:2,cost:{totalAmount:{amount:"199.98",currencyCode:"USD"},amountPerQuantity:{amount:"99.99",currencyCode:"USD"},subtotalAmount:{amount:"199.98",currencyCode:"USD"}},merchandise:{id:"gid://shopify/ProductVariant/43234567890",title:"Black",price:{amount:"99.99",currencyCode:"USD"},image:{url:"https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=400&h=400&fit=crop",altText:"Soundcore Space One"},product:{id:"gid://shopify/Product/8179159826618",title:"Soundcore Space One",handle:"soundcore-space-one"}}},{id:"gid://shopify/CartLine/12346",quantity:1,cost:{totalAmount:{amount:"129.99",currencyCode:"USD"},amountPerQuantity:{amount:"129.99",currencyCode:"USD"},subtotalAmount:{amount:"129.99",currencyCode:"USD"}},merchandise:{id:"gid://shopify/ProductVariant/43234567891",title:"White",price:{amount:"129.99",currencyCode:"USD"},image:{url:"https://images.unsplash.com/photo-1484704849700-f032a568e944?w=400&h=400&fit=crop",altText:"eufy Security Camera"},product:{id:"gid://shopify/Product/8179159826619",title:"eufy Security Camera",handle:"eufy-security-camera"}}},{id:"gid://shopify/CartLine/12347",quantity:2,cost:{totalAmount:{amount:"79.98",currencyCode:"USD"},amountPerQuantity:{amount:"39.99",currencyCode:"USD"},subtotalAmount:{amount:"79.98",currencyCode:"USD"}},merchandise:{id:"gid://shopify/ProductVariant/43234567892",title:"USB-C Cable",price:{amount:"39.99",currencyCode:"USD"},image:{url:"https://images.unsplash.com/photo-1583863788434-e58a36330cf0?w=400&h=400&fit=crop",altText:"Anker USB-C Cable"},product:{id:"gid://shopify/Product/8179159826620",title:"Anker USB-C Cable 6ft",handle:"anker-usb-c-cable"}}}],cost:{totalAmount:{amount:"409.95",currencyCode:"USD"},subtotalAmount:{amount:"409.95",currencyCode:"USD"}},checkoutUrl:"https://checkout.shopify.com/example"}}}},U={args:{content:{type:"cart",data:{isEmpty:!1,cartId:"gid://shopify/Cart/Z2NwLXVzLWVhc3QxOjAxSkZHRjA4VkFRQkhON1dBMTNLREZEVEZH",totalQuantity:3,lines:[{id:"gid://shopify/CartLine/12345",quantity:2,cost:{totalAmount:{amount:"199.98",currencyCode:"USD"},amountPerQuantity:{amount:"99.99",currencyCode:"USD"},subtotalAmount:{amount:"199.98",currencyCode:"USD"}},merchandise:{id:"gid://shopify/ProductVariant/43234567890",title:"Black",price:{amount:"99.99",currencyCode:"USD"},image:{url:"https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=400&h=400&fit=crop",altText:"Soundcore Space One"},product:{id:"gid://shopify/Product/8179159826618",title:"Soundcore Space One",handle:"soundcore-space-one"}}},{id:"gid://shopify/CartLine/12346",quantity:1,cost:{totalAmount:{amount:"129.99",currencyCode:"USD"},amountPerQuantity:{amount:"129.99",currencyCode:"USD"},subtotalAmount:{amount:"129.99",currencyCode:"USD"}},merchandise:{id:"gid://shopify/ProductVariant/43234567891",title:"White",price:{amount:"129.99",currencyCode:"USD"},image:{url:"https://images.unsplash.com/photo-1484704849700-f032a568e944?w=400&h=400&fit=crop",altText:"eufy Security Camera"},product:{id:"gid://shopify/Product/8179159826619",title:"eufy Security Camera",handle:"eufy-security-camera"}}}],cost:{totalAmount:{amount:"296.97",currencyCode:"USD"},subtotalAmount:{amount:"329.97",currencyCode:"USD"}},discountCodes:[{code:"SPRING20",applicable:!0}],checkoutUrl:"https://checkout.shopify.com/example"}}}},D={args:{content:{type:"cart",data:{isEmpty:!1,cartId:"gid://shopify/Cart/Z2NwLXVzLWVhc3QxOjAxSkZHRjA4VkFRQkhON1dBMTNLREZEVEZH",totalQuantity:2,lines:[{id:"gid://shopify/CartLine/12345",quantity:2,cost:{totalAmount:{amount:"199.98",currencyCode:"USD"},amountPerQuantity:{amount:"99.99",currencyCode:"USD"},subtotalAmount:{amount:"199.98",currencyCode:"USD"}},merchandise:{id:"gid://shopify/ProductVariant/43234567890",title:"Black",price:{amount:"99.99",currencyCode:"USD"},image:{url:"https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=400&h=400&fit=crop",altText:"Soundcore Space One"},product:{id:"gid://shopify/Product/8179159826618",title:"Soundcore Space One",handle:"soundcore-space-one"}}}],cost:{totalAmount:{amount:"179.98",currencyCode:"USD"},subtotalAmount:{amount:"199.98",currencyCode:"USD"}},discountCodes:[{code:"WELCOME10",applicable:!0},{code:"EXPIRED20",applicable:!1}],checkoutUrl:"https://checkout.shopify.com/example"}}}};
|
|
21
|
-
//# sourceMappingURL=CartCard.stories.js.map
|