From 56cf3cfce123470692b73ed75bd70b32933907c8 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Mon, 25 Mar 2024 16:04:32 +0800 Subject: [PATCH] theme-game-recent-list-link --- themes/game/components/GameListRecent.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/themes/game/components/GameListRecent.js b/themes/game/components/GameListRecent.js index f390adc2..dd4840c4 100644 --- a/themes/game/components/GameListRecent.js +++ b/themes/game/components/GameListRecent.js @@ -1,6 +1,7 @@ /* eslint-disable @next/next/no-img-element */ import { siteConfig } from '@/lib/config' import { checkContainHttp, deepClone, sliceUrlFromHttp } from '@/lib/utils' +import Link from 'next/link' import { useState } from 'react' import { useGameGlobal } from '..' @@ -50,12 +51,14 @@ export const GameListRecent = ({ maxCount = 14 }) => { const GameItem = ({ item }) => { const { title } = item || {} const [showType, setShowType] = useState('img') // img or video - const url = checkContainHttp(item.slug) ? sliceUrlFromHttp(item.slug) : `${siteConfig('SUB_PATH', '')}/${item.slug}` + const url = checkContainHttp(item.slug) + ? sliceUrlFromHttp(item.slug) + : `${siteConfig('SUB_PATH', '')}/${item.slug}` const img = item?.pageCoverThumbnail const video = item?.ext?.video return ( - { setShowType('video') @@ -69,13 +72,19 @@ const GameItem = ({ item }) => {
-
{title}
+
+ {title} +
{showType === 'video' && ( -
+ ) }