Files
Archetype-FirstSpark/src/components/BottomTabBar.tsx
gahusb 9800d067b9 feat: 프레스티지/업적 UI 컴포넌트 추가 및 게임 상태 업데이트 (JSA-55)
- AchievementToast, PrestigeModal, AchievementsScreen 컴포넌트 추가
- BottomTabBar에 업적 탭 연결
- useGameStore 프레스티지/업적 상태 로직 수정
- pages/index.tsx 라우팅 업데이트

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-02 04:19:19 +09:00

73 lines
1.7 KiB
TypeScript

import { css } from '@emotion/react';
import type { TabName } from '../store/useGameStore';
interface TabItem {
key: TabName;
label: string;
icon: string;
}
const TABS: TabItem[] = [
{ key: 'elements', label: '원소', icon: '⚗️' },
{ key: 'evolution', label: '강화', icon: '⬆️' },
{ key: 'fusion', label: '합성', icon: '🔮' },
{ key: 'shop', label: '상점', icon: '🛒' },
{ key: 'achievements', label: '업적', icon: '🏆' },
{ key: 'settings', label: '설정', icon: '⚙️' },
];
interface BottomTabBarProps {
activeTab: TabName;
onTabChange: (tab: TabName) => void;
}
const containerStyle = css`
position: fixed;
bottom: 0;
left: 0;
right: 0;
display: flex;
background-color: #ffffff;
border-top: 1px solid #e8e8e8;
padding-bottom: env(safe-area-inset-bottom, 0px);
z-index: 100;
`;
const tabItemStyle = css`
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 8px 0 10px;
cursor: pointer;
background: none;
border: none;
gap: 4px;
`;
const iconStyle = css`
font-size: 22px;
line-height: 1;
`;
const labelStyle = (active: boolean) => css`
font-size: 10px;
font-weight: ${active ? 600 : 400};
color: ${active ? '#3182F6' : '#8b8b8b'};
letter-spacing: -0.2px;
`;
export function BottomTabBar({ activeTab, onTabChange }: BottomTabBarProps) {
return (
<nav css={containerStyle}>
{TABS.map((tab) => (
<button key={tab.key} css={tabItemStyle} onClick={() => onTabChange(tab.key)}>
<span css={iconStyle}>{tab.icon}</span>
<span css={labelStyle(activeTab === tab.key)}>{tab.label}</span>
</button>
))}
</nav>
);
}