fix: Fixed redundant key input fields and corrected formatting on the frontend. (#566)

* Eliminate redundant key input fields in the front-end.

* go / react Formatting.
This commit is contained in:
SkywalkerJi
2025-11-06 02:16:04 +09:00
committed by GitHub
parent 3f8df95c63
commit b99a54ef41
8 changed files with 221 additions and 159 deletions

View File

@@ -16,7 +16,7 @@ import (
"strings" "strings"
"syscall" "syscall"
"github.com/joho/godotenv" "github.com/joho/godotenv"
) )
// LeverageConfig 杠杆配置 // LeverageConfig 杠杆配置
@@ -225,7 +225,6 @@ func main() {
log.Printf("✓ Admin mode enabled. All API endpoints require admin authentication.") log.Printf("✓ Admin mode enabled. All API endpoints require admin authentication.")
} }
log.Printf("✓ 配置数据库初始化成功") log.Printf("✓ 配置数据库初始化成功")
fmt.Println() fmt.Println()

View File

@@ -1936,28 +1936,6 @@ function ExchangeConfigModal({
/> />
</div> </div>
<div>
<label
className="block text-sm font-semibold mb-2"
style={{ color: '#EAECEF' }}
>
{t('secretKey', language)}
</label>
<input
type="password"
value={secretKey}
onChange={(e) => setSecretKey(e.target.value)}
placeholder={t('enterSecretKey', language)}
className="w-full px-3 py-2 rounded"
style={{
background: '#0B0E11',
border: '1px solid #2B3139',
color: '#EAECEF',
}}
required
/>
</div>
{selectedExchange.id === 'okx' && ( {selectedExchange.id === 'okx' && (
<div> <div>
<label <label

View File

@@ -1,9 +1,9 @@
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react'
import { useAuth } from '../contexts/AuthContext' import { useAuth } from '../contexts/AuthContext'
import { useLanguage } from '../contexts/LanguageContext' import { useLanguage } from '../contexts/LanguageContext'
import { t } from '../i18n/translations' import { t } from '../i18n/translations'
import HeaderBar from './landing/HeaderBar' import HeaderBar from './landing/HeaderBar'
import { getSystemConfig } from '../lib/config'; import { getSystemConfig } from '../lib/config'
export function LoginPage() { export function LoginPage() {
const { language } = useLanguage() const { language } = useLanguage()
@@ -15,30 +15,29 @@ export function LoginPage() {
const [userID, setUserID] = useState('') const [userID, setUserID] = useState('')
const [error, setError] = useState('') const [error, setError] = useState('')
const [loading, setLoading] = useState(false) const [loading, setLoading] = useState(false)
const [adminPassword, setAdminPassword] = useState(''); const [adminPassword, setAdminPassword] = useState('')
const [adminMode, setAdminMode] = useState<boolean | null>(null); const [adminMode, setAdminMode] = useState<boolean | null>(null)
useEffect(() => { useEffect(() => {
getSystemConfig() getSystemConfig()
.then((cfg) => { .then((cfg) => {
setAdminMode(!!cfg.admin_mode); setAdminMode(!!cfg.admin_mode)
}) })
.catch(() => { .catch(() => {
setAdminMode(false); setAdminMode(false)
}); })
}, []); }, [])
const handleAdminLogin = async (e: React.FormEvent) => { const handleAdminLogin = async (e: React.FormEvent) => {
e.preventDefault(); e.preventDefault()
setError(''); setError('')
setLoading(true); setLoading(true)
const result = await loginAdmin(adminPassword); const result = await loginAdmin(adminPassword)
if (!result.success) { if (!result.success) {
setError(result.message || t('loginFailed', language)); setError(result.message || t('loginFailed', language))
} }
setLoading(false); setLoading(false)
}; }
const handleLogin = async (e: React.FormEvent) => { const handleLogin = async (e: React.FormEvent) => {
e.preventDefault() e.preventDefault()
@@ -127,39 +126,55 @@ export function LoginPage() {
border: '1px solid var(--panel-border)', border: '1px solid var(--panel-border)',
}} }}
> >
{adminMode ? ( {adminMode ? (
<form onSubmit={handleAdminLogin} className="space-y-4"> <form onSubmit={handleAdminLogin} className="space-y-4">
<div> <div>
<label className="block text-sm font-semibold mb-2" style={{ color: 'var(--brand-light-gray)' }}> <label
className="block text-sm font-semibold mb-2"
</label> style={{ color: 'var(--brand-light-gray)' }}
<input >
type="password"
value={adminPassword} </label>
onChange={(e) => setAdminPassword(e.target.value)} <input
className="w-full px-3 py-2 rounded" type="password"
style={{ background: 'var(--brand-black)', border: '1px solid var(--panel-border)', color: 'var(--brand-light-gray)' }} value={adminPassword}
placeholder="请输入管理员密码" onChange={(e) => setAdminPassword(e.target.value)}
required className="w-full px-3 py-2 rounded"
/> style={{
</div> background: 'var(--brand-black)',
border: '1px solid var(--panel-border)',
{error && ( color: 'var(--brand-light-gray)',
<div className="text-sm px-3 py-2 rounded" style={{ background: 'var(--binance-red-bg)', color: 'var(--binance-red)' }}> }}
{error} placeholder="请输入管理员密码"
required
/>
</div> </div>
)}
<button {error && (
type="submit" <div
disabled={loading} className="text-sm px-3 py-2 rounded"
className="w-full px-4 py-2 rounded text-sm font-semibold transition-all hover:scale-105 disabled:opacity-50" style={{
style={{ background: 'var(--brand-yellow)', color: 'var(--brand-black)' }} background: 'var(--binance-red-bg)',
> color: 'var(--binance-red)',
{loading ? t('loading', language) : '登录'} }}
</button> >
</form> {error}
) : step === 'login' ? ( </div>
)}
<button
type="submit"
disabled={loading}
className="w-full px-4 py-2 rounded text-sm font-semibold transition-all hover:scale-105 disabled:opacity-50"
style={{
background: 'var(--brand-yellow)',
color: 'var(--brand-black)',
}}
>
{loading ? t('loading', language) : '登录'}
</button>
</form>
) : step === 'login' ? (
<form onSubmit={handleLogin} className="space-y-4"> <form onSubmit={handleLogin} className="space-y-4">
<div> <div>
<label <label

View File

@@ -1,63 +1,66 @@
import React, { useState } from 'react'; import React, { useState } from 'react'
import { useAuth } from '../contexts/AuthContext'; import { useAuth } from '../contexts/AuthContext'
import { useLanguage } from '../contexts/LanguageContext'; import { useLanguage } from '../contexts/LanguageContext'
import { t } from '../i18n/translations'; import { t } from '../i18n/translations'
import { Header } from './Header'; import { Header } from './Header'
import { ArrowLeft, KeyRound, Eye, EyeOff } from 'lucide-react'; import { ArrowLeft, KeyRound, Eye, EyeOff } from 'lucide-react'
export function ResetPasswordPage() { export function ResetPasswordPage() {
const { language } = useLanguage(); const { language } = useLanguage()
const { resetPassword } = useAuth(); const { resetPassword } = useAuth()
const [email, setEmail] = useState(''); const [email, setEmail] = useState('')
const [newPassword, setNewPassword] = useState(''); const [newPassword, setNewPassword] = useState('')
const [confirmPassword, setConfirmPassword] = useState(''); const [confirmPassword, setConfirmPassword] = useState('')
const [otpCode, setOtpCode] = useState(''); const [otpCode, setOtpCode] = useState('')
const [error, setError] = useState(''); const [error, setError] = useState('')
const [success, setSuccess] = useState(false); const [success, setSuccess] = useState(false)
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false)
const [showPassword, setShowPassword] = useState(false); const [showPassword, setShowPassword] = useState(false)
const [showConfirmPassword, setShowConfirmPassword] = useState(false); const [showConfirmPassword, setShowConfirmPassword] = useState(false)
const handleResetPassword = async (e: React.FormEvent) => { const handleResetPassword = async (e: React.FormEvent) => {
e.preventDefault(); e.preventDefault()
setError(''); setError('')
setSuccess(false); setSuccess(false)
// 验证两次密码是否一致 // 验证两次密码是否一致
if (newPassword !== confirmPassword) { if (newPassword !== confirmPassword) {
setError(t('passwordMismatch', language)); setError(t('passwordMismatch', language))
return; return
} }
setLoading(true); setLoading(true)
const result = await resetPassword(email, newPassword, otpCode); const result = await resetPassword(email, newPassword, otpCode)
if (result.success) { if (result.success) {
setSuccess(true); setSuccess(true)
// 3秒后跳转到登录页面 // 3秒后跳转到登录页面
setTimeout(() => { setTimeout(() => {
window.history.pushState({}, '', '/login'); window.history.pushState({}, '', '/login')
window.dispatchEvent(new PopStateEvent('popstate')); window.dispatchEvent(new PopStateEvent('popstate'))
}, 3000); }, 3000)
} else { } else {
setError(result.message || t('resetPasswordFailed', language)); setError(result.message || t('resetPasswordFailed', language))
} }
setLoading(false); setLoading(false)
}; }
return ( return (
<div className="min-h-screen" style={{ background: '#0B0E11' }}> <div className="min-h-screen" style={{ background: '#0B0E11' }}>
<Header simple /> <Header simple />
<div className="flex items-center justify-center" style={{ minHeight: 'calc(100vh - 80px)' }}> <div
className="flex items-center justify-center"
style={{ minHeight: 'calc(100vh - 80px)' }}
>
<div className="w-full max-w-md"> <div className="w-full max-w-md">
{/* Back to Login */} {/* Back to Login */}
<button <button
onClick={() => { onClick={() => {
window.history.pushState({}, '', '/login'); window.history.pushState({}, '', '/login')
window.dispatchEvent(new PopStateEvent('popstate')); window.dispatchEvent(new PopStateEvent('popstate'))
}} }}
className="flex items-center gap-2 mb-6 text-sm hover:text-[#F0B90B] transition-colors" className="flex items-center gap-2 mb-6 text-sm hover:text-[#F0B90B] transition-colors"
style={{ color: '#848E9C' }} style={{ color: '#848E9C' }}
@@ -68,7 +71,10 @@ export function ResetPasswordPage() {
{/* Logo */} {/* Logo */}
<div className="text-center mb-8"> <div className="text-center mb-8">
<div className="w-16 h-16 mx-auto mb-4 flex items-center justify-center rounded-full" style={{ background: 'rgba(240, 185, 11, 0.1)' }}> <div
className="w-16 h-16 mx-auto mb-4 flex items-center justify-center rounded-full"
style={{ background: 'rgba(240, 185, 11, 0.1)' }}
>
<KeyRound className="w-8 h-8" style={{ color: '#F0B90B' }} /> <KeyRound className="w-8 h-8" style={{ color: '#F0B90B' }} />
</div> </div>
<h1 className="text-2xl font-bold" style={{ color: '#EAECEF' }}> <h1 className="text-2xl font-bold" style={{ color: '#EAECEF' }}>
@@ -80,11 +86,17 @@ export function ResetPasswordPage() {
</div> </div>
{/* Reset Password Form */} {/* Reset Password Form */}
<div className="rounded-lg p-6" style={{ background: '#1E2329', border: '1px solid #2B3139' }}> <div
className="rounded-lg p-6"
style={{ background: '#1E2329', border: '1px solid #2B3139' }}
>
{success ? ( {success ? (
<div className="text-center py-8"> <div className="text-center py-8">
<div className="text-5xl mb-4"></div> <div className="text-5xl mb-4"></div>
<p className="text-lg font-semibold mb-2" style={{ color: '#EAECEF' }}> <p
className="text-lg font-semibold mb-2"
style={{ color: '#EAECEF' }}
>
{t('resetPasswordSuccess', language)} {t('resetPasswordSuccess', language)}
</p> </p>
<p className="text-sm" style={{ color: '#848E9C' }}> <p className="text-sm" style={{ color: '#848E9C' }}>
@@ -94,7 +106,10 @@ export function ResetPasswordPage() {
) : ( ) : (
<form onSubmit={handleResetPassword} className="space-y-4"> <form onSubmit={handleResetPassword} className="space-y-4">
<div> <div>
<label className="block text-sm font-semibold mb-2" style={{ color: '#EAECEF' }}> <label
className="block text-sm font-semibold mb-2"
style={{ color: '#EAECEF' }}
>
{t('email', language)} {t('email', language)}
</label> </label>
<input <input
@@ -102,14 +117,21 @@ export function ResetPasswordPage() {
value={email} value={email}
onChange={(e) => setEmail(e.target.value)} onChange={(e) => setEmail(e.target.value)}
className="w-full px-3 py-2 rounded" className="w-full px-3 py-2 rounded"
style={{ background: '#0B0E11', border: '1px solid #2B3139', color: '#EAECEF' }} style={{
background: '#0B0E11',
border: '1px solid #2B3139',
color: '#EAECEF',
}}
placeholder={t('emailPlaceholder', language)} placeholder={t('emailPlaceholder', language)}
required required
/> />
</div> </div>
<div> <div>
<label className="block text-sm font-semibold mb-2" style={{ color: '#EAECEF' }}> <label
className="block text-sm font-semibold mb-2"
style={{ color: '#EAECEF' }}
>
{t('newPassword', language)} {t('newPassword', language)}
</label> </label>
<div className="relative"> <div className="relative">
@@ -118,7 +140,11 @@ export function ResetPasswordPage() {
value={newPassword} value={newPassword}
onChange={(e) => setNewPassword(e.target.value)} onChange={(e) => setNewPassword(e.target.value)}
className="w-full px-3 py-2 pr-10 rounded" className="w-full px-3 py-2 pr-10 rounded"
style={{ background: '#0B0E11', border: '1px solid #2B3139', color: '#EAECEF' }} style={{
background: '#0B0E11',
border: '1px solid #2B3139',
color: '#EAECEF',
}}
placeholder={t('newPasswordPlaceholder', language)} placeholder={t('newPasswordPlaceholder', language)}
required required
minLength={6} minLength={6}
@@ -128,13 +154,20 @@ export function ResetPasswordPage() {
onClick={() => setShowPassword(!showPassword)} onClick={() => setShowPassword(!showPassword)}
className="absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-300" className="absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-300"
> >
{showPassword ? <EyeOff className="w-5 h-5" /> : <Eye className="w-5 h-5" />} {showPassword ? (
<EyeOff className="w-5 h-5" />
) : (
<Eye className="w-5 h-5" />
)}
</button> </button>
</div> </div>
</div> </div>
<div> <div>
<label className="block text-sm font-semibold mb-2" style={{ color: '#EAECEF' }}> <label
className="block text-sm font-semibold mb-2"
style={{ color: '#EAECEF' }}
>
{t('confirmPassword', language)} {t('confirmPassword', language)}
</label> </label>
<div className="relative"> <div className="relative">
@@ -143,23 +176,36 @@ export function ResetPasswordPage() {
value={confirmPassword} value={confirmPassword}
onChange={(e) => setConfirmPassword(e.target.value)} onChange={(e) => setConfirmPassword(e.target.value)}
className="w-full px-3 py-2 pr-10 rounded" className="w-full px-3 py-2 pr-10 rounded"
style={{ background: '#0B0E11', border: '1px solid #2B3139', color: '#EAECEF' }} style={{
background: '#0B0E11',
border: '1px solid #2B3139',
color: '#EAECEF',
}}
placeholder={t('confirmPasswordPlaceholder', language)} placeholder={t('confirmPasswordPlaceholder', language)}
required required
minLength={6} minLength={6}
/> />
<button <button
type="button" type="button"
onClick={() => setShowConfirmPassword(!showConfirmPassword)} onClick={() =>
setShowConfirmPassword(!showConfirmPassword)
}
className="absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-300" className="absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-300"
> >
{showConfirmPassword ? <EyeOff className="w-5 h-5" /> : <Eye className="w-5 h-5" />} {showConfirmPassword ? (
<EyeOff className="w-5 h-5" />
) : (
<Eye className="w-5 h-5" />
)}
</button> </button>
</div> </div>
</div> </div>
<div> <div>
<label className="block text-sm font-semibold mb-2" style={{ color: '#EAECEF' }}> <label
className="block text-sm font-semibold mb-2"
style={{ color: '#EAECEF' }}
>
{t('otpCode', language)} {t('otpCode', language)}
</label> </label>
<div className="text-center mb-3"> <div className="text-center mb-3">
@@ -171,9 +217,15 @@ export function ResetPasswordPage() {
<input <input
type="text" type="text"
value={otpCode} value={otpCode}
onChange={(e) => setOtpCode(e.target.value.replace(/\D/g, '').slice(0, 6))} onChange={(e) =>
setOtpCode(e.target.value.replace(/\D/g, '').slice(0, 6))
}
className="w-full px-3 py-2 rounded text-center text-2xl font-mono" className="w-full px-3 py-2 rounded text-center text-2xl font-mono"
style={{ background: '#0B0E11', border: '1px solid #2B3139', color: '#EAECEF' }} style={{
background: '#0B0E11',
border: '1px solid #2B3139',
color: '#EAECEF',
}}
placeholder={t('otpPlaceholder', language)} placeholder={t('otpPlaceholder', language)}
maxLength={6} maxLength={6}
required required
@@ -181,7 +233,13 @@ export function ResetPasswordPage() {
</div> </div>
{error && ( {error && (
<div className="text-sm px-3 py-2 rounded" style={{ background: 'rgba(246, 70, 93, 0.1)', color: '#F6465D' }}> <div
className="text-sm px-3 py-2 rounded"
style={{
background: 'rgba(246, 70, 93, 0.1)',
color: '#F6465D',
}}
>
{error} {error}
</div> </div>
)} )}
@@ -192,7 +250,9 @@ export function ResetPasswordPage() {
className="w-full px-4 py-2 rounded text-sm font-semibold transition-all hover:scale-105 disabled:opacity-50" className="w-full px-4 py-2 rounded text-sm font-semibold transition-all hover:scale-105 disabled:opacity-50"
style={{ background: '#F0B90B', color: '#000' }} style={{ background: '#F0B90B', color: '#000' }}
> >
{loading ? t('loading', language) : t('resetPasswordButton', language)} {loading
? t('loading', language)
: t('resetPasswordButton', language)}
</button> </button>
</form> </form>
)} )}
@@ -200,5 +260,5 @@ export function ResetPasswordPage() {
</div> </div>
</div> </div>
</div> </div>
); )
} }

View File

@@ -478,14 +478,16 @@ export default function HeaderBar({
</a> </a>
{!isAdminMode && ( {!isAdminMode && (
<a <a
href='/register' href="/register"
className='px-4 py-2 rounded font-semibold text-sm transition-colors hover:opacity-90' className="px-4 py-2 rounded font-semibold text-sm transition-colors hover:opacity-90"
style={{ background: 'var(--brand-yellow)', color: 'var(--brand-black)' }} style={{
background: 'var(--brand-yellow)',
color: 'var(--brand-black)',
}}
> >
{t('signUp', language)} {t('signUp', language)}
</a> </a>
)} )}
</div> </div>
) )
)} )}

View File

@@ -18,12 +18,10 @@ interface AuthContextType {
userID?: string userID?: string
requiresOTP?: boolean requiresOTP?: boolean
}> }>
loginAdmin: ( loginAdmin: (password: string) => Promise<{
password: string success: boolean
) => Promise<{ message?: string
success: boolean; }>
message?: string
}>;
register: ( register: (
email: string, email: string,
password: string, password: string,
@@ -64,11 +62,11 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
getSystemConfig() getSystemConfig()
.then(() => { .then(() => {
// 不再在管理员模式下模拟登录;统一检查本地存储 // 不再在管理员模式下模拟登录;统一检查本地存储
const savedToken = localStorage.getItem('auth_token'); const savedToken = localStorage.getItem('auth_token')
const savedUser = localStorage.getItem('auth_user'); const savedUser = localStorage.getItem('auth_user')
if (savedToken && savedUser) { if (savedToken && savedUser) {
setToken(savedToken); setToken(savedToken)
setUser(JSON.parse(savedUser)); setUser(JSON.parse(savedUser))
} }
setIsLoading(false) setIsLoading(false)
@@ -118,31 +116,34 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
return { success: false, message: '未知错误' } return { success: false, message: '未知错误' }
} }
const loginAdmin = async (password: string) => { const loginAdmin = async (password: string) => {
try { try {
const response = await fetch('/api/admin-login', { const response = await fetch('/api/admin-login', {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ password }), body: JSON.stringify({ password }),
}); })
const data = await response.json(); const data = await response.json()
if (response.ok) { if (response.ok) {
const userInfo = { id: data.user_id || 'admin', email: data.email || 'admin@localhost' }; const userInfo = {
setToken(data.token); id: data.user_id || 'admin',
setUser(userInfo); email: data.email || 'admin@localhost',
localStorage.setItem('auth_token', data.token); }
localStorage.setItem('auth_user', JSON.stringify(userInfo)); setToken(data.token)
setUser(userInfo)
localStorage.setItem('auth_token', data.token)
localStorage.setItem('auth_user', JSON.stringify(userInfo))
// 跳转到仪表盘 // 跳转到仪表盘
window.history.pushState({}, '', '/dashboard'); window.history.pushState({}, '', '/dashboard')
window.dispatchEvent(new PopStateEvent('popstate')); window.dispatchEvent(new PopStateEvent('popstate'))
return { success: true }; return { success: true }
} else { } else {
return { success: false, message: data.error || '登录失败' }; return { success: false, message: data.error || '登录失败' }
} }
} catch (e) { } catch (e) {
return { success: false, message: '登录失败,请重试' }; return { success: false, message: '登录失败,请重试' }
} }
}; }
const register = async ( const register = async (
email: string, email: string,
@@ -282,12 +283,14 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
} }
const logout = () => { const logout = () => {
const savedToken = localStorage.getItem('auth_token'); const savedToken = localStorage.getItem('auth_token')
if (savedToken) { if (savedToken) {
fetch('/api/logout', { fetch('/api/logout', {
method: 'POST', method: 'POST',
headers: { 'Authorization': `Bearer ${savedToken}` }, headers: { Authorization: `Bearer ${savedToken}` },
}).catch(() => {/* ignore network errors on logout */}); }).catch(() => {
/* ignore network errors on logout */
})
} }
setUser(null) setUser(null)
setToken(null) setToken(null)
@@ -301,7 +304,7 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
user, user,
token, token,
login, login,
loginAdmin, loginAdmin,
register, register,
verifyOTP, verifyOTP,
completeRegistration, completeRegistration,

View File

@@ -342,7 +342,8 @@ export const translations = {
newPassword: 'New Password', newPassword: 'New Password',
newPasswordPlaceholder: 'Enter new password (at least 6 characters)', newPasswordPlaceholder: 'Enter new password (at least 6 characters)',
resetPasswordButton: 'Reset Password', resetPasswordButton: 'Reset Password',
resetPasswordSuccess: 'Password reset successful! Please login with your new password', resetPasswordSuccess:
'Password reset successful! Please login with your new password',
resetPasswordFailed: 'Password reset failed', resetPasswordFailed: 'Password reset failed',
backToLogin: 'Back to Login', backToLogin: 'Back to Login',
scanQRCode: 'Scan QR Code', scanQRCode: 'Scan QR Code',

View File

@@ -14,7 +14,11 @@ import { useAuth } from '../contexts/AuthContext'
import { useLanguage } from '../contexts/LanguageContext' import { useLanguage } from '../contexts/LanguageContext'
import { t } from '../i18n/translations' import { t } from '../i18n/translations'
export function LandingPage({ isAdminMode = false }: { isAdminMode?: boolean }) { export function LandingPage({
isAdminMode = false,
}: {
isAdminMode?: boolean
}) {
const [showLoginModal, setShowLoginModal] = useState(false) const [showLoginModal, setShowLoginModal] = useState(false)
const { user, logout } = useAuth() const { user, logout } = useAuth()
const { language, setLanguage } = useLanguage() const { language, setLanguage } = useLanguage()
@@ -31,7 +35,7 @@ export function LandingPage({ isAdminMode = false }: { isAdminMode?: boolean })
onLanguageChange={setLanguage} onLanguageChange={setLanguage}
user={user} user={user}
onLogout={logout} onLogout={logout}
isAdminMode={isAdminMode} isAdminMode={isAdminMode}
onPageChange={(page) => { onPageChange={(page) => {
console.log('LandingPage onPageChange called with:', page) console.log('LandingPage onPageChange called with:', page)
if (page === 'competition') { if (page === 'competition') {