디자인: 게임천국 느낌 아이콘, 홈 단순화(큰 버튼 3개 + 탭), 헤더 로그인/계정 메뉴, 로그인 페이지 분리

- 아이콘: 게임패드 + 천사 고리 + 반짝이, scripts/pwa-icons.ts가 favicon.svg와 PNG를 한 디자인에서 생성
- 홈: 방 만들기·코드로 참여(/j)·컴퓨터와 연습 버튼, [게임 고르기 | 지금 열린 방] 탭
- 헤더: 로그인 전 [로그인] → /login, 로그인 뒤 닉네임 → [설정][로그아웃] 메뉴
- /login: 로그인만, /me(설정)는 로그인 안 했으면 /login?next=/me로

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-07 12:10:11 +09:00
parent 6390e3e64c
commit bdaaa23af6
13 changed files with 353 additions and 104 deletions

View File

@@ -1,9 +1,8 @@
/** 계정 페이지 (docs/05 §7). */
/** 설정(계정) 페이지 (docs/05 §7). 헤더 계정 메뉴 → 설정으로 들어와요. */
import { useEffect, useState } from 'react';
import { Link, useNavigate } from 'react-router';
import { Link, Navigate, useNavigate } from 'react-router';
import { catalogById, nicknameError, normalizeNickname, type MyGameSummary } from '@bg/shared/lite';
import { Avatar, ConfirmSheet, TopBar } from '../components/ui';
import { NicknameForm } from '../components/NicknameForm';
import { gameName } from '../components/GameNotice';
import { api, discordLoginUrl } from '../net/api';
import { useSession } from '../store/session';
@@ -67,24 +66,12 @@ export default function MePage() {
</section>
);
if (!me) {
return (
<>
<TopBar title="내 정보" onBack={() => nav('/')} />
<main className="page">
<section className="card stack">
<h2>시작하기</h2>
<NicknameForm next="/me" />
</section>
{display}
</main>
</>
);
}
// 로그인 안 했으면 로그인 페이지로 (로그인 페이지에는 로그인만 있어요).
if (!me) return <Navigate to="/login?next=/me" replace />;
return (
<>
<TopBar title="내 정보" onBack={() => nav('/')} />
<TopBar title="설정" onBack={() => nav('/')} />
<main className="page">
<section className="card stack" style={{ alignItems: 'center', textAlign: 'center' }}>
<Avatar user={me} size={88} />
@@ -177,8 +164,8 @@ export default function MePage() {
danger={me.kind === 'guest'}
onConfirm={async () => {
await api.logout();
await useSession.getState().refresh();
nav('/');
await useSession.getState().refresh();
}}
onClose={() => setConfirm(null)}
/>
@@ -189,8 +176,8 @@ export default function MePage() {
confirm="모두 로그아웃"
onConfirm={async () => {
await api.logoutAll();
await useSession.getState().refresh();
nav('/');
await useSession.getState().refresh();
}}
onClose={() => setConfirm(null)}
/>
@@ -203,8 +190,8 @@ export default function MePage() {
danger
onConfirm={async () => {
await api.deleteMe();
await useSession.getState().refresh();
nav('/');
await useSession.getState().refresh();
}}
onClose={() => setConfirm(null)}
/>