refactor files

This commit is contained in:
2026-04-12 23:36:14 +07:00
parent 20ae176992
commit 406d7039d6
45 changed files with 162 additions and 255 deletions

View File

@@ -0,0 +1,35 @@
import { useEffect } from 'react'
import { useNavigate } from '@tanstack/react-router'
import { useUser } from '@/hooks/use-auth'
import { RegisterForm } from './RegisterForm'
export function RegisterPage() {
const user = useUser()
const navigate = useNavigate()
useEffect(() => {
if (user) navigate({ to: '/' })
}, [user, navigate])
return (
<div className="min-h-screen flex items-center justify-center p-4 bg-slate-50">
<div className="w-full max-w-md">
<div className="text-center mb-8">
<div className="inline-flex items-center gap-2 mb-3">
<span className="material-symbols-outlined text-blue-600 text-3xl">school</span>
<span className="text-2xl font-bold text-slate-800">TOEIC Luyện thi</span>
</div>
<h1 className="text-xl font-semibold text-slate-700">Tạo tài khoản miễn phí</h1>
<p className="text-sm text-slate-500 mt-1">Không cần xác nhận email dùng ngay lập tức</p>
</div>
<div className="bg-white rounded-2xl shadow-sm border border-slate-200 p-6">
<RegisterForm
onSuccess={() => navigate({ to: '/' })}
onSwitchToLogin={() => navigate({ to: '/auth/login' })}
/>
</div>
</div>
</div>
)
}