@anker-in/campaign-ui 0.2.10-beta.12 → 0.2.10-beta.13
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/suggestions.d.ts +1 -1
- package/dist/cjs/components/credits/context/hooks/useActivities.d.ts +1 -1
- package/dist/cjs/components/credits/context/hooks/useAddressValidate.d.ts +6 -3
- package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.d.ts +2 -2
- package/dist/cjs/components/credits/context/response.d.ts +1 -1
- package/dist/cjs/components/credits/creditsCash/type.d.ts +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.d.ts +1 -26
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.d.ts +2 -26
- package/dist/cjs/components/credits/creditsWaysToGetCredits/index.d.ts +2 -18
- package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.d.ts +1 -1
- package/dist/cjs/components/credits/index.d.ts +9 -9
- package/dist/cjs/components/credits/modal/MyRewardsModal.d.ts +4 -1
- package/dist/cjs/components/credits/modal/MyRewardsModal.js +1 -1
- package/dist/cjs/components/credits/modal/MyRewardsModal.js.map +2 -2
- package/dist/cjs/components/credits/modal/activitiesModal.d.ts +5 -2
- package/dist/cjs/components/credits/type.d.ts +11 -1
- package/dist/cjs/components/index.d.ts +3 -3
- package/dist/cjs/helpers/track.d.ts +4 -0
- package/dist/cjs/index.css +3 -3
- package/dist/cjs/index.css.map +1 -1
- package/dist/cjs/index.d.ts +2 -7
- package/dist/cjs/index.js +67721 -1
- package/dist/cjs/index.js.map +4 -4
- package/dist/cjs/stories/chat.stories.d.ts +1 -1
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/components/chat/button.d.ts +1 -1
- package/dist/esm/components/chat/suggestions.d.ts +1 -1
- package/dist/esm/components/credits/context/hooks/useActivities.d.ts +1 -1
- package/dist/esm/components/credits/context/hooks/useAddressValidate.d.ts +6 -3
- package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.d.ts +2 -2
- package/dist/esm/components/credits/context/response.d.ts +1 -1
- package/dist/esm/components/credits/creditsCash/type.d.ts +1 -1
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.d.ts +1 -26
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.d.ts +2 -26
- package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.d.ts +21 -21
- package/dist/esm/components/credits/index.d.ts +9 -9
- package/dist/esm/components/credits/modal/MyRewardsModal.d.ts +4 -1
- package/dist/esm/components/credits/modal/MyRewardsModal.js +1 -1
- package/dist/esm/components/credits/modal/MyRewardsModal.js.map +2 -2
- package/dist/esm/components/credits/modal/activitiesModal.d.ts +5 -2
- package/dist/esm/components/credits/modal/rulesModal.d.ts +1 -1
- package/dist/esm/components/credits/type.d.ts +11 -1
- package/dist/esm/helpers/index.d.ts +2 -2
- package/dist/esm/helpers/track.d.ts +4 -0
- package/dist/esm/index.css +3 -3
- package/dist/esm/index.css.map +1 -1
- package/dist/esm/index.d.ts +2 -7
- package/dist/esm/index.js +67715 -1
- package/dist/esm/index.js.map +4 -4
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/components/credits/creditsInfoCard/index.tsx +2 -1
- package/src/components/credits/modal/MyRewardsModal.tsx +10 -2
- package/src/components/credits/modal/activitiesModal.tsx +9 -2
- package/src/helpers/track.ts +12 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anker-in/campaign-ui",
|
|
3
|
-
"version": "0.2.10-beta.
|
|
3
|
+
"version": "0.2.10-beta.13",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"types": "./dist/cjs/index.d.ts",
|
|
@@ -84,8 +84,8 @@
|
|
|
84
84
|
"react-codepen-embed": "^1.1.0",
|
|
85
85
|
"tailwind-merge": "^2.3.0",
|
|
86
86
|
"tailwindcss": "^3.4.3",
|
|
87
|
-
"@anker-in/
|
|
88
|
-
"@anker-in/
|
|
87
|
+
"@anker-in/headless-ui": "1.0.19",
|
|
88
|
+
"@anker-in/shopify": "^0.0.0-beta.4"
|
|
89
89
|
},
|
|
90
90
|
"peerDependencies": {
|
|
91
91
|
"react": "^18.3.1",
|
|
@@ -7,6 +7,7 @@ import { numberFormat } from '../context/utils'
|
|
|
7
7
|
import ActivitiesModal from '../modal/activitiesModal'
|
|
8
8
|
import MyRewardsModal, { type MyRewardsMetafields } from '../modal/MyRewardsModal'
|
|
9
9
|
import { type MyActivitiesMetafields } from '../modal/activitiesModal'
|
|
10
|
+
import { gaNormalClick } from '@utils/track'
|
|
10
11
|
|
|
11
12
|
type ButtonConfig = {
|
|
12
13
|
text: string
|
|
@@ -30,7 +31,7 @@ export function CreditsInfoCard({ data }: InfoCardProps) {
|
|
|
30
31
|
const [hover, setHover] = useState<boolean>(false)
|
|
31
32
|
|
|
32
33
|
const handleButtonClick = useCallback((buttonConfig: ButtonConfig) => {
|
|
33
|
-
|
|
34
|
+
gaNormalClick({ position: 'info_card', label: buttonConfig.text })
|
|
34
35
|
|
|
35
36
|
if (buttonConfig.type) {
|
|
36
37
|
switch (buttonConfig.type) {
|
|
@@ -26,12 +26,15 @@ export interface MyRewardsMetafields {
|
|
|
26
26
|
pendingTip: string
|
|
27
27
|
processingTip: string
|
|
28
28
|
ShippedTip: string
|
|
29
|
-
emptyListImageUrl: string
|
|
30
29
|
emptyListLabel: string
|
|
31
30
|
pointUnit: string
|
|
32
31
|
code: string
|
|
33
32
|
copied: string
|
|
34
33
|
copy: string
|
|
34
|
+
emptyListImage: {
|
|
35
|
+
url: string
|
|
36
|
+
alt?: string
|
|
37
|
+
}
|
|
35
38
|
}
|
|
36
39
|
interface MyRewardsModalProps extends ModalContainerProps {
|
|
37
40
|
data: MyRewardsMetafields
|
|
@@ -39,6 +42,7 @@ interface MyRewardsModalProps extends ModalContainerProps {
|
|
|
39
42
|
|
|
40
43
|
function MyRewardsModal({ data, ...props }: MyRewardsModalProps) {
|
|
41
44
|
const [activeTab, setActiveTab] = useState(AlpcConsumeType.Coupon)
|
|
45
|
+
console.log('data123', data)
|
|
42
46
|
|
|
43
47
|
const [couponPage, setCouponPage] = useState(1)
|
|
44
48
|
const [productPage, setProductPage] = useState(1)
|
|
@@ -238,7 +242,11 @@ function MyRewardsModal({ data, ...props }: MyRewardsModalProps) {
|
|
|
238
242
|
<div className="mt-[24px] overflow-auto overscroll-contain px-[24px] md:px-[16px]">
|
|
239
243
|
{!list.length && !couponIsLoading && !productIsLoading && (
|
|
240
244
|
<div className="flex h-full flex-col items-center justify-center">
|
|
241
|
-
<Picture
|
|
245
|
+
<Picture
|
|
246
|
+
className="mb-[12px] w-[160px]"
|
|
247
|
+
source={data?.emptyListImage?.url}
|
|
248
|
+
alt={data?.emptyListImage?.alt || 'empty list image'}
|
|
249
|
+
></Picture>
|
|
242
250
|
<div className="text-[16px] font-semibold leading-[1.4]">{data?.emptyListLabel}</div>
|
|
243
251
|
</div>
|
|
244
252
|
)}
|
|
@@ -30,7 +30,10 @@ export interface MyActivitiesMetafields {
|
|
|
30
30
|
firstPurchaseTask: string
|
|
31
31
|
uploadReceiptTask: string
|
|
32
32
|
shoppingTask: string
|
|
33
|
-
|
|
33
|
+
emptyListImage: {
|
|
34
|
+
url: string
|
|
35
|
+
alt?: string
|
|
36
|
+
}
|
|
34
37
|
emptyListLabel: string
|
|
35
38
|
}
|
|
36
39
|
|
|
@@ -200,7 +203,11 @@ function ActivitiesModal({ data, ...props }: ActivitiesModalProps) {
|
|
|
200
203
|
)}
|
|
201
204
|
{!list.length && !isLoading && (
|
|
202
205
|
<div className="flex h-full flex-col items-center justify-center">
|
|
203
|
-
<Picture
|
|
206
|
+
<Picture
|
|
207
|
+
className="mb-[16px] h-[120px] w-[160px]"
|
|
208
|
+
source={data?.emptyListImage?.url}
|
|
209
|
+
alt={data?.emptyListImage?.alt || 'empty list image'}
|
|
210
|
+
></Picture>
|
|
204
211
|
<div className="leading-1.4 text-[16px] font-semibold">{data?.emptyListLabel}</div>
|
|
205
212
|
</div>
|
|
206
213
|
)}
|
package/src/helpers/track.ts
CHANGED
|
@@ -25,6 +25,18 @@ export const gaTrack = (data: any) => {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
export function gaNormalClick({ position, label }: { position: string; label: string }) {
|
|
29
|
+
gaTrack({
|
|
30
|
+
event: 'ga4Event',
|
|
31
|
+
event_name: 'lp_button',
|
|
32
|
+
event_parameters: {
|
|
33
|
+
page_group: 'soundcoreCredits Rewards Program',
|
|
34
|
+
position: position,
|
|
35
|
+
button_name: label,
|
|
36
|
+
},
|
|
37
|
+
})
|
|
38
|
+
}
|
|
39
|
+
|
|
28
40
|
// facebook 埋点
|
|
29
41
|
export const fbq = (...args: any[]) => {
|
|
30
42
|
if (window.fbq) {
|