feat: 앱 나머지 화면 이전 — 게시물 카드·시트·각/노을/주말/계절 탭·움직임
- 게시물 카드 슬라이드 7종, 좋아요·댓글, 텍스트 공유 - 시트 7종(RN Modal), 위 막대 지역·계절·로그인/아바타 - 각·노을·주말·행사·계절·상식 탭, 당겨서 새로고침 - 히어로 해·구름·비·눈 움직임, 스켈레톤 깜빡임, 첫 로딩 덮개, 하늘색 전환
This commit is contained in:
1 parent
28ff032160
commit
f71dd2cebb
33 files changed
+2786
-75
No files matched your search
@@ -0,0 +1,72 @@
|
||||
import type { ReactNode, Ref } from 'react';
|
||||
import { ScrollView, Text, TextInput, View, type TextInputProps } from 'react-native';
|
||||
import Svg, { Path } from 'react-native-svg';
|
||||
|
||||
import { Skel } from '@/components/ui';
|
||||
import { useSky } from '@/lib/sky';
|
||||
|
||||
/** 웹의 연한 판(#f3f6fb)·입력칸·따뜻한 판(#fff4ec)을 밤엔 어두운 판으로 */
|
||||
export function useSoft() {
|
||||
const night = useSky().kind === 'night';
|
||||
return {
|
||||
soft: night ? '#2b3470' : '#f3f6fb',
|
||||
field: night ? '#2b3470' : '#f7f9fc',
|
||||
fieldBorder: night ? 'rgba(255,255,255,0.12)' : '#dfe5ee',
|
||||
warm: night ? 'rgba(255,138,87,0.16)' : '#fff4ec',
|
||||
bar: night ? 'rgba(255,255,255,0.12)' : '#e3eaf4',
|
||||
placeholder: night ? '#a1a9db' : '#8a92aa',
|
||||
};
|
||||
}
|
||||
|
||||
export function Body({ children, className }: { children: ReactNode; className?: string }) {
|
||||
return (
|
||||
<ScrollView className="shrink" contentContainerClassName={`px-4 pt-3.5 pb-[18px] ${className ?? ''}`} keyboardShouldPersistTaps="handled">
|
||||
{children}
|
||||
</ScrollView>
|
||||
);
|
||||
}
|
||||
|
||||
/** 입력칸: 둥근 연한 판 */
|
||||
export function Field({ round = false, style, ...props }: TextInputProps & { round?: boolean; ref?: Ref<TextInput> }) {
|
||||
const s = useSoft();
|
||||
return (
|
||||
<TextInput
|
||||
placeholderTextColor={s.placeholder}
|
||||
className={`px-3.5 text-[16px] text-ink ${round ? 'rounded-full py-2.5' : 'rounded-[14px] py-3'}`}
|
||||
style={[{ backgroundColor: s.field, borderWidth: 1, borderColor: s.fieldBorder }, style]}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export function HeartIcon({ size, fill, stroke }: { size: number; fill: string; stroke: string }) {
|
||||
return (
|
||||
<Svg viewBox="0 0 24 24" width={size} height={size} fill={fill} stroke={stroke} strokeWidth={2}>
|
||||
<Path d="M12 20.5s-8-4.9-8-11A4.6 4.6 0 0 1 12 6.8a4.6 4.6 0 0 1 8 2.7c0 6.1-8 11-8 11z" />
|
||||
</Svg>
|
||||
);
|
||||
}
|
||||
|
||||
const N3 = [0, 1, 2];
|
||||
|
||||
/** 읽을거리·이번 주 특집: 그림 150px · 머리말 · 제목 · 본문 */
|
||||
export function ArticleSkel() {
|
||||
return (
|
||||
<View className="gap-2.5">
|
||||
<View className="h-[150px] rounded-[20px] bg-skel" />
|
||||
<Skel className="w-24" />
|
||||
<Skel className="h-6 w-4/5" />
|
||||
{N3.map((k) => (
|
||||
<View key={k} className="gap-1.5">
|
||||
<Skel className="w-full" />
|
||||
<Skel className="w-2/3" />
|
||||
</View>
|
||||
))}
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
/** 빨간 안내 한 줄 (자리 높이는 그대로) */
|
||||
export function ErrorLine({ text, className }: { text?: string; className?: string }) {
|
||||
return <Text className={`min-h-5 text-center text-[13px] font-bold text-heart ${className ?? ''}`}>{text ?? ''}</Text>;
|
||||
}
|
||||
Reference in new issue
Block a user