feat: 게임 시작 버튼 추가 및 AuthContext 린트 에러 수정
All checks were successful
Client CI/CD / deploy (push) Successful in 10s

- DownloadSection에 a301:// 커스텀 URI로 게임 실행하는 버튼 추가
- AuthContext에서 createContext와 useAuth 훅을 별도 파일로 분리하여 react-refresh 린트 에러 해결

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-24 20:55:27 +09:00
parent e025fdfe87
commit 6998ffd6a3
9 changed files with 60 additions and 13 deletions

View File

@@ -39,6 +39,33 @@
transform: translateY(-1px);
}
.btn-launch {
display: inline-block;
padding: 16px 48px;
background: transparent;
color: #BACDB0;
border: 2px solid #BACDB0;
border-radius: 8px;
font-size: 1.1rem;
font-weight: 700;
cursor: pointer;
transition: background 0.2s, color 0.2s, transform 0.15s;
letter-spacing: 0.05em;
margin-left: 16px;
}
.btn-launch:hover {
background: #BACDB0;
color: #2E2C2F;
transform: translateY(-1px);
}
.launch-hint {
font-size: 0.78rem;
color: rgba(255, 255, 255, 0.3);
margin: 16px 0 0;
}
.download-preparing {
font-size: 0.9rem;
color: rgba(255, 255, 255, 0.4);

View File

@@ -1,6 +1,6 @@
import { useState, useEffect } from 'react';
import { useNavigate } from 'react-router-dom';
import { useAuth } from '../context/AuthContext';
import { useAuth } from '../context/useAuth';
import { getDownloadInfo } from '../api/download';
import './DownloadSection.css';
@@ -23,6 +23,14 @@ export default function DownloadSection() {
}
};
const handleLaunch = () => {
if (!user) {
navigate('/login');
return;
}
window.location.href = 'a301://launch?token=' + user.token;
};
if (!ready) return null;
return (
@@ -37,6 +45,12 @@ export default function DownloadSection() {
<a href={info.url} download onClick={handleDownload} className="btn-download">
{user ? '다운로드' : '로그인 후 다운로드'}
</a>
<button onClick={handleLaunch} className="btn-launch">
게임 시작
</button>
<p className="launch-hint">
게임 시작이 되나요? 먼저 다운로드 launcher.exe install을 실행해주세요.
</p>
</>
) : (
<p className="download-preparing">런처 준비 중입니다. 잠시 다시 확인해주세요.</p>