fix: 앱이 켜자마자 꺼지던 것 — 서버가 빈 문자열(노을 line 등)을 주면 '&&'가 빈 글자를 View 안에 그려 안드로이드에서 'Text strings must be rendered within a <Text>'로 종료됨. 문자열 조건을 !!로 감쌈

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
skkimandClaude committed 2026-11-04 16:54:28 +09:00
1 parent fcc7ed804c
commit 709dcf742e
6 files changed
+16 -16

No files matched your search

+1 -1
View File
@@ -35,7 +35,7 @@ export function GakGrid({ items, dim }: { items: IndexSummary[]; dim: boolean })
className={`${CELL} ${g.active ? '' : 'opacity-55'}`}
>
{g.active && <Text className="absolute top-[7px] left-[9px] font-jua text-[13px] text-ink3">{g.rank}</Text>}
{g.season && <Text className="absolute top-2 right-2 text-[10.5px] font-extrabold text-[#1f9d62]">{g.season}</Text>}
{!!g.season && <Text className="absolute top-2 right-2 text-[10.5px] font-extrabold text-[#1f9d62]">{g.season}</Text>}
<Ic name={g.icon} size={50} />
<Text numberOfLines={1} className="mt-1 font-jua text-[15px] text-ink">
{g.name}
+1 -1
View File
@@ -48,7 +48,7 @@ export function Podium({ top, dim }: { top: IndexSummary[]; dim: boolean }) {
</Text>
</View>
<Text className="font-bagel text-[30px] leading-[32px] text-orange">{g.score}</Text>
{g.summary && <Text className="text-center text-[11.5px] font-semibold text-ink2">{g.summary}</Text>}
{!!g.summary && <Text className="text-center text-[11.5px] font-semibold text-ink2">{g.summary}</Text>}
</Pressable>
);
})}
+4 -4
View File
@@ -170,7 +170,7 @@ export function SlideView({ slide, bg }: { slide: Slide; bg: SlideBg }) {
<Eyebrow light>{slide.eyebrow}</Eyebrow>
{/* 노을 탭 히어로와 같은 순서: 결론 → 가장 붉을 때 → 쉬운 이유 */}
<Big light>{slide.headline ?? slide.grade_label}</Big>
{slide.line && <Text className="mt-0.5 font-jua text-[18px] text-white">{slide.line}</Text>}
{!!slide.line && <Text className="mt-0.5 font-jua text-[18px] text-white">{slide.line}</Text>}
<View className="mt-3 flex-1 gap-2">
{slide.cuts.map((c, i) => (
<View key={c.kind} className="flex-1 overflow-hidden rounded-2xl px-3 py-2">
@@ -224,7 +224,7 @@ export function SlideView({ slide, bg }: { slide: Slide; bg: SlideBg }) {
</View>
))}
</View>
{slide.tip && <Text className="mt-auto overflow-hidden rounded-[14px] bg-ink-btn px-3 py-2.5 text-[13px] leading-snug font-bold text-white">{slide.tip}</Text>}
{!!slide.tip && <Text className="mt-auto overflow-hidden rounded-[14px] bg-ink-btn px-3 py-2.5 text-[13px] leading-snug font-bold text-white">{slide.tip}</Text>}
</Base>
);
if (slide.kind === 'plan') {
@@ -246,7 +246,7 @@ export function SlideView({ slide, bg }: { slide: Slide; bg: SlideBg }) {
{st.sub}
</Text>
</View>
{st.image && <Thumb image={st.image} icon={st.icon} iconSize={26} className="size-[46px] rounded-[10px]" />}
{!!st.image && <Thumb image={st.image} icon={st.icon} iconSize={26} className="size-[46px] rounded-[10px]" />}
</View>
))}
</View>
@@ -258,7 +258,7 @@ export function SlideView({ slide, bg }: { slide: Slide; bg: SlideBg }) {
return (
<View className="flex-1 justify-end">
<Image source={{ uri: imageUri(slide.image) }} style={StyleSheet.absoluteFill} contentFit="cover" />
{slide.image_credit && <Credit text={slide.image_credit} className="top-2.5 right-2.5" />}
{!!slide.image_credit && <Credit text={slide.image_credit} className="top-2.5 right-2.5" />}
<View className="px-5 pt-20 pb-3.5">
<LinearGradient colors={['rgba(16,20,34,0)', 'rgba(16,20,34,0.55)', 'rgba(16,20,34,0.85)']} locations={[0, 0.35, 1]} style={StyleSheet.absoluteFill} />
<Eyebrow light>{slide.eyebrow}</Eyebrow>
+3 -3
View File
@@ -62,7 +62,7 @@ export function SeasonHead({ week: w, onPress }: { week: ResSeasonWeek; onPress:
<Text className="text-[13px] font-extrabold text-ink opacity-75">이번 주 특집{w.start && w.end ? ` · ${dateRange(w.start, w.end)}` : ''}</Text>
<Text className="mt-1 max-w-[62%] font-jua text-[29px] leading-tight text-ink">{w.headline}</Text>
{poem.length > 0 && <Text className="mt-auto max-w-[72%] pt-3 font-batang text-[22px] leading-[37px] text-ink">{poem.join('\n')}</Text>}
{w.term_now && w.term_next && (
{!!w.term_now && !!w.term_next && (
<View className={`max-w-[70%] ${poem.length ? 'mt-2.5' : 'mt-auto'}`}>
<View className="flex-row justify-between">
<Text className="text-xs font-extrabold text-ink2">
@@ -88,7 +88,7 @@ export function ArticleRow({ article: a, onPress }: { article: ArticleSummary; o
return (
<Pressable onPress={onPress} className={ROW}>
<View className="flex-1">
{ARTICLE_LABEL[a.category] && (
{!!ARTICLE_LABEL[a.category] && (
<Text className="text-xs font-extrabold" style={{ color }}>
{ARTICLE_LABEL[a.category]}
</Text>
@@ -98,7 +98,7 @@ export function ArticleRow({ article: a, onPress }: { article: ArticleSummary; o
</View>
<Thumb image={a.image} icon={a.icon} iconSize={54} className="h-[84px] w-[84px] rounded-[18px]">
<LinearGradient colors={CARD_BG[night ? 'night' : 'day'][cardBg(a.icon, a.article_id)]} style={{ position: 'absolute', inset: 0, zIndex: -1 }} />
{a.image && a.image_credit && <Credit text={a.image_credit} />}
{!!a.image && !!a.image_credit && <Credit text={a.image_credit} />}
</Thumb>
</Pressable>
);
+3 -3
View File
@@ -28,7 +28,7 @@ export function ArticleSheet({ articleId, onTitle }: { articleId: number; onTitl
<Body>
<Thumb image={a.image} icon={a.icon} iconSize={96} className="mb-3.5 h-[150px] rounded-[20px]">
<LinearGradient colors={CARD_BG[night ? 'night' : 'day'][cardBg(a.icon, a.article_id)]} style={{ position: 'absolute', inset: 0, zIndex: -1 }} />
{a.image && a.image_credit && <Credit text={a.image_credit} />}
{!!a.image && !!a.image_credit && <Credit text={a.image_credit} />}
</Thumb>
<Text className="text-[13px] font-extrabold text-ink2">{articleMeta(a)}</Text>
<Text className="mt-1.5 mb-2.5 font-jua text-2xl leading-tight text-ink">{a.title}</Text>
@@ -61,10 +61,10 @@ export function SeasonWeekSheet() {
<Text className="font-batang text-[17px] leading-[29px] text-ink">
{w.poem_lines?.join(' ')}
</Text>
{w.author && <Text className="text-xs font-semibold text-ink3">{w.author}</Text>}
{!!w.author && <Text className="text-xs font-semibold text-ink3">{w.author}</Text>}
</View>
)}
{w.term_now && w.term_next && (
{!!w.term_now && !!w.term_next && (
<Text className="mb-2.5 text-[15px] leading-[1.7] text-ink">
지금 절기는 {w.term_now.name}({shortDay(w.term_now.day)}), 다음 절기는 {w.term_next.name}({shortDay(w.term_next.day)})예요.
</Text>
+4 -4
View File
@@ -121,7 +121,7 @@ export function GakSheet({ indexId, onTitle }: { indexId: number; onTitle: (t: s
<Ic name={g.icon} size={58} />
<View className="flex-1">
<Text className="font-jua text-[22px] text-ink">{g.name}</Text>
{d.description && <Text className="mt-0.5 text-[13.5px] font-semibold text-ink2">{d.description}</Text>}
{!!d.description && <Text className="mt-0.5 text-[13.5px] font-semibold text-ink2">{d.description}</Text>}
</View>
<Text className={`font-bagel text-[42px] ${g.active ? 'text-orange' : 'text-ink3'}`}>{g.score}</Text>
</View>
@@ -194,7 +194,7 @@ export function GakSheet({ indexId, onTitle }: { indexId: number; onTitle: (t: s
))}
</View>
<View className="mt-3.5 gap-1.5">
{d.zero_reason && (
{!!d.zero_reason && (
<Text className="text-[13px] font-semibold text-ink2">
<Text className="font-bold text-heart">오늘 걸린 조건:</Text> {d.zero_reason}
</Text>
@@ -204,12 +204,12 @@ export function GakSheet({ indexId, onTitle }: { indexId: number; onTitle: (t: s
<Text className="font-bold text-ink">계산 방법:</Text> 요소 점수에 비중을 곱해 더하고, 가장 낮은 요소가 낮을수록 최대 25%까지 더 깎아요
</Text>
)}
{d.zero_rules && (
{!!d.zero_rules && (
<Text className="text-[13px] font-semibold text-ink2">
<Text className="font-bold text-ink">점수 깎이는 조건:</Text> {d.zero_rules}
</Text>
)}
{d.limit && (
{!!d.limit && (
<Text className="text-[13px] font-semibold text-ink2">
<Text className="font-bold text-ink">반영 못 한 것:</Text> {d.limit}
</Text>