微调登录按钮样式

This commit is contained in:
tangly1024.com
2024-06-17 17:59:31 +08:00
parent af32458a55
commit 48dec12b5d
2 changed files with 28 additions and 5 deletions

View File

@@ -4,15 +4,29 @@ module.exports = {
es2021: true,
node: true
},
extends: ['plugin:react/recommended', 'plugin:@next/next/recommended', 'standard', 'prettier'],
extends: [
'plugin:react/recommended',
'plugin:@next/next/recommended',
'standard',
'prettier',
'plugin:@typescript-eslint/recommended', // 添加 TypeScript 推荐规则
'plugin:@typescript-eslint/recommended-requiring-type-checking' // 添加需要类型检查的规则
],
parser: '@typescript-eslint/parser', // 使用 TypeScript 解析器
parserOptions: {
ecmaFeatures: {
jsx: true
},
ecmaVersion: 12,
sourceType: 'module'
sourceType: 'module',
project: './tsconfig.json' // 指定 tsconfig.json 的路径
},
plugins: ['react', 'react-hooks', 'prettier'],
plugins: [
'react',
'react-hooks',
'prettier',
'@typescript-eslint' // 添加 TypeScript 插件
],
settings: {
react: {
version: 'detect'
@@ -23,7 +37,9 @@ module.exports = {
'react/no-unknown-property': 'off', // <style jsx>
'react/prop-types': 'off',
'space-before-function-paren': 0,
'react-hooks/rules-of-hooks': 'error' // Checks rules of Hooks
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], // 确保未使用的变量报错
'@typescript-eslint/explicit-function-return-type': 'off' // 关闭强制函数返回类型声明
},
globals: {
React: true

View File

@@ -1,9 +1,11 @@
/* eslint-disable no-unreachable */
import { siteConfig } from '@/lib/config'
import { useGlobal } from '@/lib/global'
import { SignInButton, SignedIn, SignedOut, UserButton } from '@clerk/nextjs'
import throttle from 'lodash.throttle'
import { useRouter } from 'next/router'
import { useCallback, useEffect, useState } from 'react'
import CONFIG from '../config'
import { DarkModeButton } from './DarkModeButton'
import { Logo } from './Logo'
import { MenuList } from './MenuList'
@@ -77,7 +79,12 @@ export const NavBar = props => {
{siteConfig('STARTER_NAV_BUTTON_1_TEXT', null, CONFIG)}
</a> */}
<SignInButton mode='modal' />
<SignInButton mode='modal'>
<button
className={`loginBtn ${buttonTextColor} px-[22px] py-2 text-base font-medium hover:opacity-70`}>
{siteConfig('STARTER_NAV_BUTTON_1_TEXT', null, CONFIG)}
</button>
</SignInButton>
{/* <button
className={`signUpBtn ${buttonTextColor} rounded-md bg-white bg-opacity-20 px-6 py-2 text-base font-medium duration-300 ease-in-out hover:bg-opacity-100 hover:text-dark`}>