feat: React Native(Expo) 앱 추가 — 탭 구조와 오늘 화면
- Expo SDK 57 + expo-router, react-query, Uniwind(Tailwind v4), SecureStore 토큰 - Metro 가 앱의 react(19.2.3)만 쓰게 고정 (루트에는 웹용 react 19.3.0) - 탭 5개·위 막대·시간대 하늘 배경·밤 테마, 오늘 히어로·각 순위·행사/TOP5/계절 띠 - 남은 이전 작업은 TODO.md 앱 마이그레이션 표
This commit is contained in:
1 parent
2ab2271d61
commit
e52f93fdbb
56 files changed
+1211
No files matched your search
@@ -0,0 +1,55 @@
|
||||
import { getSeasonWeekOptions } from '@nalssigak/shared/api/client/@tanstack/react-query.gen';
|
||||
import { kst, seasonOf } from '@nalssigak/shared/lib';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { usePathname } from 'expo-router';
|
||||
import { useState } from 'react';
|
||||
import { Text, View } from 'react-native';
|
||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||
import { useCSSVariable } from 'uniwind';
|
||||
|
||||
import { PinIcon } from '@/components/svg';
|
||||
import { Ic } from '@/components/ui';
|
||||
import { useRegion } from '@/lib/region';
|
||||
import { useSky } from '@/lib/sky';
|
||||
|
||||
const TITLES: Record<string, string> = { '/sky': '노을', '/gak': '오늘의 각', '/week': '주말·행사', '/season': '계절·상식' };
|
||||
|
||||
/** 로고 옆 계절 칩: 계절 이름과 지금 절기 */
|
||||
function SeasonChip() {
|
||||
const week = useQuery(getSeasonWeekOptions());
|
||||
const [month] = useState(() => kst(new Date()).mo);
|
||||
const [name, icon] = seasonOf(month);
|
||||
const term = week.data?.term_now?.name;
|
||||
return (
|
||||
<View className="shrink flex-row items-center gap-1 rounded-full bg-card/70 py-1 pr-2.5 pl-1.5">
|
||||
<Ic name={icon} size={18} />
|
||||
<Text numberOfLines={1} className="text-[13px] font-extrabold text-ink">
|
||||
{name}
|
||||
{term && <Text className="font-bold opacity-70"> · {term}</Text>}
|
||||
</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
export function TopBar() {
|
||||
const pathname = usePathname();
|
||||
const { region } = useRegion();
|
||||
const { kind } = useSky();
|
||||
const { top } = useSafeAreaInsets();
|
||||
const ink = String(useCSSVariable('--color-ink'));
|
||||
const title = TITLES[pathname];
|
||||
return (
|
||||
<View style={{ paddingTop: top, backgroundColor: kind === 'night' ? 'rgb(14 20 51 / 0.35)' : 'rgb(255 255 255 / 0.18)' }}>
|
||||
<View className="h-[54px] flex-row items-center gap-2 px-4">
|
||||
{title ? <Text className="font-jua text-[22px] text-ink">{title}</Text> : <Text className="font-jua text-[25px] text-orange">날씨각</Text>}
|
||||
<SeasonChip />
|
||||
<View className="ml-auto shrink-0 flex-row items-center gap-1 rounded-full border-b-4 border-shade bg-card px-3 pt-1 pb-1.5">
|
||||
<PinIcon size={14} color={ink} />
|
||||
<Text numberOfLines={1} className="text-[13.5px] font-bold text-ink">
|
||||
{region.name.split(' ').at(-1)}
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user