@anker-in/campaign-ui 0.2.0 → 0.2.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/chat/index.js +1 -1
- package/dist/cjs/components/chat/index.js.map +3 -3
- package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js +1 -1
- package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js.map +2 -2
- package/dist/cjs/components/credits/context/hooks/useSubscribed.js +1 -1
- package/dist/cjs/components/credits/context/hooks/useSubscribed.js.map +3 -3
- package/dist/cjs/components/credits/context/provider.d.ts +8 -33
- 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/creditsBanner/index.d.ts +16 -16
- package/dist/cjs/components/credits/creditsBanner/index.js +1 -1
- package/dist/cjs/components/credits/creditsBanner/index.js.map +2 -2
- package/dist/cjs/components/credits/creditsBenefits/benefitItem.js +1 -1
- package/dist/cjs/components/credits/creditsBenefits/benefitItem.js.map +3 -3
- package/dist/cjs/components/credits/creditsBenefits/index.d.ts +7 -8
- package/dist/cjs/components/credits/creditsBenefits/index.js +3 -3
- package/dist/cjs/components/credits/creditsBenefits/index.js.map +3 -3
- package/dist/cjs/components/credits/creditsCash/CreditsCash.d.ts +4 -0
- package/dist/cjs/components/credits/creditsCash/CreditsCash.js +2 -0
- package/dist/cjs/components/credits/creditsCash/CreditsCash.js.map +7 -0
- package/dist/cjs/components/credits/creditsCash/RedeemableItem.d.ts +1 -5
- package/dist/cjs/components/credits/creditsCash/RedeemableItem.js +1 -1
- package/dist/cjs/components/credits/creditsCash/RedeemableItem.js.map +3 -3
- package/dist/cjs/components/credits/creditsCash/index.d.ts +2 -11
- package/dist/cjs/components/credits/creditsCash/index.js +1 -1
- package/dist/cjs/components/credits/creditsCash/index.js.map +4 -4
- package/dist/cjs/components/credits/creditsCash/type.d.ts +1 -3
- package/dist/cjs/components/credits/creditsCash/type.js +1 -1
- package/dist/cjs/components/credits/creditsCash/type.js.map +1 -1
- package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js +1 -1
- package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js.map +3 -3
- package/dist/cjs/components/credits/creditsFaq/index.d.ts +2 -2
- package/dist/cjs/components/credits/creditsFaq/index.js +1 -1
- package/dist/cjs/components/credits/creditsFaq/index.js.map +3 -3
- package/dist/cjs/components/credits/creditsInfoCard/index.d.ts +9 -15
- 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/creditsRedeemList/AddressForm/CountrySelect.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +3 -3
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +3 -3
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js.map +3 -3
- package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.d.ts +4 -0
- package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.d.ts +1 -3
- package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.js.map +3 -3
- 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.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +3 -3
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +3 -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.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +3 -3
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +3 -3
- 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/RedeemableItem.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js.map +3 -3
- package/dist/cjs/components/credits/creditsRedeemList/index.d.ts +2 -12
- package/dist/cjs/components/credits/creditsRedeemList/index.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/index.js.map +4 -4
- package/dist/cjs/components/credits/creditsRedeemList/type.d.ts +1 -15
- 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.d.ts +2 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +2 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +7 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/index.d.ts +2 -2
- package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js +1 -1
- package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js.map +4 -4
- package/dist/cjs/components/credits/creditsWaysToGetCredits/type.d.ts +5 -15
- package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js +1 -1
- package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js.map +2 -2
- package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.d.ts +11 -2
- package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js +1 -1
- package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js.map +3 -3
- package/dist/cjs/components/credits/modal/MyRewardsModal.js +1 -1
- package/dist/cjs/components/credits/modal/MyRewardsModal.js.map +3 -3
- package/dist/cjs/components/credits/modal/activitiesModal.js +1 -1
- package/dist/cjs/components/credits/modal/activitiesModal.js.map +3 -3
- package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js +1 -1
- package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js.map +3 -3
- package/dist/cjs/components/credits/modal/modalContainer.js +1 -1
- package/dist/cjs/components/credits/modal/modalContainer.js.map +3 -3
- package/dist/cjs/components/credits/modal/rulesModal.js +1 -1
- package/dist/cjs/components/credits/modal/rulesModal.js.map +3 -3
- package/dist/cjs/components/credits/modal/subscribeModal.d.ts +15 -0
- package/dist/cjs/components/credits/modal/subscribeModal.js +2 -0
- package/dist/cjs/components/credits/modal/subscribeModal.js.map +7 -0
- package/dist/cjs/components/credits/modal/tip.js +1 -1
- package/dist/cjs/components/credits/modal/tip.js.map +3 -3
- package/dist/cjs/components/credits/type.d.ts +23 -4
- package/dist/cjs/components/credits/type.js +1 -1
- package/dist/cjs/components/credits/type.js.map +1 -1
- package/dist/cjs/components/index.d.ts +1 -0
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/components/index.js.map +2 -2
- package/dist/cjs/components/registration/authCodeActivate/Message.js +1 -1
- package/dist/cjs/components/registration/authCodeActivate/Message.js.map +2 -2
- package/dist/cjs/components/registration/authCodeActivate/index.js +1 -1
- package/dist/cjs/components/registration/authCodeActivate/index.js.map +3 -3
- package/dist/cjs/components/registration/authCodeActivate/type.d.ts +1 -2
- package/dist/cjs/components/registration/authCodeActivate/type.js +1 -1
- package/dist/cjs/components/registration/authCodeActivate/type.js.map +1 -1
- package/dist/cjs/components/registration/context/index.d.ts +1 -0
- package/dist/cjs/components/registration/context/index.js +2 -0
- package/dist/cjs/components/registration/context/index.js.map +7 -0
- package/dist/cjs/components/registration/context/provider.d.ts +27 -0
- package/dist/cjs/components/registration/context/provider.js +2 -0
- package/dist/cjs/components/registration/context/provider.js.map +7 -0
- package/dist/cjs/components/registration/index.d.ts +1 -0
- package/dist/cjs/components/registration/index.js +1 -1
- package/dist/cjs/components/registration/index.js.map +2 -2
- package/dist/cjs/components/registration/modalContainer.d.ts +1 -2
- package/dist/cjs/components/registration/modalContainer.js +1 -1
- package/dist/cjs/components/registration/modalContainer.js.map +3 -3
- package/dist/cjs/helpers/fetcher.d.ts +1 -1
- package/dist/cjs/helpers/fetcher.js +1 -1
- package/dist/cjs/helpers/fetcher.js.map +3 -3
- package/dist/cjs/helpers/index.d.ts +2 -2
- package/dist/cjs/helpers/index.js +1 -1
- package/dist/cjs/helpers/index.js.map +2 -2
- package/dist/cjs/index.d.ts +2 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/templates/credits.d.ts +59 -0
- package/dist/cjs/templates/credits.js +2 -0
- package/dist/cjs/templates/credits.js.map +7 -0
- package/dist/cjs/templates/index.d.ts +1 -0
- package/dist/cjs/templates/index.js +2 -0
- package/dist/cjs/templates/index.js.map +7 -0
- package/dist/esm/components/chat/index.js +1 -1
- package/dist/esm/components/chat/index.js.map +2 -2
- package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js +1 -1
- package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js.map +2 -2
- package/dist/esm/components/credits/context/hooks/useSubscribed.js +1 -1
- package/dist/esm/components/credits/context/hooks/useSubscribed.js.map +3 -3
- package/dist/esm/components/credits/context/provider.d.ts +8 -33
- 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/creditsBanner/index.d.ts +16 -16
- package/dist/esm/components/credits/creditsBanner/index.js +1 -1
- package/dist/esm/components/credits/creditsBanner/index.js.map +2 -2
- package/dist/esm/components/credits/creditsBenefits/benefitItem.js +1 -1
- package/dist/esm/components/credits/creditsBenefits/benefitItem.js.map +3 -3
- package/dist/esm/components/credits/creditsBenefits/index.d.ts +7 -8
- package/dist/esm/components/credits/creditsBenefits/index.js +3 -3
- package/dist/esm/components/credits/creditsBenefits/index.js.map +2 -2
- package/dist/esm/components/credits/creditsCash/CreditsCash.d.ts +4 -0
- package/dist/esm/components/credits/creditsCash/CreditsCash.js +2 -0
- package/dist/esm/components/credits/creditsCash/CreditsCash.js.map +7 -0
- package/dist/esm/components/credits/creditsCash/RedeemableItem.d.ts +1 -5
- package/dist/esm/components/credits/creditsCash/RedeemableItem.js +1 -1
- package/dist/esm/components/credits/creditsCash/RedeemableItem.js.map +3 -3
- package/dist/esm/components/credits/creditsCash/index.d.ts +2 -11
- package/dist/esm/components/credits/creditsCash/index.js +1 -1
- package/dist/esm/components/credits/creditsCash/index.js.map +4 -4
- package/dist/esm/components/credits/creditsCash/type.d.ts +1 -3
- package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js +1 -1
- package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js.map +2 -2
- package/dist/esm/components/credits/creditsFaq/index.d.ts +2 -2
- package/dist/esm/components/credits/creditsFaq/index.js +1 -1
- package/dist/esm/components/credits/creditsFaq/index.js.map +3 -3
- package/dist/esm/components/credits/creditsInfoCard/index.d.ts +9 -15
- 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/creditsRedeemList/AddressForm/CountrySelect.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +3 -3
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +3 -3
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js.map +3 -3
- package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.d.ts +4 -0
- package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/NonProductValue.d.ts +1 -3
- package/dist/esm/components/credits/creditsRedeemList/NonProductValue.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/NonProductValue.js.map +3 -3
- 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.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +3 -3
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +3 -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.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +3 -3
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +3 -3
- 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/RedeemableItem.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js.map +3 -3
- package/dist/esm/components/credits/creditsRedeemList/index.d.ts +2 -12
- package/dist/esm/components/credits/creditsRedeemList/index.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/index.js.map +4 -4
- package/dist/esm/components/credits/creditsRedeemList/type.d.ts +1 -15
- package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.d.ts +2 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +2 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +7 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/index.d.ts +2 -2
- package/dist/esm/components/credits/creditsWaysToGetCredits/index.js +1 -1
- package/dist/esm/components/credits/creditsWaysToGetCredits/index.js.map +4 -4
- package/dist/esm/components/credits/creditsWaysToGetCredits/type.d.ts +5 -15
- package/dist/esm/components/credits/creditsWaysToGetCredits/type.js.map +2 -2
- package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.d.ts +11 -2
- package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js +1 -1
- package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js.map +3 -3
- package/dist/esm/components/credits/modal/MyRewardsModal.js +1 -1
- package/dist/esm/components/credits/modal/MyRewardsModal.js.map +3 -3
- package/dist/esm/components/credits/modal/activitiesModal.js +1 -1
- package/dist/esm/components/credits/modal/activitiesModal.js.map +3 -3
- package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js +1 -1
- package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js.map +3 -3
- package/dist/esm/components/credits/modal/modalContainer.js +1 -1
- package/dist/esm/components/credits/modal/modalContainer.js.map +3 -3
- package/dist/esm/components/credits/modal/rulesModal.js +1 -1
- package/dist/esm/components/credits/modal/rulesModal.js.map +2 -2
- package/dist/esm/components/credits/modal/subscribeModal.d.ts +15 -0
- package/dist/esm/components/credits/modal/subscribeModal.js +2 -0
- package/dist/esm/components/credits/modal/subscribeModal.js.map +7 -0
- package/dist/esm/components/credits/modal/tip.js +1 -1
- package/dist/esm/components/credits/modal/tip.js.map +3 -3
- package/dist/esm/components/credits/type.d.ts +23 -4
- package/dist/esm/components/index.d.ts +1 -0
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/index.js.map +2 -2
- package/dist/esm/components/registration/authCodeActivate/Message.js +1 -1
- package/dist/esm/components/registration/authCodeActivate/Message.js.map +2 -2
- package/dist/esm/components/registration/authCodeActivate/index.js +1 -1
- package/dist/esm/components/registration/authCodeActivate/index.js.map +3 -3
- package/dist/esm/components/registration/authCodeActivate/type.d.ts +1 -2
- package/dist/esm/components/registration/context/index.d.ts +1 -0
- package/dist/esm/components/registration/context/index.js +2 -0
- package/dist/esm/components/registration/context/index.js.map +7 -0
- package/dist/esm/components/registration/context/provider.d.ts +27 -0
- package/dist/esm/components/registration/context/provider.js +2 -0
- package/dist/esm/components/registration/context/provider.js.map +7 -0
- package/dist/esm/components/registration/index.d.ts +1 -0
- package/dist/esm/components/registration/index.js +1 -1
- package/dist/esm/components/registration/index.js.map +2 -2
- package/dist/esm/components/registration/modalContainer.d.ts +1 -2
- package/dist/esm/components/registration/modalContainer.js +1 -1
- package/dist/esm/components/registration/modalContainer.js.map +3 -3
- package/dist/esm/helpers/fetcher.d.ts +1 -1
- package/dist/esm/helpers/fetcher.js +1 -1
- package/dist/esm/helpers/fetcher.js.map +3 -3
- package/dist/esm/helpers/index.d.ts +2 -2
- package/dist/esm/helpers/index.js +1 -1
- package/dist/esm/helpers/index.js.map +2 -2
- package/dist/esm/index.d.ts +2 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/templates/credits.d.ts +59 -0
- package/dist/esm/templates/credits.js +2 -0
- package/dist/esm/templates/credits.js.map +7 -0
- package/dist/esm/templates/index.d.ts +1 -0
- package/dist/esm/templates/index.js +2 -0
- package/dist/esm/templates/index.js.map +7 -0
- package/package.json +6 -5
- package/src/components/chat/index.tsx +1 -1
- package/src/components/credits/context/hooks/useRedeemAndBuy.ts +0 -2
- package/src/components/credits/context/hooks/useSubscribed.ts +1 -2
- package/src/components/credits/context/provider.tsx +16 -20
- package/src/components/credits/creditsBanner/index.tsx +14 -16
- package/src/components/credits/creditsBenefits/benefitItem.tsx +19 -4
- package/src/components/credits/creditsBenefits/index.tsx +6 -10
- package/src/components/credits/creditsCash/{index.tsx → CreditsCash.tsx} +8 -26
- package/src/components/credits/creditsCash/RedeemableItem.tsx +35 -17
- package/src/components/credits/creditsCash/index.ts +2 -0
- package/src/components/credits/creditsCash/type.ts +1 -3
- package/src/components/credits/creditsFaq/faqItem/FaqItem.tsx +12 -12
- package/src/components/credits/creditsFaq/index.tsx +7 -5
- package/src/components/credits/creditsInfoCard/index.tsx +38 -33
- package/src/components/credits/creditsRedeemList/AddressForm/CountrySelect.tsx +7 -3
- package/src/components/credits/creditsRedeemList/AddressForm/StateSelect.tsx +5 -1
- package/src/components/credits/creditsRedeemList/AddressForm/index.tsx +6 -5
- package/src/components/credits/creditsRedeemList/{index.tsx → CreditsRedeemList.tsx} +15 -28
- package/src/components/credits/creditsRedeemList/NonProductValue.tsx +4 -3
- package/src/components/credits/creditsRedeemList/RedeemCouponModal.tsx +6 -6
- package/src/components/credits/creditsRedeemList/RedeemProductModal/Address.tsx +14 -11
- package/src/components/credits/creditsRedeemList/RedeemProductModal/Init.tsx +4 -2
- package/src/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.tsx +3 -1
- package/src/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.tsx +9 -5
- package/src/components/credits/creditsRedeemList/RedeemProductModal/Success.tsx +4 -1
- package/src/components/credits/creditsRedeemList/RedeemProductModal/index.tsx +2 -2
- package/src/components/credits/creditsRedeemList/RedeemableItem.tsx +11 -7
- package/src/components/credits/creditsRedeemList/index.ts +2 -0
- package/src/components/credits/creditsRedeemList/type.ts +1 -16
- package/src/components/credits/creditsWaysToGetCredits/{index.tsx → CreditsWaysToGetCredits.tsx} +65 -16
- package/src/components/credits/creditsWaysToGetCredits/index.ts +2 -0
- package/src/components/credits/creditsWaysToGetCredits/type.ts +5 -15
- package/src/components/credits/creditsWaysToGetCredits/useActions.ts +22 -8
- package/src/components/credits/modal/MyRewardsModal.tsx +11 -3
- package/src/components/credits/modal/activitiesModal.tsx +8 -3
- package/src/components/credits/modal/creditsUploadReceiptModal.tsx +9 -1
- package/src/components/credits/modal/modalContainer.tsx +5 -1
- package/src/components/credits/modal/rulesModal.tsx +1 -1
- package/src/components/credits/modal/subscribeModal.tsx +201 -0
- package/src/components/credits/modal/tip.tsx +10 -1
- package/src/components/credits/type.ts +23 -4
- package/src/components/index.ts +2 -2
- package/src/components/registration/authCodeActivate/Message.tsx +43 -0
- package/src/components/registration/authCodeActivate/index.tsx +338 -0
- package/src/components/registration/authCodeActivate/type.ts +23 -0
- package/src/components/registration/context/index.tsx +1 -0
- package/src/components/registration/context/provider.tsx +86 -0
- package/src/components/registration/index.ts +2 -0
- package/src/components/registration/modalContainer.tsx +114 -0
- package/src/index.ts +2 -1
- package/src/templates/credits.tsx +134 -0
- package/src/templates/index.ts +1 -0
- package/src/components/credits/context/hooks/useSendEmailValidation.ts +0 -20
- package/src/components/credits/context/hooks/useSubscriptions.ts +0 -29
- package/src/helpers/fetchResponse.ts +0 -35
- package/src/helpers/fetcher.ts +0 -44
- package/src/helpers/index.ts +0 -2
- package/src/helpers/track.ts +0 -73
- package/src/helpers/utils.ts +0 -8
|
@@ -30,7 +30,7 @@ function RedeemCouponModal({
|
|
|
30
30
|
const [disabled, setDisabled] = useState(false)
|
|
31
31
|
const { copy: copyText, copied: copiedStatus } = useCopy()
|
|
32
32
|
|
|
33
|
-
const { profile, fetchCreditInfo } = useCreditsContext()
|
|
33
|
+
const { profile, fetchCreditInfo, pageCommon } = useCreditsContext()
|
|
34
34
|
|
|
35
35
|
const { isMutating: loading, trigger } = useRedeemCoupon({
|
|
36
36
|
onSuccess(responseData) {
|
|
@@ -96,8 +96,8 @@ function RedeemCouponModal({
|
|
|
96
96
|
)}
|
|
97
97
|
>
|
|
98
98
|
<div className="relative mx-auto h-[164px] w-[324px]">
|
|
99
|
-
{
|
|
100
|
-
<Picture source={
|
|
99
|
+
{pageCommon?.imageMapping?.[item.config?.type]?.url && (
|
|
100
|
+
<Picture source={pageCommon.imageMapping[item.config.type].url} className="h-full [&_img]:h-full" />
|
|
101
101
|
)}
|
|
102
102
|
<div className="absolute bottom-[8px] left-[16px] font-extrabold text-white">
|
|
103
103
|
{item.config.value ? (
|
|
@@ -126,7 +126,7 @@ function RedeemCouponModal({
|
|
|
126
126
|
}
|
|
127
127
|
}}
|
|
128
128
|
>
|
|
129
|
-
{copiedStatus ?
|
|
129
|
+
{copiedStatus ? pageCommon?.copied : pageCommon?.copy}
|
|
130
130
|
</div>
|
|
131
131
|
</div>
|
|
132
132
|
) : (
|
|
@@ -136,12 +136,12 @@ function RedeemCouponModal({
|
|
|
136
136
|
'mt-[30px] text-center text-[24px] font-bold leading-[1.2] md:mt-[18px] md:text-[20px] md:leading-[1.2]'
|
|
137
137
|
)}
|
|
138
138
|
>
|
|
139
|
-
{numberFormat(item.alpc?.consumeCredits)} {
|
|
139
|
+
{numberFormat(item.alpc?.consumeCredits)} {pageCommon?.pointUnit}
|
|
140
140
|
</Text>
|
|
141
141
|
)}
|
|
142
142
|
{!couponCode && item.config?.rules?.length > 0 && (
|
|
143
143
|
<div className="mt-[18px] w-full text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:mt-[12px] md:text-[14px]">
|
|
144
|
-
<div className="mb-[4px]">{
|
|
144
|
+
<div className="mb-[4px]">{pageCommon?.ruleLabel}:</div>
|
|
145
145
|
<ul className="ml-4 grid grid-flow-row gap-[4px]">
|
|
146
146
|
{item.config?.rules?.map((text, index) => (
|
|
147
147
|
<li className="list-disc" key={index}>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Button, Text } from '@anker-in/headless-ui'
|
|
2
2
|
import classNames from 'classnames'
|
|
3
3
|
import { AddressForm } from '../AddressForm'
|
|
4
|
-
import { useHeadlessContext } from '@anker-in/lib'
|
|
4
|
+
import { useHeadlessContext, ROUNDED_BRANDS } from '@anker-in/lib'
|
|
5
5
|
import type { RedeemableItem as RedeemableItemType } from '../../type'
|
|
6
6
|
import { CreditsRedeemListCopy } from '../type'
|
|
7
7
|
import { ProductInfo } from './ProductInfo'
|
|
@@ -34,7 +34,8 @@ export const Address = ({
|
|
|
34
34
|
handlePayment,
|
|
35
35
|
item,
|
|
36
36
|
}: AddressProps) => {
|
|
37
|
-
const { storeDomain } = useHeadlessContext()
|
|
37
|
+
const { storeDomain, brand } = useHeadlessContext()
|
|
38
|
+
const rounded = ROUNDED_BRANDS.includes(brand)
|
|
38
39
|
const { countries = [], isLoading: countriesLoading } = useCountries({ shopifyStoreDomain: storeDomain })
|
|
39
40
|
|
|
40
41
|
return (
|
|
@@ -42,18 +43,20 @@ export const Address = ({
|
|
|
42
43
|
<div className={classNames('max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]')}>
|
|
43
44
|
<div>
|
|
44
45
|
{shippingAddress && <Text className="mb-5 text-[16px] font-bold" html={shippingAddress}></Text>}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
{copy.redeemModal?.product?.addressForm && (
|
|
47
|
+
<AddressForm
|
|
48
|
+
onChange={setAddress}
|
|
49
|
+
validate={validateAddress}
|
|
50
|
+
errors={validateErrors}
|
|
51
|
+
form={copy.redeemModal.product.addressForm}
|
|
52
|
+
countries={countries}
|
|
53
|
+
countriesLoading={countriesLoading}
|
|
54
|
+
></AddressForm>
|
|
55
|
+
)}
|
|
53
56
|
</div>
|
|
54
57
|
</div>
|
|
55
58
|
<div className="sticky bottom-0 flex flex-col items-center justify-center bg-white px-[48px] py-[24px] l:px-[16px]">
|
|
56
|
-
<div className=
|
|
59
|
+
<div className={classNames('flex w-full items-center bg-[#F5F5F7] p-[16px]', !rounded && 'rounded-none')}>
|
|
57
60
|
{shippingProduct && <Text className="mb-5 text-[16px] font-bold" html={shippingProduct}></Text>}
|
|
58
61
|
<ProductInfo item={item} copy={copy} />
|
|
59
62
|
</div>
|
|
@@ -6,6 +6,7 @@ import type { RedeemableItem as RedeemableItemType } from '../../type'
|
|
|
6
6
|
import { CreditsRedeemListCopy } from '../type'
|
|
7
7
|
import { ConsumeType } from '../../context/const'
|
|
8
8
|
import { NoneProductValue } from './NonProductValue'
|
|
9
|
+
import { useCreditsContext } from '../../context/provider'
|
|
9
10
|
|
|
10
11
|
type InitProps = {
|
|
11
12
|
copy: CreditsRedeemListCopy
|
|
@@ -16,6 +17,7 @@ type InitProps = {
|
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
export const Init = ({ copy, item, loading, disabled, setStatus }: InitProps) => {
|
|
20
|
+
const { pageCommon } = useCreditsContext()
|
|
19
21
|
const rules = useMemo(() => {
|
|
20
22
|
if (item.config.rules?.length) {
|
|
21
23
|
return item.config.rules
|
|
@@ -37,7 +39,7 @@ export const Init = ({ copy, item, loading, disabled, setStatus }: InitProps) =>
|
|
|
37
39
|
source={
|
|
38
40
|
item.config?.type === ConsumeType.Product
|
|
39
41
|
? item.product.images[0]?.url
|
|
40
|
-
:
|
|
42
|
+
: pageCommon?.imageMapping?.[item.config.type]?.url || item.config.image?.url
|
|
41
43
|
}
|
|
42
44
|
className="h-full w-auto [&_img]:h-full [&_img]:w-auto [&_img]:object-contain"
|
|
43
45
|
></Picture>
|
|
@@ -60,7 +62,7 @@ export const Init = ({ copy, item, loading, disabled, setStatus }: InitProps) =>
|
|
|
60
62
|
as="p"
|
|
61
63
|
className={classNames(' text-center text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]')}
|
|
62
64
|
>
|
|
63
|
-
{numberFormat(item.alpc?.consumeCredits)} {
|
|
65
|
+
{numberFormat(item.alpc?.consumeCredits)} {pageCommon?.pointUnit}
|
|
64
66
|
</Text>
|
|
65
67
|
</div>
|
|
66
68
|
<div className="mt-[16px] w-full text-[14px] font-semibold text-[#777] md:mt-[12px]">
|
|
@@ -2,8 +2,10 @@ import { Text } from '@anker-in/headless-ui'
|
|
|
2
2
|
import { RedeemableItem } from '../../type'
|
|
3
3
|
import { CreditsRedeemListCopy } from '../type'
|
|
4
4
|
import { ConsumeType } from '../../context/const'
|
|
5
|
+
import { useCreditsContext } from '../../context/provider'
|
|
5
6
|
|
|
6
7
|
export const NoneProductValue = ({ item, copy }: { item: RedeemableItem; copy: CreditsRedeemListCopy }) => {
|
|
8
|
+
const { pageCommon } = useCreditsContext()
|
|
7
9
|
// shipping coupon 仅展示文案
|
|
8
10
|
if (item.config?.type === ConsumeType.ShippingCoupon) {
|
|
9
11
|
return <Text className="text-[24px] w-[70%] font-bold leading-none" html={item.config?.value} as="p" />
|
|
@@ -13,7 +15,7 @@ export const NoneProductValue = ({ item, copy }: { item: RedeemableItem; copy: C
|
|
|
13
15
|
<Text className="text-[64px] font-extrabold leading-none" html={item.config.value.toString()} />
|
|
14
16
|
<Text
|
|
15
17
|
className="text-[24px] font-bold leading-[2]"
|
|
16
|
-
html={item.config.type === ConsumeType.Coupon ?
|
|
18
|
+
html={item.config.type === ConsumeType.Coupon ? pageCommon?.off : pageCommon?.giftCardLabel}
|
|
17
19
|
/>
|
|
18
20
|
</div>
|
|
19
21
|
) : (
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Picture } from '@anker-in/headless-ui'
|
|
1
|
+
import { Picture, Text } from '@anker-in/headless-ui'
|
|
2
2
|
import { formatPrice } from '../../context/utils'
|
|
3
3
|
import type { RedeemableItem as RedeemableItemType } from '../../type'
|
|
4
4
|
import { CreditsRedeemListCopy } from '../type'
|
|
5
5
|
import { useHeadlessContext } from '@anker-in/lib'
|
|
6
|
+
import { useCreditsContext } from '../../context/provider'
|
|
6
7
|
|
|
7
8
|
type ProductInfoProps = {
|
|
8
9
|
item: RedeemableItemType
|
|
@@ -11,6 +12,7 @@ type ProductInfoProps = {
|
|
|
11
12
|
|
|
12
13
|
export const ProductInfo = ({ item, copy }: ProductInfoProps) => {
|
|
13
14
|
const { locale } = useHeadlessContext()
|
|
15
|
+
const { pageCommon } = useCreditsContext()
|
|
14
16
|
|
|
15
17
|
return (
|
|
16
18
|
<div className="flex w-full items-center justify-center md:items-start md:justify-start">
|
|
@@ -32,9 +34,11 @@ export const ProductInfo = ({ item, copy }: ProductInfoProps) => {
|
|
|
32
34
|
</div>
|
|
33
35
|
|
|
34
36
|
<div className="mt-[16px] md:mt-[12px]">
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
<Text
|
|
38
|
+
className="mb-[12px] line-clamp-1 text-[16px] font-bold l:!hidden"
|
|
39
|
+
html={item.product.title}
|
|
40
|
+
title={item.product.title}
|
|
41
|
+
></Text>
|
|
38
42
|
<div className="flex font-semibold leading-[1.4] md:flex-col">
|
|
39
43
|
<div className="mr-[40px] text-[15px] font-bold text-[#777] md:mr-0 md:text-[12px]">
|
|
40
44
|
<div className="mb-[8px] flex items-center md:mb-[4px]">
|
|
@@ -60,7 +64,7 @@ export const ProductInfo = ({ item, copy }: ProductInfoProps) => {
|
|
|
60
64
|
<div className="l:flex l:items-center l:justify-between">
|
|
61
65
|
<span>{copy.redeemModal.product.totalPriceLabel}: </span>
|
|
62
66
|
<span className="ml-1">
|
|
63
|
-
{item.alpc?.consumeCredits} {
|
|
67
|
+
{item.alpc?.consumeCredits} {pageCommon?.pointUnit}
|
|
64
68
|
</span>
|
|
65
69
|
</div>
|
|
66
70
|
</div>
|
|
@@ -3,6 +3,7 @@ import classNames from 'classnames'
|
|
|
3
3
|
import type { RedeemableItem as RedeemableItemType } from '../../type'
|
|
4
4
|
import { CreditsRedeemListCopy } from '../type'
|
|
5
5
|
import { ProductInfo } from './ProductInfo'
|
|
6
|
+
import { useHeadlessContext, ROUNDED_BRANDS } from '@anker-in/lib'
|
|
6
7
|
|
|
7
8
|
type SuccessProps = {
|
|
8
9
|
copy: CreditsRedeemListCopy
|
|
@@ -15,6 +16,8 @@ type SuccessProps = {
|
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export const Success = ({ copy, shippingProduct, loading, address, disabled, onClose, item }: SuccessProps) => {
|
|
19
|
+
const { brand } = useHeadlessContext()
|
|
20
|
+
const rounded = ROUNDED_BRANDS.includes(brand)
|
|
18
21
|
return (
|
|
19
22
|
<div className={classNames('max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]')}>
|
|
20
23
|
<div className="flex flex-col items-center">
|
|
@@ -26,7 +29,7 @@ export const Success = ({ copy, shippingProduct, loading, address, disabled, onC
|
|
|
26
29
|
|
|
27
30
|
{shippingProduct && <Text className="mb-5 text-[16px] font-bold" html={shippingProduct}></Text>}
|
|
28
31
|
|
|
29
|
-
<div className=
|
|
32
|
+
<div className={classNames('flex w-full items-center bg-[#F5F5F7] p-[16px]', !rounded && 'rounded-none')}>
|
|
30
33
|
<ProductInfo item={item} copy={copy} />
|
|
31
34
|
</div>
|
|
32
35
|
|
|
@@ -25,7 +25,7 @@ function RedeemProductModal({ item, copy, onError, ...props }: RedeemProductModa
|
|
|
25
25
|
const { fetchCreditInfo, profile } = useCreditsContext()
|
|
26
26
|
const { storeDomain, locale } = useHeadlessContext()
|
|
27
27
|
|
|
28
|
-
const {
|
|
28
|
+
const { pageCommon } = useCreditsContext()
|
|
29
29
|
const { shippingAddress, shippingProduct } = copy.redeemModal.product
|
|
30
30
|
|
|
31
31
|
const [status, setStatus] = useState<'init' | 'address' | 'success' | 'error'>('init')
|
|
@@ -99,7 +99,7 @@ function RedeemProductModal({ item, copy, onError, ...props }: RedeemProductModa
|
|
|
99
99
|
|
|
100
100
|
const { validate: validateAddress, errors: validateErrors } = useAddressValidate({
|
|
101
101
|
address: address,
|
|
102
|
-
validatorInfo: validatorInfo,
|
|
102
|
+
validatorInfo: pageCommon?.validatorInfo,
|
|
103
103
|
formData: copy?.redeemModal.product.form?.flat() || [],
|
|
104
104
|
errorLabel: {
|
|
105
105
|
require: copy.redeemModal.product.required,
|
|
@@ -8,7 +8,7 @@ import type { RedeemableItem as RedeemableItemType } from '../type'
|
|
|
8
8
|
import { AlpcConsumeType, ConsumeType } from '../context/const'
|
|
9
9
|
import { numberFormat } from '../context/utils'
|
|
10
10
|
import type { CreditsRedeemListCopy } from './type'
|
|
11
|
-
import { gaTrack } from '
|
|
11
|
+
import { gaTrack, useHeadlessContext, ROUNDED_BRANDS } from '@anker-in/lib'
|
|
12
12
|
import { NoneProductValue } from './NonProductValue'
|
|
13
13
|
|
|
14
14
|
export function RedeemableItem({
|
|
@@ -28,8 +28,11 @@ export function RedeemableItem({
|
|
|
28
28
|
creditInfo,
|
|
29
29
|
profile,
|
|
30
30
|
gtm: { pageGroup },
|
|
31
|
+
pageCommon,
|
|
31
32
|
} = useCreditsContext()
|
|
33
|
+
const { brand } = useHeadlessContext()
|
|
32
34
|
const isLogin = Object.keys(profile || {}).length > 0
|
|
35
|
+
const rounded = ROUNDED_BRANDS.includes(brand)
|
|
33
36
|
|
|
34
37
|
const isDisabled = useMemo(() => {
|
|
35
38
|
if (item.alpc?.remainingInventory <= 0 && item.alpc?.isLimited) {
|
|
@@ -64,7 +67,7 @@ export function RedeemableItem({
|
|
|
64
67
|
|
|
65
68
|
// 缺货文案
|
|
66
69
|
if (item.alpc?.consumeType === AlpcConsumeType.Product) {
|
|
67
|
-
return item.variant?.availableForSale ? copy.btnRedeem :
|
|
70
|
+
return item.variant?.availableForSale ? copy.btnRedeem : pageCommon?.soldOut || 'Sold Out'
|
|
68
71
|
}
|
|
69
72
|
return copy.btnRedeem
|
|
70
73
|
}, [
|
|
@@ -73,13 +76,14 @@ export function RedeemableItem({
|
|
|
73
76
|
item.variant?.availableForSale,
|
|
74
77
|
copy.btnRedeem,
|
|
75
78
|
copy.unlockRewards,
|
|
76
|
-
|
|
79
|
+
pageCommon?.soldOut,
|
|
77
80
|
])
|
|
78
81
|
|
|
79
82
|
return (
|
|
80
83
|
<div
|
|
81
84
|
className={classNames(
|
|
82
85
|
'flex flex-col items-center rounded-[16px] bg-[#EAEAEC] p-[24px] md:rounded-[12px] md:px-[8px] xl:py-[16px] md-xl:px-[16px]',
|
|
86
|
+
!rounded && 'rounded-none md:rounded-none',
|
|
83
87
|
className
|
|
84
88
|
)}
|
|
85
89
|
>
|
|
@@ -93,11 +97,11 @@ export function RedeemableItem({
|
|
|
93
97
|
) : (
|
|
94
98
|
<div className="relative mx-auto my-[30px] h-[164px] md:my-0 md:h-[66px] l-xxl:h-[138px] md-l:h-[80px]">
|
|
95
99
|
<Picture
|
|
96
|
-
source={
|
|
100
|
+
source={pageCommon?.imageMapping?.[item.config?.type]?.url}
|
|
97
101
|
className="h-full [&_img]:h-full [&_img]:w-auto [&_img]:object-contain"
|
|
98
102
|
></Picture>
|
|
99
103
|
|
|
100
|
-
<NoneProductValue item={item}
|
|
104
|
+
<NoneProductValue item={item} />
|
|
101
105
|
</div>
|
|
102
106
|
)}
|
|
103
107
|
<div className={classNames('mt-[22px] flex w-full flex-1 flex-col justify-between')}>
|
|
@@ -119,7 +123,7 @@ export function RedeemableItem({
|
|
|
119
123
|
event_parameters: {
|
|
120
124
|
page_group: pageGroup,
|
|
121
125
|
position: copy.title,
|
|
122
|
-
button_name:
|
|
126
|
+
button_name: pageCommon?.ruleLabel,
|
|
123
127
|
info: item.alpc?.id?.toString(),
|
|
124
128
|
},
|
|
125
129
|
})
|
|
@@ -132,7 +136,7 @@ export function RedeemableItem({
|
|
|
132
136
|
}
|
|
133
137
|
}}
|
|
134
138
|
>
|
|
135
|
-
{
|
|
139
|
+
{pageCommon?.ruleLabel}
|
|
136
140
|
</button>
|
|
137
141
|
)}
|
|
138
142
|
<div>
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { CreditsPageCommon } from '../type'
|
|
2
|
-
|
|
3
1
|
export type CreditsRedeemListCopy = {
|
|
4
2
|
title: string
|
|
5
|
-
giftCardLabel: string
|
|
6
3
|
unlockRewards: string
|
|
7
4
|
btnRedeem: string
|
|
8
5
|
list: {
|
|
@@ -14,15 +11,6 @@ export type CreditsRedeemListCopy = {
|
|
|
14
11
|
rules: string[]
|
|
15
12
|
}[]
|
|
16
13
|
}[]
|
|
17
|
-
validatorInfo: {
|
|
18
|
-
addressInfo: {
|
|
19
|
-
name: string
|
|
20
|
-
country: string
|
|
21
|
-
province: string
|
|
22
|
-
city: string
|
|
23
|
-
address: string
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
14
|
redeemModal: {
|
|
27
15
|
confirmTitle: string
|
|
28
16
|
confirmButton: string
|
|
@@ -72,7 +60,4 @@ export type CreditsRedeemListCopy = {
|
|
|
72
60
|
stepTitle: string
|
|
73
61
|
}
|
|
74
62
|
}
|
|
75
|
-
|
|
76
|
-
off: string
|
|
77
|
-
copy: string
|
|
78
|
-
} & CreditsPageCommon
|
|
63
|
+
}
|
package/src/components/credits/creditsWaysToGetCredits/{index.tsx → CreditsWaysToGetCredits.tsx}
RENAMED
|
@@ -6,21 +6,35 @@ import { useMemo, useState } from 'react'
|
|
|
6
6
|
import { TaskType, type CreditsWaysToGetCreditsProps } from './type'
|
|
7
7
|
import { useActions } from './useActions'
|
|
8
8
|
import { useCreditsContext } from '../context/provider'
|
|
9
|
-
import { cn } from '
|
|
9
|
+
import { classNames as cn, useHeadlessContext, ROUNDED_BRANDS } from '@anker-in/lib'
|
|
10
|
+
import { useRegistration } from '../../registration'
|
|
11
|
+
import { CreditsUploadReceiptModal } from '../modal/creditsUploadReceiptModal'
|
|
12
|
+
import { CreditsSubscribeModal } from '../modal/subscribeModal'
|
|
10
13
|
|
|
11
|
-
export const CreditsWaysToGetCredits = ({
|
|
12
|
-
copy,
|
|
13
|
-
activate,
|
|
14
|
-
subscribe,
|
|
15
|
-
uploadReceipt,
|
|
16
|
-
classNames,
|
|
17
|
-
}: CreditsWaysToGetCreditsProps) => {
|
|
14
|
+
export const CreditsWaysToGetCredits = ({ copy, classNames }: CreditsWaysToGetCreditsProps) => {
|
|
18
15
|
const [showMore, setShowMore] = useState(false)
|
|
19
16
|
const { profile } = useCreditsContext()
|
|
17
|
+
const { authCodeActivate } = useRegistration()
|
|
18
|
+
const { brand } = useHeadlessContext()
|
|
19
|
+
const rounded = ROUNDED_BRANDS.includes(brand)
|
|
20
20
|
const isLogin = !!profile
|
|
21
21
|
|
|
22
|
-
const
|
|
22
|
+
const [isUploadReceiptModalOpen, setIsUploadReceiptModalOpen] = useState(false)
|
|
23
|
+
const [isSubscribeModalOpen, setIsSubscribeModalOpen] = useState(false)
|
|
24
|
+
const [isSubscribeSuccess, setIsSubscribeSuccess] = useState(false)
|
|
25
|
+
const [isUploadReceiptSuccess, setIsUploadReceiptSuccess] = useState(false)
|
|
23
26
|
|
|
27
|
+
const { actions } = useActions({
|
|
28
|
+
copy,
|
|
29
|
+
subscribe: {
|
|
30
|
+
openSubscribePopup: () => setIsSubscribeModalOpen(true),
|
|
31
|
+
isSuccess: isSubscribeSuccess,
|
|
32
|
+
},
|
|
33
|
+
uploadReceipt: {
|
|
34
|
+
openUploadReceiptPopup: () => setIsUploadReceiptModalOpen(true),
|
|
35
|
+
isSuccess: isUploadReceiptSuccess,
|
|
36
|
+
},
|
|
37
|
+
})
|
|
24
38
|
const list = useMemo(() => {
|
|
25
39
|
const list = copy.list
|
|
26
40
|
.map(item => {
|
|
@@ -78,7 +92,12 @@ export const CreditsWaysToGetCredits = ({
|
|
|
78
92
|
|
|
79
93
|
return (
|
|
80
94
|
<Container id="ways-to-get-credits" className=" bg-[#F5F5F7] [&>div]:l:!px-0">
|
|
81
|
-
<div
|
|
95
|
+
<div
|
|
96
|
+
className={cn(
|
|
97
|
+
'rounded-[16px] bg-[#1D1D1F] py-[64px] px-[140px] text-white md:px-[16px] l:rounded-none md-l:px-[32px] l-xl:px-[77px]',
|
|
98
|
+
!rounded && 'rounded-none'
|
|
99
|
+
)}
|
|
100
|
+
>
|
|
82
101
|
<Heading as="h2" size={4} html={copy?.title} className="text-center l:pl-[16px] l:text-left" />
|
|
83
102
|
<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]">
|
|
84
103
|
<div className="pl-[16px] l:mt-[40px] desktop:pl-[24px] lg-desktop:pl-[32px]">
|
|
@@ -86,7 +105,7 @@ export const CreditsWaysToGetCredits = ({
|
|
|
86
105
|
<div className="mt-[8px] flex items-center">
|
|
87
106
|
{copy.creditsIcon?.url && (
|
|
88
107
|
<Picture
|
|
89
|
-
className="size-[48px] mr-[8px] stroke-brand xl:size-[30px] [&_path]:stroke-brand"
|
|
108
|
+
className="size-[48px] mr-[8px] stroke-brand-0 xl:size-[30px] [&_path]:stroke-brand-0"
|
|
90
109
|
source={copy.creditsIcon.url}
|
|
91
110
|
alt={copy.creditsIcon.alt || 'credits'}
|
|
92
111
|
/>
|
|
@@ -122,7 +141,10 @@ export const CreditsWaysToGetCredits = ({
|
|
|
122
141
|
{list.map(item => (
|
|
123
142
|
<div
|
|
124
143
|
key={item.id}
|
|
125
|
-
className=
|
|
144
|
+
className={cn(
|
|
145
|
+
'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]',
|
|
146
|
+
!rounded && 'rounded-none'
|
|
147
|
+
)}
|
|
126
148
|
>
|
|
127
149
|
<div>
|
|
128
150
|
<Heading as="h4" html={item.title} size={2} className="text-pretty" />
|
|
@@ -136,9 +158,9 @@ export const CreditsWaysToGetCredits = ({
|
|
|
136
158
|
</div>
|
|
137
159
|
|
|
138
160
|
{item.handleClick &&
|
|
139
|
-
!(item.id === TaskType.UploadReceipt &&
|
|
140
|
-
!(item.id === TaskType.Activate &&
|
|
141
|
-
!(item.id === TaskType.Subscribe &&
|
|
161
|
+
!(item.id === TaskType.UploadReceipt && isUploadReceiptSuccess) &&
|
|
162
|
+
!(item.id === TaskType.Activate && authCodeActivate.isActivateSuccess) &&
|
|
163
|
+
!(item.id === TaskType.Subscribe && isSubscribeSuccess) ? (
|
|
142
164
|
<Button
|
|
143
165
|
as={item.link ? 'a' : 'button'}
|
|
144
166
|
{...(item.link && { href: item.link })}
|
|
@@ -159,7 +181,7 @@ export const CreditsWaysToGetCredits = ({
|
|
|
159
181
|
{!showMore && (
|
|
160
182
|
<div
|
|
161
183
|
className="absolute inset-0 pointer-events-none min-md:hidden"
|
|
162
|
-
style={{ background: 'linear-gradient(180deg, rgba(29, 29, 31, 0) 66.37%, #1D1D1F 100%' }}
|
|
184
|
+
style={{ background: 'linear-gradient(180deg, rgba(29, 29, 31, 0) 66.37%, #1D1D1F 100%)' }}
|
|
163
185
|
></div>
|
|
164
186
|
)}
|
|
165
187
|
</motion.div>
|
|
@@ -183,6 +205,33 @@ export const CreditsWaysToGetCredits = ({
|
|
|
183
205
|
)}
|
|
184
206
|
</div>
|
|
185
207
|
</div>
|
|
208
|
+
{copy.receipt && (
|
|
209
|
+
<CreditsUploadReceiptModal
|
|
210
|
+
isOpen={isUploadReceiptModalOpen}
|
|
211
|
+
onClose={() => {
|
|
212
|
+
setIsUploadReceiptModalOpen(false)
|
|
213
|
+
}}
|
|
214
|
+
copy={copy.receipt}
|
|
215
|
+
onSuccess={() => {
|
|
216
|
+
setIsUploadReceiptSuccess(true)
|
|
217
|
+
}}
|
|
218
|
+
/>
|
|
219
|
+
)}
|
|
220
|
+
{copy.subscribe && (
|
|
221
|
+
<CreditsSubscribeModal
|
|
222
|
+
copy={copy.subscribe}
|
|
223
|
+
onSuccess={() => {
|
|
224
|
+
setIsSubscribeSuccess(true)
|
|
225
|
+
setTimeout(() => {
|
|
226
|
+
setIsSubscribeModalOpen(false)
|
|
227
|
+
}, 3000)
|
|
228
|
+
}}
|
|
229
|
+
isOpen={isSubscribeModalOpen}
|
|
230
|
+
onClose={() => {
|
|
231
|
+
setIsSubscribeModalOpen(false)
|
|
232
|
+
}}
|
|
233
|
+
/>
|
|
234
|
+
)}
|
|
186
235
|
</Container>
|
|
187
236
|
)
|
|
188
237
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReceiptCopy } from '../modal/creditsUploadReceiptModal'
|
|
2
|
+
import type { CreditsSubscribeModalCopy } from '../modal/subscribeModal'
|
|
2
3
|
|
|
3
4
|
export type BenefitItem = {
|
|
4
5
|
title: string
|
|
@@ -6,7 +7,7 @@ export type BenefitItem = {
|
|
|
6
7
|
id: string
|
|
7
8
|
}
|
|
8
9
|
|
|
9
|
-
export type
|
|
10
|
+
export type CreditsWaysToGetCreditsCopy = {
|
|
10
11
|
title: string
|
|
11
12
|
subtitle: string
|
|
12
13
|
equalCredits: string
|
|
@@ -24,13 +25,14 @@ export type WaysToGetCreditsCopy = {
|
|
|
24
25
|
goShopLink: string
|
|
25
26
|
uploadReceipt: string
|
|
26
27
|
shopNow: string
|
|
27
|
-
|
|
28
|
+
subscribeLabel: string
|
|
28
29
|
sendEmailSuccess: string
|
|
29
30
|
creditsIcon: {
|
|
30
31
|
url: string
|
|
31
32
|
alt: string
|
|
32
33
|
}
|
|
33
34
|
receipt: ReceiptCopy
|
|
35
|
+
subscribe: CreditsSubscribeModalCopy
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
export enum TaskType {
|
|
@@ -43,21 +45,9 @@ export enum TaskType {
|
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
export type CreditsWaysToGetCreditsProps = {
|
|
46
|
-
copy:
|
|
48
|
+
copy: CreditsWaysToGetCreditsCopy
|
|
47
49
|
classNames?: {
|
|
48
50
|
equalCreditsText?: string
|
|
49
51
|
subtitle?: string
|
|
50
52
|
}
|
|
51
|
-
activate: {
|
|
52
|
-
openAuthCodePopup: () => void
|
|
53
|
-
isSuccess: boolean
|
|
54
|
-
}
|
|
55
|
-
subscribe: {
|
|
56
|
-
openSubscribePopup: () => void
|
|
57
|
-
isSuccess: boolean
|
|
58
|
-
}
|
|
59
|
-
uploadReceipt: {
|
|
60
|
-
openUploadReceiptPopup: () => void
|
|
61
|
-
isSuccess: boolean
|
|
62
|
-
}
|
|
63
53
|
}
|
|
@@ -1,25 +1,36 @@
|
|
|
1
|
+
import { useHeadlessContext, gaTrack } from '@anker-in/lib'
|
|
2
|
+
|
|
1
3
|
import { TaskType } from './type'
|
|
2
4
|
import { useCreditsContext } from '../context/provider'
|
|
3
5
|
import { useMemo } from 'react'
|
|
4
6
|
import useReceiptUploaded from '../context/hooks/useReceiptUploaded'
|
|
5
7
|
import { useFirstPurchaseFinished } from '../context/hooks/useFirstPurchaseFinished'
|
|
6
8
|
import { useSubscribed } from '../context/hooks/useSubscribed'
|
|
7
|
-
import type {
|
|
8
|
-
|
|
9
|
-
import {
|
|
9
|
+
import type { CreditsWaysToGetCreditsCopy } from './type'
|
|
10
|
+
|
|
11
|
+
import { useRegistration } from '../../registration'
|
|
10
12
|
|
|
11
13
|
export const useActions = ({
|
|
12
14
|
copy,
|
|
13
15
|
subscribe,
|
|
14
16
|
uploadReceipt,
|
|
15
|
-
activate,
|
|
16
17
|
gaParameters,
|
|
17
|
-
}:
|
|
18
|
+
}: {
|
|
19
|
+
copy: CreditsWaysToGetCreditsCopy
|
|
20
|
+
subscribe: {
|
|
21
|
+
openSubscribePopup: () => void
|
|
22
|
+
isSuccess: boolean
|
|
23
|
+
}
|
|
24
|
+
uploadReceipt: {
|
|
25
|
+
openUploadReceiptPopup: () => void
|
|
26
|
+
isSuccess: boolean
|
|
27
|
+
}
|
|
18
28
|
gaParameters?: {
|
|
19
29
|
position: string
|
|
20
30
|
}
|
|
21
31
|
}) => {
|
|
22
32
|
const { openSignUpPopup, gtm, profile } = useCreditsContext()
|
|
33
|
+
const { authCodeActivate } = useRegistration()
|
|
23
34
|
const isSubscribed = useSubscribed()
|
|
24
35
|
const firstPurchaseFinished = useFirstPurchaseFinished()
|
|
25
36
|
const uploadedReceipt = useReceiptUploaded()
|
|
@@ -66,7 +77,10 @@ export const useActions = ({
|
|
|
66
77
|
handleClick: () =>
|
|
67
78
|
handleClickWithTrack({
|
|
68
79
|
buttonName: copy?.activate,
|
|
69
|
-
callback: () =>
|
|
80
|
+
callback: () => {
|
|
81
|
+
authCodeActivate.setAutoSendEmail(true)
|
|
82
|
+
authCodeActivate.open()
|
|
83
|
+
},
|
|
70
84
|
id: TaskType.Activate,
|
|
71
85
|
}),
|
|
72
86
|
},
|
|
@@ -82,10 +96,10 @@ export const useActions = ({
|
|
|
82
96
|
handleClickWithTrack({ buttonName: copy?.joinNow, callback: openSignUpPopup, id: TaskType.Subscribe }),
|
|
83
97
|
},
|
|
84
98
|
notFinished: {
|
|
85
|
-
buttonLabel: copy?.
|
|
99
|
+
buttonLabel: copy?.subscribeLabel,
|
|
86
100
|
handleClick: () =>
|
|
87
101
|
handleClickWithTrack({
|
|
88
|
-
buttonName: copy?.
|
|
102
|
+
buttonName: copy?.subscribeLabel,
|
|
89
103
|
callback: () => subscribe.openSubscribePopup(),
|
|
90
104
|
id: TaskType.Subscribe,
|
|
91
105
|
}),
|
|
@@ -9,6 +9,7 @@ import { CreditsModalContainer, type ModalContainerProps } from './modalContaine
|
|
|
9
9
|
import Tip from './tip'
|
|
10
10
|
import LoadingDots from './loadingDots'
|
|
11
11
|
import useMyRewards from '../context/hooks/useMyRewards'
|
|
12
|
+
import { useHeadlessContext, ROUNDED_BRANDS } from '@anker-in/lib'
|
|
12
13
|
|
|
13
14
|
export interface MyRewardsMetafields {
|
|
14
15
|
title: string
|
|
@@ -42,6 +43,8 @@ interface MyRewardsModalProps extends ModalContainerProps {
|
|
|
42
43
|
|
|
43
44
|
function MyRewardsModal({ data, ...props }: MyRewardsModalProps) {
|
|
44
45
|
const [activeTab, setActiveTab] = useState(AlpcConsumeType.Coupon)
|
|
46
|
+
const { brand } = useHeadlessContext()
|
|
47
|
+
const rounded = ROUNDED_BRANDS.includes(brand)
|
|
45
48
|
|
|
46
49
|
const [couponPage, setCouponPage] = useState(1)
|
|
47
50
|
const [productPage, setProductPage] = useState(1)
|
|
@@ -224,7 +227,7 @@ function MyRewardsModal({ data, ...props }: MyRewardsModalProps) {
|
|
|
224
227
|
<div className="">
|
|
225
228
|
<Tabs
|
|
226
229
|
align="left"
|
|
227
|
-
shape=
|
|
230
|
+
shape={rounded ? 'rounded' : 'square'}
|
|
228
231
|
value={activeTab.toString()}
|
|
229
232
|
onValueChange={value => {
|
|
230
233
|
setActiveTab(Number(value))
|
|
@@ -257,7 +260,12 @@ function MyRewardsModal({ data, ...props }: MyRewardsModalProps) {
|
|
|
257
260
|
{data.orderNumberLabel}: {item.orderNumber}
|
|
258
261
|
</div>
|
|
259
262
|
)}
|
|
260
|
-
<div
|
|
263
|
+
<div
|
|
264
|
+
className={classNames(
|
|
265
|
+
'flex items-center justify-between rounded-[8px] bg-[#f7f8f9] px-[16px] py-[20px]',
|
|
266
|
+
!rounded && 'rounded-none'
|
|
267
|
+
)}
|
|
268
|
+
>
|
|
261
269
|
<div className="grid gap-[4px]">
|
|
262
270
|
<div className="text-[16px] font-bold leading-[1.4]">{item.title}</div>
|
|
263
271
|
<div className="text-[14px] font-semibold text-[#999]">
|
|
@@ -267,7 +275,7 @@ function MyRewardsModal({ data, ...props }: MyRewardsModalProps) {
|
|
|
267
275
|
{item?.couponCode ? `${data?.code || 'Code'}: ${item.couponCode} ` : ''}
|
|
268
276
|
{item?.couponCode && (
|
|
269
277
|
<span
|
|
270
|
-
className="cursor-pointer text-[14px] font-semibold text-brand underline"
|
|
278
|
+
className="cursor-pointer text-[14px] font-semibold text-brand-0 underline"
|
|
271
279
|
onClick={() => {
|
|
272
280
|
handleCopy(item.couponCode, index)
|
|
273
281
|
}}
|