1
1
import { Card } from '@blueprintjs/core'
2
2
3
+ import dayjs from 'dayjs'
3
4
import { useLinks } from 'hooks/useLinks'
4
5
import { ComponentType } from 'react'
6
+ import ReactGA from 'react-ga-neo'
5
7
6
8
import { CardTitle } from 'components/CardTitle'
7
9
import { withGlobalErrorBoundary } from 'components/GlobalErrorBoundary'
@@ -21,6 +23,7 @@ export const IndexPage: ComponentType = withGlobalErrorBoundary(() => {
21
23
const { SOCIAL_LINKS } = useLinks ( )
22
24
return (
23
25
< div className = "flex flex-col md:flex-row px-4 pb-16 mt-4 md:px-8 md:mt-8 max-w-[96rem] mx-auto" >
26
+ { isMD && < Ad /> }
24
27
< div className = "md:w-2/3 order-2 md:order-1 mr-0 md:mr-8 mt-4 md:mt-0" >
25
28
< Operations />
26
29
</ div >
@@ -59,6 +62,8 @@ export const IndexPage: ComponentType = withGlobalErrorBoundary(() => {
59
62
</ >
60
63
) ) }
61
64
</ div >
65
+
66
+ < Ad />
62
67
</ div >
63
68
</ div >
64
69
) }
@@ -67,3 +72,26 @@ export const IndexPage: ComponentType = withGlobalErrorBoundary(() => {
67
72
</ div >
68
73
)
69
74
} )
75
+
76
+ const Ad = dayjs ( ) . isBefore ( '2025-07-06 00:00:00+8' )
77
+ ? ( ) => {
78
+ const t = useTranslation ( )
79
+ const sendEvent = ( ) => {
80
+ ReactGA . event ( 'click_ad' , { ad_type : 'ld' } )
81
+ }
82
+ return (
83
+ // eslint-disable-next-line react/jsx-no-target-blank
84
+ < a
85
+ className = "block relative dark:brightness-[85%]"
86
+ href = "https://lddl01.ldmnq.com/downloader/ldplayerinst9.exe?n=LDplayer9_ld_406237_3586_ld.exe"
87
+ target = "_blank"
88
+ onClick = { sendEvent }
89
+ >
90
+ < img src = "/ad_leidian.webp" alt = "雷电模拟器" />
91
+ < div className = "absolute bottom-2 right-2 border border-current rounded text-[10px] text-zinc-300 px-1 " >
92
+ { t . pages . index . advertisement }
93
+ </ div >
94
+ </ a >
95
+ )
96
+ }
97
+ : ( ) => null
0 commit comments