- V3 모바일 마스터 플랜 작성 (docs/v3/00-mobile-master-plan.md) 11개 Phase, 5주 로드맵, 전략 결정사항 확정 - 7개 디자인 HTML 레퍼런스 저장 (docs/v3/designs/) - app.json → app.config.ts 전환 + 환경변수 체계 - 5탭 네비게이션 (DASH/HIST/REC FAB/TALK/SET) - metro.config.js monorepo 격리 (root RN 0.84 충돌 해결) - ui-native 테마 디자인 목업 색상 동기화 - SafeArea 적용 (useSafeAreaInsets) - DEV 로그인 우회 (__DEV__ 전용) - Supabase .env 연동 - iOS 시뮬레이터 검증 완료
52 lines
1.7 KiB
TypeScript
52 lines
1.7 KiB
TypeScript
// packages/ui-native/src/components/PhosphorText.tsx
|
|
// RN용 PhosphorText — Text + 앰버 glow (textShadowColor)
|
|
|
|
import { Text, Platform, type TextProps, type TextStyle, type StyleProp } from 'react-native'
|
|
import { d3roNativePalette, d3roNativeTypo, type D3roNativeTypoKey } from '../theme'
|
|
|
|
export type PhosphorVariant = D3roNativeTypoKey
|
|
|
|
export interface PhosphorTextProps extends TextProps {
|
|
variant?: PhosphorVariant
|
|
color?: 'amber' | 'primary' | 'secondary' | 'label' | 'muted'
|
|
style?: StyleProp<TextStyle>
|
|
}
|
|
|
|
export function PhosphorText({
|
|
children,
|
|
variant = 'body',
|
|
color,
|
|
style,
|
|
...rest
|
|
}: PhosphorTextProps): React.ReactElement {
|
|
const typo = d3roNativeTypo[variant]
|
|
const isAmberVariant = variant === 'hero' || variant === 'title' || variant === 'value'
|
|
|
|
const resolvedColor: string = (() => {
|
|
if (color === 'amber') return d3roNativePalette.accent.amber
|
|
if (color === 'primary') return d3roNativePalette.text.primary
|
|
if (color === 'secondary') return d3roNativePalette.text.secondary
|
|
if (color === 'label') return d3roNativePalette.text.label
|
|
if (color === 'muted') return d3roNativePalette.text.muted
|
|
return isAmberVariant ? d3roNativePalette.accent.amber : d3roNativePalette.text.primary
|
|
})()
|
|
|
|
const baseStyle: TextStyle = {
|
|
...typo,
|
|
color: resolvedColor,
|
|
fontFamily: Platform.OS === 'ios' ? 'Menlo' : 'monospace',
|
|
...(isAmberVariant
|
|
? {
|
|
textShadowColor: d3roNativePalette.accent.amberGlow,
|
|
textShadowOffset: { width: 0, height: 0 },
|
|
textShadowRadius: 6
|
|
}
|
|
: {})
|
|
}
|
|
|
|
return (
|
|
<Text style={[baseStyle, style]} {...rest}>
|
|
{children}
|
|
</Text>
|
|
)
|
|
}
|