feat: 앱 출시 빌드 설정(eas.json·권한 정리), 안드로이드 시트 키보드가 입력칸 가리던 것·첫 화면 테마 경고 수정
This commit is contained in:
1 parent
1bc39655c9
commit
dd2d02758b
5 files changed
+59
-9
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import { subscribeAuth } from '@nalssigak/shared/api/auth';
|
||||
import { useCallback, useEffect, useMemo, useState, type ReactNode } from 'react';
|
||||
import { KeyboardAvoidingView, Modal, Platform, Pressable, Text, View } from 'react-native';
|
||||
import { KeyboardAvoidingView, Modal, Pressable, Text, View } from 'react-native';
|
||||
import Animated, { Easing, useAnimatedStyle, useReducedMotion, useSharedValue, withTiming } from 'react-native-reanimated';
|
||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||
|
||||
@@ -65,7 +65,8 @@ function SheetHost({ state: next, onClose }: { state: SheetState; onClose: () =>
|
||||
|
||||
return (
|
||||
<Modal visible={next != null} transparent animationType="fade" onRequestClose={onClose} statusBarTranslucent>
|
||||
<KeyboardAvoidingView behavior={Platform.OS === 'ios' ? 'padding' : undefined} className="flex-1 justify-end">
|
||||
{/* 안드로이드도 화면 끝까지 그려(edge-to-edge) 창이 줄지 않으니 양쪽 모두 키보드 높이만큼 밀어 올린다 */}
|
||||
<KeyboardAvoidingView behavior="padding" className="flex-1 justify-end">
|
||||
<Pressable onPress={onClose} accessibilityLabel="닫기" className="absolute inset-0 bg-[rgb(20_26_45/0.45)]" />
|
||||
{state && (
|
||||
<Rise key={opens}>
|
||||
|
||||
+11
-2
@@ -7,6 +7,16 @@ export type SkyApi = { kind: TimeKind; preview: TimeKind | null; setServerKind:
|
||||
|
||||
const SkyContext = createContext<SkyApi | null>(null);
|
||||
|
||||
/** 밤에만 어두운 테마 (기기 다크 모드와 상관없이 하늘 시간대를 따른다). 같으면 건드리지 않는다 */
|
||||
function applyTheme(kind: TimeKind) {
|
||||
const theme = kind === 'night' ? 'dark' : 'light';
|
||||
if (Uniwind.currentTheme !== theme) Uniwind.setTheme(theme);
|
||||
}
|
||||
|
||||
// 첫 화면을 그리기 전에 지금 시각의 테마로 맞춰, 그리는 도중에 테마가 바뀌지 않게 한다
|
||||
const t0 = kst(new Date());
|
||||
applyTheme(kindOfHour(t0.h, t0.mo, t0.mi));
|
||||
|
||||
export function useSky() {
|
||||
const ctx = use(SkyContext);
|
||||
if (!ctx) throw new Error('useSky must be used inside SkyProvider');
|
||||
@@ -23,8 +33,7 @@ export function SkyProvider({ children }: { children: ReactNode }) {
|
||||
}, []);
|
||||
const t = kst(now);
|
||||
const kind = preview ?? serverKind ?? kindOfHour(t.h, t.mo, t.mi);
|
||||
// 밤에만 어두운 테마 (기기 다크 모드와 상관없이 하늘 시간대를 따른다)
|
||||
useEffect(() => Uniwind.setTheme(kind === 'night' ? 'dark' : 'light'), [kind]);
|
||||
useEffect(() => applyTheme(kind), [kind]);
|
||||
const api = useMemo(() => ({ kind, preview, setPreview, setServerKind }), [kind, preview]);
|
||||
return <SkyContext value={api}>{children}</SkyContext>;
|
||||
}
|
||||
Reference in new issue
Block a user