Skip to content

Commit 82dc314

Browse files
committed
mod: change DZMM to AIEro
1 parent b41fa55 commit 82dc314

File tree

11 files changed

+100
-95
lines changed

11 files changed

+100
-95
lines changed

app/patch/[id]/resource/page.tsx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import { generateKunMetadataTemplate } from './metadata'
44
import { kunGetPatchActions } from '../actions'
55
import { kunGetActions } from './actions'
66
import { ErrorComponent } from '~/components/error/ErrorComponent'
7-
import { Image } from '@heroui/image'
8-
import { kunMoyuMoe } from '~/config/moyu-moe'
7+
import { AIEroBanner } from '~/components/kun/ad/AIEroBanner'
98
import type { Metadata } from 'next'
109

1110
export const revalidate = 5
@@ -67,15 +66,7 @@ export default async function Kun({
6766
</p>
6867
</div>
6968

70-
{(!response.payload || response.payload.role < 2) && (
71-
<Link target="_blank" href={kunMoyuMoe.ad[0].url}>
72-
<Image
73-
className="pointer-events-none select-none"
74-
src="/a/moyumoe1.avif"
75-
alt=""
76-
/>
77-
</Link>
78-
)}
69+
<AIEroBanner payload={response.payload} />
7970

8071
<Resources initialResources={response.response} id={Number(id)} />
8172
</div>

components/home/Container.tsx

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { CommentCard } from '~/components/comment/CommentCard'
77
import Link from 'next/link'
88
import { HomeHero } from './Hero'
99
import { kunMoyuMoe } from '~/config/moyu-moe'
10+
import { AIEroBanner } from '~/components/kun/ad/AIEroBanner'
1011
import type { HomeComment, HomeResource } from '~/types/api/home'
1112
import type { KunGalgamePayload } from '~/app/api/utils/jwt'
1213

@@ -27,22 +28,7 @@ export const HomeContainer = ({
2728
<div className="mx-auto space-y-8 max-w-7xl">
2829
<HomeHero />
2930

30-
{(!payload || payload.role < 2) && (
31-
<div className="shadow-xl rounded-2xl">
32-
<a
33-
target="_blank"
34-
className="h-full w-full"
35-
href={kunMoyuMoe.ad[0].url}
36-
rel="noreferrer"
37-
>
38-
<Image
39-
className="pointer-events-none select-none"
40-
src="/a/moyumoe1.avif"
41-
alt=""
42-
/>
43-
</a>
44-
</div>
45-
)}
31+
<AIEroBanner payload={payload} />
4632

4733
<section className="space-y-3 sm:space-y-6">
4834
<div className="flex items-center space-x-4">

components/kun/ad/AIEroBanner.tsx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { Image } from '@heroui/image'
2+
import { kunMoyuMoe } from '~/config/moyu-moe'
3+
import { cn } from '~/utils/cn'
4+
import type { KunGalgamePayload } from '~/app/api/utils/jwt'
5+
6+
interface Props {
7+
payload: KunGalgamePayload | null
8+
className?: string
9+
}
10+
11+
export const AIEroBanner = ({ payload, className = '' }: Props) => {
12+
return (
13+
<>
14+
{(!payload || payload.role < 2) && (
15+
<div className={cn('shadow-xl rounded-2xl', className)}>
16+
<a
17+
target="_blank"
18+
className="h-full w-full"
19+
href={kunMoyuMoe.ad[0].url}
20+
rel="noreferrer"
21+
>
22+
<Image
23+
className="pointer-events-none select-none"
24+
src="/a/moyumoe1.avif"
25+
alt=""
26+
/>
27+
</a>
28+
</div>
29+
)}
30+
</>
31+
)
32+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
'use client'
2+
3+
import { NavbarMenuItem } from '@heroui/navbar'
4+
import { kunMoyuMoe } from '~/config/moyu-moe'
5+
import { useUserStore } from '~/store/userStore'
6+
7+
export const AIEroMobileNav = () => {
8+
const currentUser = useUserStore((state) => state.user)
9+
10+
return (
11+
<>
12+
{(!currentUser.uid || currentUser.role < 2) && (
13+
<NavbarMenuItem>
14+
<a
15+
className="flex items-center gap-2"
16+
target="_blank"
17+
href={kunMoyuMoe.ad[0].url}
18+
rel="noreferrer"
19+
>
20+
<img
21+
src="/a/moyumoe1-button.avif"
22+
className="h-11 dark:opacity-80"
23+
alt=""
24+
/>
25+
</a>
26+
</NavbarMenuItem>
27+
)}
28+
</>
29+
)
30+
}

components/kun/ad/AIEroNav.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
'use client'
2+
3+
import { Tooltip } from '@heroui/react'
4+
import { kunMoyuMoe } from '~/config/moyu-moe'
5+
import { useUserStore } from '~/store/userStore'
6+
7+
export const AIEroNav = () => {
8+
const currentUser = useUserStore((state) => state.user)
9+
10+
return (
11+
<>
12+
{(!currentUser.uid || currentUser.role < 2) && (
13+
<Tooltip disableAnimation content="为什么现在的 AI 比人还要 H">
14+
<a target="_blank" href={kunMoyuMoe.ad[0].url} rel="noreferrer">
15+
<img
16+
className="h-10 dark:opacity-80"
17+
src="/a/moyumoe1-button.avif"
18+
alt=""
19+
/>
20+
</a>
21+
</Tooltip>
22+
)}
23+
</>
24+
)
25+
}

components/kun/top-bar/KunMobileMenu.tsx

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ import Image from 'next/image'
77
import { kunMoyuMoe } from '~/config/moyu-moe'
88
import { kunMobileNavItem } from '~/constants/top-bar'
99
import { Divider } from '@heroui/react'
10-
import { useUserStore } from '~/store/userStore'
10+
import { AIEroMobileNav } from '~/components/kun/ad/AIEroMobileNav'
1111

1212
export const KunMobileMenu = () => {
13-
const currentUser = useUserStore((state) => state.user)
14-
1513
return (
1614
<NavbarMenu>
1715
<NavbarMenuItem>
@@ -42,28 +40,7 @@ export const KunMobileMenu = () => {
4240

4341
<Divider className="my-3" />
4442

45-
{(!currentUser.uid || currentUser.role < 2) && (
46-
<NavbarMenuItem>
47-
<div className="space-y-2">
48-
<p>为什么现在的 AI 比人还要 H</p>
49-
<a
50-
className="flex items-center gap-2"
51-
target="_blank"
52-
href="https://s.iloveren.link/s/moyumoe1"
53-
rel="noreferrer"
54-
>
55-
<img
56-
src="/a/moyumoe1-button.avif"
57-
className="h-11 dark:opacity-80"
58-
alt=""
59-
/>
60-
<span className="gap-2 flex items-center text-lg text-secondary px-4 py-2 rounded-2xl bg-secondary/15">
61-
尝试一下 AI 女友
62-
</span>
63-
</a>
64-
</div>
65-
</NavbarMenuItem>
66-
)}
43+
<AIEroMobileNav />
6744
</NavbarMenu>
6845
)
6946
}

components/kun/top-bar/TopBar.tsx

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,10 @@ import {
2323
ChartColumnBig
2424
} from 'lucide-react'
2525
import { cn } from '~/utils/cn'
26-
import { kunMoyuMoe } from '~/config/moyu-moe'
27-
import { useUserStore } from '~/store/userStore'
26+
import { AIEroNav } from '~/components/kun/ad/AIEroNav'
2827

2928
export const KunTopBar = () => {
3029
const pathname = usePathname()
31-
const currentUser = useUserStore((state) => state.user)
3230

3331
const [isMenuOpen, setIsMenuOpen] = useState(false)
3432

@@ -131,17 +129,7 @@ export const KunTopBar = () => {
131129
</Link>
132130
))}
133131

134-
{(!currentUser.uid || currentUser.role < 2) && (
135-
<Tooltip disableAnimation content="为什么现在的 AI 比人还要 H">
136-
<a target="_blank" href={kunMoyuMoe.ad[0].url} rel="noreferrer">
137-
<img
138-
className="h-10 dark:opacity-80"
139-
src="/a/moyumoe1-button.avif"
140-
alt=""
141-
/>
142-
</a>
143-
</Tooltip>
144-
)}
132+
<AIEroNav />
145133
</div>
146134

147135
<KunTopBarUser />

components/resource/detail/ResourceDetail.tsx

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { ResourceLikeButton } from '~/components/patch/resource/ResourceLike'
1313
import { ResourceDownloadCard } from './DownloadCard'
1414
import { Link } from '@heroui/react'
1515
import { kunMoyuMoe } from '~/config/moyu-moe'
16+
import { AIEroBanner } from '~/components/kun/ad/AIEroBanner'
1617
import type { KunGalgamePayload } from '~/app/api/utils/jwt'
1718
import type { PatchResourceDetail } from '~/types/api/resource'
1819

@@ -28,22 +29,7 @@ export const KunResourceDetail = ({ detail, payload }: Props) => {
2829
<div className="space-y-6">
2930
<PatchSummary patch={detail.patch} />
3031

31-
{(!payload || payload.role < 2) && (
32-
<div className="shadow-xl rounded-2xl hidden sm:block">
33-
<a
34-
target="_blank"
35-
className="h-full w-full"
36-
href={kunMoyuMoe.ad[0].url}
37-
rel="noreferrer"
38-
>
39-
<Image
40-
className="pointer-events-none select-none"
41-
src="/a/moyumoe1.avif"
42-
alt=""
43-
/>
44-
</a>
45-
</div>
46-
)}
32+
<AIEroBanner className="hidden sm:block" payload={payload} />
4733

4834
<div className="grid gap-0 sm:gap-6 lg:grid-cols-3">
4935
<Card className="col-span-2 border-default-200 border bg-content1/90 shadow-lg backdrop-blur-sm dark:bg-content1/70">
@@ -104,17 +90,7 @@ export const KunResourceDetail = ({ detail, payload }: Props) => {
10490
)}
10591
</div>
10692

107-
{(!payload || payload.role < 2) && (
108-
<div className="shadow-xl rounded-2xl block sm:hidden">
109-
<a target="_blank" href={kunMoyuMoe.ad[0].url} rel="noreferrer">
110-
<Image
111-
className="pointer-events-none select-none"
112-
src="/a/moyumoe1.avif"
113-
alt=""
114-
/>
115-
</a>
116-
</div>
117-
)}
93+
<AIEroBanner className="block sm:hidden" payload={payload} />
11894

11995
<ResourceDownloadCard resource={resource} />
12096

config/moyu-moe.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ export const kunMoyuMoe: KunSiteConfig = {
5959
],
6060
ad: [
6161
{
62-
name: 'DZMM',
63-
url: 'https://www.xn--i8s951di30azba.com/?rf=8e6ec4cf'
62+
name: 'AIEro',
63+
url: 'https://stats.kungal.org/q/W7Jb6JFlm'
6464
}
6565
]
6666
}

public/a/moyumoe1-button.avif

8.28 KB
Binary file not shown.

0 commit comments

Comments
 (0)