33import { useState } from "react" ;
44import { useRouter } from "next/navigation" ;
55import { login , register } from "@/lib/api/auth" ;
6+ import { RankMeasurement } from "@/features/dashboard/components/RankMeasurement" ;
67
78export default function LoginPage ( ) {
89 const router = useRouter ( ) ;
@@ -11,6 +12,7 @@ export default function LoginPage() {
1112 const [ isRegister , setIsRegister ] = useState ( false ) ;
1213 const [ error , setError ] = useState < string | null > ( null ) ;
1314 const [ loading , setLoading ] = useState ( false ) ;
15+ const [ showRankMeasurement , setShowRankMeasurement ] = useState ( false ) ;
1416
1517 const handleSubmit = async ( e : React . FormEvent ) => {
1618 e . preventDefault ( ) ;
@@ -33,14 +35,19 @@ export default function LoginPage() {
3335 } ;
3436
3537 const handleGitHubLogin = ( ) => {
36- // GitHub OAuth フローを開始(バックエンドへリダイレクト)
38+ // ランク測定UIを表示
39+ setShowRankMeasurement ( true ) ;
40+ } ;
41+
42+ const handleRankMeasurementComplete = ( ) => {
43+ // ランク測定完了後、GitHub OAuth フローを開始
3744 const apiBaseUrl =
3845 process . env . NEXT_PUBLIC_API_URL || "http://localhost:8000" ;
3946 window . location . href = `${ apiBaseUrl } /api/v1/auth/github/login` ;
4047 } ;
4148
4249 return (
43- < div className = "flex min-h-screen items-center justify-center bg-gradient -to-br from-[#97C88C] via-[#A8D5A1] to-[#8BC880] p-4" >
50+ < div className = "flex min-h-screen items-center justify-center bg-linear -to-br from-[#97C88C] via-[#A8D5A1] to-[#8BC880] p-4" >
4451 < div className = "w-full max-w-md rounded-lg border-4 border-[#2C5F2D] bg-[#F5F5DC] p-8 shadow-[8px_8px_0_0_#2C5F2D] animate-[slideUp_0.3s_ease-out]" >
4552 { /* Header with Icon */ }
4653 < div className = "mb-6 text-center" >
@@ -65,12 +72,12 @@ export default function LoginPage() {
6572 type = "button"
6673 onClick = { handleGitHubLogin }
6774 disabled = { loading }
68- className = "group relative w-full overflow-hidden rounded border-2 border-[#2C5F2D] bg-[#2C5F2D] p-4 font-mono font-bold tracking-widest text-white shadow-[4px_4px_0_0_#1F4521] transition-all hover:translate-x-[2px] hover:translate-y-[2px] hover:shadow-[2px_2px_0_0_#1F4521] active:translate-x-[4px] active:translate-y-[4px] active:shadow-none disabled:opacity-50 disabled:cursor-not-allowed"
75+ className = "group relative w-full overflow-hidden rounded border-2 border-[#2C5F2D] bg-[#2C5F2D] p-4 font-mono font-bold tracking-widest text-white shadow-[4px_4px_0_0_#1F4521] transition-all hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-[2px_2px_0_0_#1F4521] active:translate-x-1 active:translate-y-1 active:shadow-none disabled:opacity-50 disabled:cursor-not-allowed"
6976 >
7077 < span className = "relative z-10 flex items-center justify-center gap-2" >
7178 🚀 GitHub でログイン(推奨)
7279 </ span >
73- < div className = "absolute inset-0 -translate-x-full bg-gradient -to-r from-transparent via-white/20 to-transparent group-hover:translate-x-full transition-transform duration-700" />
80+ < div className = "absolute inset-0 -translate-x-full bg-linear -to-r from-transparent via-white/20 to-transparent group-hover:translate-x-full transition-transform duration-700" />
7481 </ button >
7582 < p className = "mt-3 text-center text-xs text-gray-600 leading-relaxed" >
7683 💡 GitHubリポジトリを分析して
@@ -184,6 +191,17 @@ export default function LoginPage() {
184191 }
185192 }
186193 ` } </ style >
194+
195+ { /* ランク測定モーダル */ }
196+ { showRankMeasurement && (
197+ < div className = "fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm animate-fadeIn" >
198+ < div className = "w-full h-full overflow-auto" >
199+ < RankMeasurement
200+ onComplete = { handleRankMeasurementComplete }
201+ />
202+ </ div >
203+ </ div >
204+ ) }
187205 </ div >
188206 ) ;
189207}
0 commit comments