Skip to content

Commit

Permalink
Update Logo.js
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyKong2020 authored Oct 13, 2024
1 parent 0c5cc12 commit f18ab90
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions themes/starter/components/Logo.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { useEffect, useState } from 'react'
export const Logo = ({ white }) => {
const router = useRouter()
const { isDarkMode } = useGlobal()
const logoWhite = siteConfig('STARTER_LOGO_WHITE')
const logoWhite = '/images/starter/brands/graygrids-white.svg'
const [logo, setLogo] = useState(logoWhite)
const [logoTextColor, setLogoTextColor] = useState('text-white')

Expand All @@ -25,10 +25,10 @@ export const Logo = ({ white }) => {
// 何时显示浅色或白底的logo
const homePageNavBar = router.route === '/' && scrollY < 10 // 在首页并且视窗在页面顶部
if (white || isDarkMode || homePageNavBar) {
setLogo(siteConfig('STARTER_LOGO_WHITE'))
setLogo('/images/starter/brands/graygrids-white.svg')
setLogoTextColor('text-white')
} else {
setLogo(siteConfig('STARTER_LOGO'))
setLogo('/images/starter/testimonials/icon-star.svg')
setLogoTextColor('text-black')
}
}, throttleMs)
Expand Down

0 comments on commit f18ab90

Please sign in to comment.