From f0cefd305b1c131ad72ce27a52b2aa9e9c4537a1 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Mon, 23 Sep 2024 17:35:46 +0800 Subject: [PATCH] =?UTF-8?q?clerk=20=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/{NavBar.js => Header.js} | 37 ++++++++++------ themes/starter/index.js | 43 +++++++++++++------ tsconfig.json | 6 +-- 3 files changed, 57 insertions(+), 29 deletions(-) rename themes/starter/components/{NavBar.js => Header.js} (65%) diff --git a/themes/starter/components/NavBar.js b/themes/starter/components/Header.js similarity index 65% rename from themes/starter/components/NavBar.js rename to themes/starter/components/Header.js index b11b3cb5..14648ebe 100644 --- a/themes/starter/components/NavBar.js +++ b/themes/starter/components/Header.js @@ -1,6 +1,7 @@ /* eslint-disable no-unreachable */ import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' +import { SignedIn, SignedOut, UserButton } from '@clerk/nextjs' import throttle from 'lodash.throttle' import { useRouter } from 'next/router' import { useCallback, useEffect, useState } from 'react' @@ -11,12 +12,15 @@ import { MenuList } from './MenuList' /** * 顶部导航栏 */ -export const NavBar = props => { +export const Header = props => { const router = useRouter() const { isDarkMode } = useGlobal() const [buttonTextColor, setColor] = useState( router.route === '/' ? 'text-white' : '' ) + + const enableClerk = process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY + useEffect(() => { if (isDarkMode || router.route === '/') { setColor('text-white') @@ -60,22 +64,27 @@ export const NavBar = props => { {/* 右侧功能 */} -
+
{/* 深色模式切换 */} {/* 注册登录功能 */} - + + + + + +
diff --git a/themes/starter/index.js b/themes/starter/index.js index 766b3f60..b2c0232d 100644 --- a/themes/starter/index.js +++ b/themes/starter/index.js @@ -2,13 +2,6 @@ /* eslint-disable @next/next/no-img-element */ 'use client' - -/** - * 这是一个空白主题,方便您用作创建新主题时的模板,从而开发出您自己喜欢的主题 - * 1. 禁用了代码质量检查功能,提高了代码的宽容度;您可以使用标准的html写法 - * 2. 内容大部分是在此文件中写死,notion数据从props参数中传进来 - * 3. 您可在此网站找到更多喜欢的组件 https://www.tailwind-kit.com/ - */ import Loading from '@/components/Loading' import NotionPage from '@/components/NotionPage' import { siteConfig } from '@/lib/config' @@ -23,8 +16,8 @@ import { Contact } from './components/Contact' import { FAQ } from './components/FAQ' import { Features } from './components/Features' import { Footer } from './components/Footer' +import { Header } from './components/Header' import { Hero } from './components/Hero' -import { NavBar } from './components/NavBar' import { Pricing } from './components/Pricing' import { Team } from './components/Team' import { Testimonials } from './components/Testimonials' @@ -32,11 +25,13 @@ import CONFIG from './config' import { Style } from './style' // import { MadeWithButton } from './components/MadeWithButton' import { loadWowJS } from '@/lib/plugins/wow' +import { SignIn, SignUp } from '@clerk/nextjs' import Link from 'next/link' import { Banner } from './components/Banner' import { CTA } from './components/CTA' import { SignInForm } from './components/SignInForm' import { SVG404 } from './components/svg/SVG404' + /** * 布局框架 * Landing-2 主题用作产品落地页展示 @@ -58,14 +53,17 @@ const LayoutBase = props => { id='theme-starter' className={`${siteConfig('FONT_STYLE')} min-h-screen flex flex-col dark:bg-[#212b36] scroll-smooth`}>