fix starter hero - bug

This commit is contained in:
tangly1024.com
2024-11-13 10:16:00 +08:00
parent 47b8d97420
commit 4798b5b422

View File

@@ -1,11 +1,13 @@
/* eslint-disable @next/next/no-img-element */
import LazyImage from '@/components/LazyImage'
import { siteConfig } from '@/lib/config'
import CONFIG from '../config'
/**
* 英雄大图区块
*/
export const Hero = props => {
const CONFIG = props?.NOTION_CONFIG || CONFIG
const config = props?.NOTION_CONFIG || CONFIG
return (
<>
{/* <!-- ====== Hero Section Start --> */}
@@ -20,30 +22,30 @@ export const Hero = props => {
data-wow-delay='.2s'>
{/* 主标题 */}
<h1 className='mb-6 text-3xl font-bold leading-snug text-white sm:text-4xl sm:leading-snug lg:text-5xl lg:leading-[1.2]'>
{siteConfig('STARTER_HERO_TITLE_1', null, CONFIG)}
{siteConfig('STARTER_HERO_TITLE_1', null, config)}
</h1>
{/* 次标题 */}
<p className='mx-auto mb-9 max-w-[600px] text-base font-medium text-white sm:text-lg sm:leading-[1.44]'>
{siteConfig('STARTER_HERO_TITLE_2', null, CONFIG)}
{siteConfig('STARTER_HERO_TITLE_2', null, config)}
</p>
{/* 按钮组 */}
<ul className='mb-10 flex flex-wrap items-center justify-center gap-5'>
{siteConfig('STARTER_HERO_BUTTON_1_TEXT', null, CONFIG) && (
{siteConfig('STARTER_HERO_BUTTON_1_TEXT', null, config) && (
<li>
<a
href={siteConfig('STARTER_HERO_BUTTON_1_URL')}
className='inline-flex items-center justify-center rounded-md bg-white px-7 py-[14px] text-center text-base font-medium text-dark shadow-1 transition duration-300 ease-in-out hover:bg-gray-2 hover:text-body-color'>
{siteConfig('STARTER_HERO_BUTTON_1_TEXT', null, CONFIG)}
{siteConfig('STARTER_HERO_BUTTON_1_TEXT', null, config)}
</a>
</li>
)}
{siteConfig('STARTER_HERO_BUTTON_2_TEXT', null, CONFIG) && (
{siteConfig('STARTER_HERO_BUTTON_2_TEXT', null, config) && (
<li>
<a
href={siteConfig(
'STARTER_HERO_BUTTON_2_URL',
null,
CONFIG
config
)}
target='_blank'
className='flex items-center rounded-md bg-white/[0.12] px-6 py-[14px] text-base font-medium text-white transition duration-300 ease-in-out hover:bg-white hover:text-dark'
@@ -51,18 +53,18 @@ export const Hero = props => {
{siteConfig(
'STARTER_HERO_BUTTON_2_ICON',
null,
CONFIG
config
) && (
<img
className='mr-4'
src={siteConfig(
'STARTER_HERO_BUTTON_2_ICON',
null,
CONFIG
config
)}
/>
)}
{siteConfig('STARTER_HERO_BUTTON_2_TEXT', null, CONFIG)}
{siteConfig('STARTER_HERO_BUTTON_2_TEXT', null, config)}
</a>
</li>
)}
@@ -71,7 +73,7 @@ export const Hero = props => {
</div>
{/* 产品预览图片 */}
{siteConfig('STARTER_HERO_PREVIEW_IMAGE', null, CONFIG) && (
{siteConfig('STARTER_HERO_PREVIEW_IMAGE', null, config) && (
<div className='w-full px-4'>
<div
className='wow fadeInUp relative z-10 mx-auto max-w-[845px]'
@@ -82,10 +84,10 @@ export const Hero = props => {
src={siteConfig(
'STARTER_HERO_PREVIEW_IMAGE',
null,
CONFIG
config
)}
alt={siteConfig('TITLE', null, CONFIG)}
title={siteConfig('TITLE', null, CONFIG)}
alt={siteConfig('TITLE', null, config)}
title={siteConfig('TITLE', null, config)}
className='mx-auto max-w-full rounded-t-xl rounded-tr-xl'
/>
</div>
@@ -104,7 +106,7 @@ export const Hero = props => {
</div>
</div>
{/* 横幅图片 */}
{siteConfig('STARTER_HERO_BANNER_IMAGE', null, CONFIG) && (
{siteConfig('STARTER_HERO_BANNER_IMAGE', null, config) && (
<div className='container'>
<LazyImage
priority
@@ -112,7 +114,7 @@ export const Hero = props => {
src={siteConfig(
'STARTER_HERO_BANNER_IMAGE',
null,
CONFIG
config
)}></LazyImage>
</div>
)}