2
2
import { ArrowSmallRight , PlusSmall } from '@/components/HeroIcons'
3
3
import LazyImage from '@/components/LazyImage'
4
4
import { siteConfig } from '@/lib/config'
5
+ import { useGlobal } from '@/lib/global'
5
6
import Link from 'next/link'
6
7
import { useRouter } from 'next/router'
7
8
import { useImperativeHandle , useRef , useState } from 'react'
@@ -206,6 +207,7 @@ function GroupMenu() {
206
207
*/
207
208
function TopGroup ( props ) {
208
209
const { latestPosts, allNavPages, siteInfo } = props
210
+ const { locale } = useGlobal ( )
209
211
const todayCardRef = useRef ( )
210
212
function handleMouseLeave ( ) {
211
213
todayCardRef . current . coverUp ( )
@@ -238,7 +240,7 @@ function TopGroup(props) {
238
240
</ div >
239
241
{ /* hover 悬浮的 ‘荐’ 字 */ }
240
242
< div className = 'opacity-0 group-hover:opacity-100 -translate-x-4 group-hover:translate-x-0 duration-200 transition-all absolute -top-2 -left-2 bg-indigo-600 dark:bg-yellow-600 text-white rounded-xl overflow-hidden pr-2 pb-2 pl-4 pt-4 text-xs' >
241
- 荐
243
+ { locale . COMMON . RECOMMEND_BADGES }
242
244
</ div >
243
245
</ div >
244
246
</ Link >
@@ -304,6 +306,7 @@ function getTopPosts({ latestPosts, allNavPages }) {
304
306
function TodayCard ( { cRef, siteInfo } ) {
305
307
const router = useRouter ( )
306
308
const link = siteConfig ( 'HEO_HERO_TITLE_LINK' , null , CONFIG )
309
+ const { locale } = useGlobal ( )
307
310
// 卡牌是否盖住下层
308
311
const [ isCoverUp , setIsCoverUp ] = useState ( true )
309
312
@@ -348,7 +351,7 @@ function TodayCard({ cRef, siteInfo }) {
348
351
isCoverUp
349
352
? 'opacity-100 cursor-pointer'
350
353
: 'opacity-0 transform scale-110 pointer-events-none'
351
- } shadow transition-all duration-200 today-card h-full bg-[#0E57D5] rounded-xl relative overflow-hidden flex items-end`} >
354
+ } shadow transition-all duration-200 today-card h-full bg-[#0E57D5] dark:bg-yellow-500 rounded-xl relative overflow-hidden flex items-end`} >
352
355
< div
353
356
id = 'today-card-info'
354
357
className = 'z-10 flex justify-between w-full relative text-white p-10 items-end' >
@@ -364,12 +367,14 @@ function TodayCard({ cRef, siteInfo }) {
364
367
onClick = { handleClickMore }
365
368
className = { `'${
366
369
isCoverUp ? '' : 'hidden pointer-events-none '
367
- } flex items-center px-3 h-10 justify-center bg-[#425aef] hover:bg-[#4259efcb] transition-colors duration-100 rounded-3xl`} >
370
+ } flex items-center px-3 h-10 justify-center bg-[#425aef] hover:bg-[#4259efcb] dark:bg-yellow-500 dark:hover:bg-yellow-600 transition-colors duration-100 rounded-3xl`} >
368
371
< PlusSmall
369
- className = { 'w-6 h-6 mr-2 bg-white rounded-full stroke-indigo-400' }
372
+ className = {
373
+ 'w-6 h-6 mr-2 bg-white rounded-full stroke-indigo-400 dark:stroke-yellow-400'
374
+ }
370
375
/>
371
376
< div id = 'more' className = 'select-none' >
372
- 更多推荐
377
+ { locale . COMMON . MORE }
373
378
</ div >
374
379
</ div >
375
380
</ div >
0 commit comments