From 47b8d9742022a0ec39fced88d3cd606165ae3a11 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Sat, 9 Nov 2024 21:14:07 +0800 Subject: [PATCH] =?UTF-8?q?starter=E4=B8=BB=E9=A2=98-Logo=E7=9B=B8?= =?UTF-8?q?=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/LazyImage.js | 5 ++++- themes/starter/components/Logo.js | 7 ++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/components/LazyImage.js b/components/LazyImage.js index 039fed37656..02f1df19952 100644 --- a/components/LazyImage.js +++ b/components/LazyImage.js @@ -18,6 +18,7 @@ export default function LazyImage({ height, title, onLoad, + onClick, style }) { const maxWidth = siteConfig('IMAGE_COMPRESS_WIDTH') @@ -122,7 +123,9 @@ export default function LazyImage({ if (style) { imgProps.style = style } - + if (onClick) { + imgProps.onClick = onClick + } return ( <> {/* eslint-disable-next-line @next/next/no-img-element */} diff --git a/themes/starter/components/Logo.js b/themes/starter/components/Logo.js index c73cd4ceef6..b691e2d04bb 100644 --- a/themes/starter/components/Logo.js +++ b/themes/starter/components/Logo.js @@ -1,5 +1,6 @@ /* eslint-disable @next/next/no-img-element */ /* eslint-disable @next/next/no-html-link-for-pages */ +import LazyImage from '@/components/LazyImage' import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' import throttle from 'lodash.throttle' @@ -48,14 +49,14 @@ export const Logo = props => {
{/* eslint-disable-next-line @next/next/no-img-element */} {logo && ( - { router.push('/') }} src={logo} - height={14} alt='logo' - className='header-logo w-full mr-1' + className='header-logo mr-1 h-8' /> )} {/* logo文字 */}