diff --git a/themes/magzine/components/CTA.js b/themes/magzine/components/CTA.js
new file mode 100644
index 00000000000..123288638c9
--- /dev/null
+++ b/themes/magzine/components/CTA.js
@@ -0,0 +1,18 @@
+/**
+ * CTA,用于创建一个呼吁用户行动的部分(Call To Action,简称 CTA)。
+ * 该组件通过以下方式激励用户进行特定操作
+ * 用户的公告栏内容将在此显示
+ **/
+export default function CTA({ notice }) {
+ return (
+ <>
+ {/* 底部 */}
+
- {description} -
+ return ( + <> + {/* */} +- There are many variations of passages of Lorem Ipsum but the - majority have suffered in some form. -
- - Start using Play - +/** + * CTA,用于创建一个呼吁用户行动的部分(Call To Action,简称 CTA)。 + * 该组件通过以下方式激励用户进行特定操作 + * 用户的公告栏内容将在此显示 + **/ +export const CTA = () => { + if (!siteConfig('STARTER_CTA_ENABLE')) { + return <>> + } + return ( + <> + {/* */} ++ {siteConfig('STARTER_CTA_DESCRIOTN')} +
+ {siteConfig('STARTER_CTA_BUTTON') && ( + <> + + {siteConfig('STARTER_CTA_BUTTON_TEXT')} + + > + )} +- {siteConfig('STARTER_CONTACT_EMAIL_TEXT', null, CONFIG)} + {siteConfig('STARTER_CONTACT_EMAIL_TEXT')}
- {siteConfig('STARTER_FAQ_TEXT_2', null, CONFIG)} -
--
-
+
+ {siteConfig('STARTER_FAQ_TEXT_2')}
-
-
- {siteConfig('STARTER_FEATURE_TEXT_2', null, CONFIG)}
-
+ {siteConfig('STARTER_FEATURE_TEXT_2')}
+
+ {siteConfig('STARTER_FEATURE_1_TEXT_1')}
+
- {siteConfig('STARTER_FEATURE_1_TEXT_1', null, CONFIG)}
-
+ {siteConfig('STARTER_FEATURE_2_TEXT_1')}
+
- {siteConfig('STARTER_FEATURE_2_TEXT_1', null, CONFIG)}
-
+ {siteConfig('STARTER_FEATURE_3_TEXT_1')}
+
- {siteConfig('STARTER_FEATURE_3_TEXT_1', null, CONFIG)}
-
+ {siteConfig('STARTER_FEATURE_4_TEXT_1')}
+
- {siteConfig('STARTER_FEATURE_4_TEXT_1', null, CONFIG)}
-
- {siteConfig('STARTER_FOOTER_SLOGAN', null, CONFIG)}
+ {siteConfig('STARTER_FOOTER_SLOGAN')}
- {siteConfig('STARTER_HERO_TITLE_2', null, CONFIG)}
-
+ {siteConfig('STARTER_HERO_TITLE_2')}
+
- {siteConfig('STARTER_PRICING_TEXT_2', null, CONFIG)}
-
+ {siteConfig('STARTER_PRICING_TEXT_2')}
+
- {feature}
-
+ {feature}
+
- {siteConfig('STARTER_PRICING_2_TAG', null, CONFIG)}
-
+ {siteConfig('STARTER_PRICING_2_TAG')}
+
- {feature}
-
+ {feature}
+
- {feature}
-
+ {feature}
+
- {siteConfig('STARTER_TESTIMONIALS_TEXT_2', null, CONFIG)}
+ {siteConfig('STARTER_TESTIMONIALS_TEXT_2')}
- {siteConfig('STARTER_404_TEXT', null, CONFIG)}
+ {siteConfig('STARTER_404_TEXT')}
+ {siteConfig('STARTER_FAQ_TEXT_1')}
+
+
+ {siteConfig('STARTER_FAQ_1_QUESTION')}
+
+
+
- {siteConfig('STARTER_FAQ_3_QUESTION', null, CONFIG)}
-
-
+ {siteConfig('STARTER_FAQ_2_QUESTION')}
+
+
+
+ {siteConfig('STARTER_FAQ_3_QUESTION')}
+
+
+
- {siteConfig('STARTER_FAQ_4_QUESTION', null, CONFIG)}
-
-
+ {siteConfig('STARTER_FAQ_4_QUESTION')}
+
+
+
- {siteConfig('STARTER_FEATURE_TEXT_1', null, CONFIG)}
-
-
+ {siteConfig('STARTER_FEATURE_TEXT_1')}
+
+
+ {siteConfig('STARTER_FEATURE_1_TITLE_1')}
+
+
- {siteConfig('STARTER_FEATURE_1_TITLE_1', null, CONFIG)}
-
-
+ {siteConfig('STARTER_FEATURE_2_TITLE_1')}
+
+
- {siteConfig('STARTER_FEATURE_2_TITLE_1', null, CONFIG)}
-
-
+ {siteConfig('STARTER_FEATURE_3_TITLE_1')}
+
+
- {siteConfig('STARTER_FEATURE_3_TITLE_1', null, CONFIG)}
-
-
+ {siteConfig('STARTER_FEATURE_4_TITLE_1')}
+
+
- {siteConfig('STARTER_FEATURE_4_TITLE_1', null, CONFIG)}
-
-
- {siteConfig('STARTER_FOOTER_BLOG_LATEST_TITLE', null, CONFIG)}
+ {siteConfig('STARTER_FOOTER_BLOG_LATEST_TITLE')}
{/* 展示两条最新博客文章 */}
- {siteConfig('STARTER_HERO_TITLE_1', null, CONFIG)}
-
- {/* 次标题 */}
-
- {siteConfig('STARTER_HERO_BUTTON_1_TEXT', null, CONFIG) &&
-
-
+ return (
+ <>
+ {/* */}
+
+ {siteConfig('STARTER_HERO_TITLE_1')}
+
+ {/* 次标题 */}
+
+ {siteConfig('STARTER_HERO_BUTTON_1_TEXT') && (
+
+
- {siteConfig('STARTER_CONTACT_MSG_TITLE', null, CONFIG)}
-
-
- >
+ return (
+ <>
+
+ {siteConfig('STARTER_CONTACT_MSG_TITLE')}
+
+
+ >
+ )
}
diff --git a/themes/starter/components/NavBar.js b/themes/starter/components/NavBar.js
index 2d4fda4125e..b11b3cb56c9 100644
--- a/themes/starter/components/NavBar.js
+++ b/themes/starter/components/NavBar.js
@@ -1,21 +1,22 @@
/* eslint-disable no-unreachable */
-import throttle from 'lodash.throttle';
+import { siteConfig } from '@/lib/config'
+import { useGlobal } from '@/lib/global'
+import throttle from 'lodash.throttle'
+import { useRouter } from 'next/router'
import { useCallback, useEffect, useState } from 'react'
-import { MenuList } from './MenuList';
-import { DarkModeButton } from './DarkModeButton';
-import { Logo } from './Logo';
-import { useRouter } from 'next/router';
-import { siteConfig } from '@/lib/config';
-import CONFIG from '../config';
-import { useGlobal } from '@/lib/global';
+import { DarkModeButton } from './DarkModeButton'
+import { Logo } from './Logo'
+import { MenuList } from './MenuList'
/**
* 顶部导航栏
*/
-export const NavBar = (props) => {
+export const NavBar = props => {
const router = useRouter()
const { isDarkMode } = useGlobal()
- const [buttonTextColor, setColor] = useState(router.route === '/' ? 'text-white' : '')
+ const [buttonTextColor, setColor] = useState(
+ router.route === '/' ? 'text-white' : ''
+ )
useEffect(() => {
if (isDarkMode || router.route === '/') {
setColor('text-white')
@@ -33,59 +34,54 @@ export const NavBar = (props) => {
const throttleMs = 200
const navBarScollListener = useCallback(
throttle(() => {
- // eslint-disable-next-line camelcase
- const ud_header = document.querySelector('.ud-header');
- const scrollY = window.scrollY;
+ // eslint-disable-next-line camelcase
+ const ud_header = document.querySelector('.ud-header')
+ const scrollY = window.scrollY
// 控制台输出当前滚动位置和 sticky 值
if (scrollY > 0) {
- ud_header?.classList?.add('sticky');
+ ud_header?.classList?.add('sticky')
} else {
- ud_header?.classList?.remove('sticky');
+ ud_header?.classList?.remove('sticky')
}
}, throttleMs)
)
- return <>
- {/* */}
-
- {siteConfig('STARTER_PRICING_TEXT_1', null, CONFIG)}
-
-
+ {siteConfig('STARTER_PRICING_TEXT_1')}
+
+
- {siteConfig('STARTER_PRICING_1_PRICE_CURRENCY', null, CONFIG)}
- {siteConfig('STARTER_PRICING_1_PRICE', null, CONFIG)}
-
- {siteConfig('STARTER_PRICING_1_PRICE_PERIOD', null, CONFIG)}
+
- {siteConfig('STARTER_PRICING_1_HEADER', null, CONFIG)}
-
-
+
+ {siteConfig('STARTER_PRICING_1_PRICE_CURRENCY')}
+
+
+ {siteConfig('STARTER_PRICING_1_PRICE')}
+
+
+ {siteConfig('STARTER_PRICING_1_PRICE_PERIOD')}
+
+
+
+ {siteConfig('STARTER_PRICING_1_HEADER')}
+
+
- {siteConfig('STARTER_PRICING_2_PRICE_CURRENCY', null, CONFIG)}
- {siteConfig('STARTER_PRICING_2_PRICE', null, CONFIG)}
-
- {siteConfig('STARTER_PRICING_2_PRICE_PERIOD', null, CONFIG)}
+ {/* 第二个付费计划 */}
+
- {siteConfig('STARTER_PRICING_2_HEADER', null, CONFIG)}
-
-
+
+ {siteConfig('STARTER_PRICING_2_PRICE_CURRENCY')}
+
+
+ {siteConfig('STARTER_PRICING_2_PRICE')}
+
+
+ {siteConfig('STARTER_PRICING_2_PRICE_PERIOD')}
+
+
+
+ {siteConfig('STARTER_PRICING_2_HEADER')}
+
+
- {siteConfig('STARTER_PRICING_3_PRICE_CURRENCY', null, CONFIG)}
- {siteConfig('STARTER_PRICING_3_PRICE', null, CONFIG)}
-
- {siteConfig('STARTER_PRICING_3_PRICE_PERIOD', null, CONFIG)}
+ {/* 第三个付费计划 */}
+
- {siteConfig('STARTER_PRICING_3_HEADER', null, CONFIG)}
-
-
+
+ {siteConfig('STARTER_PRICING_3_PRICE_CURRENCY')}
+
+
+ {siteConfig('STARTER_PRICING_3_PRICE')}
+
+
+ {siteConfig('STARTER_PRICING_3_PRICE_PERIOD')}
+
+
+
+ {siteConfig('STARTER_PRICING_3_HEADER')}
+
+
- {siteConfig('STARTER_TEAM_TEXT_1', null, CONFIG)}
+ {siteConfig('STARTER_TEAM_TEXT_1')}
- {siteConfig('STARTER_TESTIMONIALS_TEXT_1', null, CONFIG)}
+ {siteConfig('STARTER_TESTIMONIALS_TEXT_1')}
- {siteConfig('STARTER_404_TITLE', null, CONFIG)}
+ {siteConfig('STARTER_404_TITLE')}