From fbebdcb79676bcf789304b4fcd924e825f07772f Mon Sep 17 00:00:00 2001 From: Mina Choi Date: Mon, 26 Oct 2026 09:45:00 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=95=88=EB=93=9C=EB=A1=9C=EC=9D=B4?= =?UTF-8?q?=EB=93=9C=20=EC=95=B1=EC=97=90=EC=84=9C=20=ED=95=9C=EA=B8=80?= =?UTF-8?q?=EC=9D=B4=20=EB=8B=A8=EC=96=B4=20=EC=A4=91=EA=B0=84=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EC=A4=84=EB=B0=94=EA=BF=88=EB=90=98=EB=8D=98=20?= =?UTF-8?q?=EA=B2=83=20(=EB=9D=84=EC=96=B4=EC=93=B0=EA=B8=B0=EC=97=90?= =?UTF-8?q?=EC=84=9C=EB=A7=8C=20=EC=A4=84=EC=9D=B4=20=EB=B0=94=EB=80=8C?= =?UTF-8?q?=EA=B2=8C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mobile/src/app/gak.tsx | 3 ++- mobile/src/app/week.tsx | 3 ++- mobile/src/components/first-load.tsx | 3 ++- mobile/src/components/gak/grid.tsx | 3 ++- mobile/src/components/gak/podium.tsx | 3 ++- mobile/src/components/post/post-card.tsx | 3 ++- mobile/src/components/post/slides.tsx | 3 ++- mobile/src/components/season/parts.tsx | 3 ++- mobile/src/components/sheets/article.tsx | 3 ++- mobile/src/components/sheets/gak.tsx | 3 ++- mobile/src/components/sheets/index.tsx | 3 ++- mobile/src/components/sheets/parts.tsx | 3 ++- mobile/src/components/sheets/region.tsx | 3 ++- mobile/src/components/sky/parts.tsx | 3 ++- mobile/src/components/tab-bar.tsx | 3 ++- mobile/src/components/text.tsx | 18 ++++++++++++++++++ mobile/src/components/today/hero.tsx | 3 ++- mobile/src/components/today/rails.tsx | 3 ++- mobile/src/components/top-bar.tsx | 3 ++- mobile/src/components/ui.tsx | 3 ++- mobile/src/components/week/sections.tsx | 3 ++- 21 files changed, 58 insertions(+), 20 deletions(-) create mode 100644 mobile/src/components/text.tsx diff --git a/mobile/src/app/gak.tsx b/mobile/src/app/gak.tsx index 7813e90..0e044b8 100644 --- a/mobile/src/app/gak.tsx +++ b/mobile/src/app/gak.tsx @@ -3,7 +3,8 @@ import { ArticleCategory, IndexCategory } from '@nalssigak/shared/api/client/typ import { kst, loadOf, seasonOf } from '@nalssigak/shared/lib'; import { useQuery } from '@tanstack/react-query'; import { useState } from 'react'; -import { Pressable, RefreshControl, ScrollView, Text, View } from 'react-native'; +import { Pressable, RefreshControl, ScrollView, View } from 'react-native'; +import { Text } from '@/components/text'; import { GakGrid, GridSkel } from '@/components/gak/grid'; import { Podium, PodiumSkel } from '@/components/gak/podium'; diff --git a/mobile/src/app/week.tsx b/mobile/src/app/week.tsx index d4d2118..1287cf3 100644 --- a/mobile/src/app/week.tsx +++ b/mobile/src/app/week.tsx @@ -2,7 +2,8 @@ import { getWeekOptions, getWeekRankingOptions, listEventsOptions, listPlacesOpt import { loadOf, shortDay } from '@nalssigak/shared/lib'; import { useQuery } from '@tanstack/react-query'; import { useRef, useState } from 'react'; -import { Pressable, RefreshControl, ScrollView, Text, View } from 'react-native'; +import { Pressable, RefreshControl, ScrollView, View } from 'react-native'; +import { Text } from '@/components/text'; import { DayStrip, EventRow, PickCard, PlaceCard, RankRow } from '@/components/week/sections'; import { DaysSkel, EventsSkel, PickSkel, PlacesSkel, RankSkel } from '@/components/week/skels'; diff --git a/mobile/src/components/first-load.tsx b/mobile/src/components/first-load.tsx index 3294d22..10743c5 100644 --- a/mobile/src/components/first-load.tsx +++ b/mobile/src/components/first-load.tsx @@ -1,7 +1,8 @@ import type { TimeKind } from '@nalssigak/shared/lib'; import { useQueryClient } from '@tanstack/react-query'; import { useEffect, useState } from 'react'; -import { StyleSheet, Text, View } from 'react-native'; +import { StyleSheet, View } from 'react-native'; +import { Text } from '@/components/text'; import Animated, { cancelAnimation, Easing, useAnimatedStyle, useReducedMotion, useSharedValue, withRepeat, withSequence, withTiming } from 'react-native-reanimated'; import { Ic } from '@/components/ui'; diff --git a/mobile/src/components/gak/grid.tsx b/mobile/src/components/gak/grid.tsx index 1dfe9ee..d24e4f5 100644 --- a/mobile/src/components/gak/grid.tsx +++ b/mobile/src/components/gak/grid.tsx @@ -1,5 +1,6 @@ import type { IndexSummary } from '@nalssigak/shared/api/client/types.gen'; -import { Pressable, Text, View } from 'react-native'; +import { Pressable, View } from 'react-native'; +import { Text } from '@/components/text'; import { Ic, Skel } from '@/components/ui'; import { useSheet } from '@/lib/sheet'; diff --git a/mobile/src/components/gak/podium.tsx b/mobile/src/components/gak/podium.tsx index 6ade3d9..54846d0 100644 --- a/mobile/src/components/gak/podium.tsx +++ b/mobile/src/components/gak/podium.tsx @@ -1,7 +1,8 @@ import type { IndexSummary } from '@nalssigak/shared/api/client/types.gen'; import { MEDALS } from '@nalssigak/shared/lib'; import { LinearGradient } from 'expo-linear-gradient'; -import { Pressable, Text, View } from 'react-native'; +import { Pressable, View } from 'react-native'; +import { Text } from '@/components/text'; import { Ic, Skel } from '@/components/ui'; import { useSheet } from '@/lib/sheet'; diff --git a/mobile/src/components/post/post-card.tsx b/mobile/src/components/post/post-card.tsx index 4ea6713..5180752 100644 --- a/mobile/src/components/post/post-card.tsx +++ b/mobile/src/components/post/post-card.tsx @@ -3,7 +3,8 @@ import { PostType, type PostData, type ResFeed } from '@nalssigak/shared/api/cli import { useMutation, useQueryClient, type QueryClient } from '@tanstack/react-query'; import { LinearGradient } from 'expo-linear-gradient'; import { useEffect, useRef, useState } from 'react'; -import { Animated, Pressable, Text, View } from 'react-native'; +import { Animated, Pressable, View } from 'react-native'; +import { Text } from '@/components/text'; import Svg, { Path } from 'react-native-svg'; import { useCSSVariable } from 'uniwind'; diff --git a/mobile/src/components/post/slides.tsx b/mobile/src/components/post/slides.tsx index 42e4cdc..fc0a3fd 100644 --- a/mobile/src/components/post/slides.tsx +++ b/mobile/src/components/post/slides.tsx @@ -6,7 +6,8 @@ import { deg } from '@nalssigak/shared/lib/weatherText'; import { Image } from 'expo-image'; import { LinearGradient } from 'expo-linear-gradient'; import type { ReactNode } from 'react'; -import { Pressable, StyleSheet, Text, View } from 'react-native'; +import { Pressable, StyleSheet, View } from 'react-native'; +import { Text } from '@/components/text'; import Svg, { Polygon } from 'react-native-svg'; import { Credit, Ic, Rows, Thumb } from '@/components/ui'; diff --git a/mobile/src/components/season/parts.tsx b/mobile/src/components/season/parts.tsx index 84fa103..d4229f2 100644 --- a/mobile/src/components/season/parts.tsx +++ b/mobile/src/components/season/parts.tsx @@ -1,7 +1,8 @@ import type { ArticleSummary, ResSeasonWeek } from '@nalssigak/shared/api/client/types.gen'; import { ARTICLE_LABEL, cardBg, dateRange, shortDay } from '@nalssigak/shared/lib'; import { LinearGradient } from 'expo-linear-gradient'; -import { Pressable, Text, View } from 'react-native'; +import { Pressable, View } from 'react-native'; +import { Text } from '@/components/text'; import { Fall } from '@/components/fall'; import { Credit, Ic, Skel, Thumb } from '@/components/ui'; diff --git a/mobile/src/components/sheets/article.tsx b/mobile/src/components/sheets/article.tsx index 044ef22..ed193a4 100644 --- a/mobile/src/components/sheets/article.tsx +++ b/mobile/src/components/sheets/article.tsx @@ -3,7 +3,8 @@ import { ARTICLE_LABEL, articleMeta, cardBg, dateRange, loadOf, shortDay } from import { useQuery } from '@tanstack/react-query'; import { LinearGradient } from 'expo-linear-gradient'; import { useEffect } from 'react'; -import { Pressable, Text, View } from 'react-native'; +import { Pressable, View } from 'react-native'; +import { Text } from '@/components/text'; import { Credit, Ic, StateBox, Thumb } from '@/components/ui'; import { CARD_BG } from '@/lib/colors'; diff --git a/mobile/src/components/sheets/gak.tsx b/mobile/src/components/sheets/gak.tsx index 1b9ca85..1bbde8f 100644 --- a/mobile/src/components/sheets/gak.tsx +++ b/mobile/src/components/sheets/gak.tsx @@ -4,7 +4,8 @@ import { loadOf } from '@nalssigak/shared/lib'; import { useQuery } from '@tanstack/react-query'; import { LinearGradient } from 'expo-linear-gradient'; import { useEffect } from 'react'; -import { Text, View } from 'react-native'; +import { View } from 'react-native'; +import { Text } from '@/components/text'; import Svg, { Circle, Line, Polygon, Text as SvgText, TSpan } from 'react-native-svg'; import { Ic, Skel, StateBox } from '@/components/ui'; diff --git a/mobile/src/components/sheets/index.tsx b/mobile/src/components/sheets/index.tsx index 64db845..046cde0 100644 --- a/mobile/src/components/sheets/index.tsx +++ b/mobile/src/components/sheets/index.tsx @@ -1,6 +1,7 @@ import { subscribeAuth } from '@nalssigak/shared/api/auth'; import { useCallback, useEffect, useMemo, useState, type ReactNode } from 'react'; -import { KeyboardAvoidingView, Modal, Pressable, Text, View } from 'react-native'; +import { KeyboardAvoidingView, Modal, Pressable, View } from 'react-native'; +import { Text } from '@/components/text'; import Animated, { Easing, useAnimatedStyle, useReducedMotion, useSharedValue, withTiming } from 'react-native-reanimated'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; diff --git a/mobile/src/components/sheets/parts.tsx b/mobile/src/components/sheets/parts.tsx index f3e47f6..0664030 100644 --- a/mobile/src/components/sheets/parts.tsx +++ b/mobile/src/components/sheets/parts.tsx @@ -1,5 +1,6 @@ import type { ReactNode, Ref } from 'react'; -import { ScrollView, Text, TextInput, View, type TextInputProps } from 'react-native'; +import { ScrollView, TextInput, View, type TextInputProps } from 'react-native'; +import { Text } from '@/components/text'; import Svg, { Path } from 'react-native-svg'; import { Skel } from '@/components/ui'; diff --git a/mobile/src/components/sheets/region.tsx b/mobile/src/components/sheets/region.tsx index d75fd4f..20927bf 100644 --- a/mobile/src/components/sheets/region.tsx +++ b/mobile/src/components/sheets/region.tsx @@ -2,7 +2,8 @@ import { listRegionsOptions } from '@nalssigak/shared/api/client/@tanstack/react import { loadOf } from '@nalssigak/shared/lib'; import { useQuery } from '@tanstack/react-query'; import { useDeferredValue, useEffect, useRef, useState } from 'react'; -import { Pressable, Text, View } from 'react-native'; +import { Pressable, View } from 'react-native'; +import { Text } from '@/components/text'; import { Skel, StateBox } from '@/components/ui'; import { useAuth } from '@/lib/auth'; diff --git a/mobile/src/components/sky/parts.tsx b/mobile/src/components/sky/parts.tsx index 61aad78..209c280 100644 --- a/mobile/src/components/sky/parts.tsx +++ b/mobile/src/components/sky/parts.tsx @@ -2,7 +2,8 @@ import type { BestTime, SkyPlanData } from '@nalssigak/shared/api/client/types.g import { clockShort } from '@nalssigak/shared/lib'; import { LinearGradient } from 'expo-linear-gradient'; import { useState, type ReactNode } from 'react'; -import { Pressable, Text, View } from 'react-native'; +import { Pressable, View } from 'react-native'; +import { Text } from '@/components/text'; import { useCSSVariable } from 'uniwind'; import { RAIL, skyOf } from '@/components/sky/colors'; diff --git a/mobile/src/components/tab-bar.tsx b/mobile/src/components/tab-bar.tsx index ececc72..0ba38ec 100644 --- a/mobile/src/components/tab-bar.tsx +++ b/mobile/src/components/tab-bar.tsx @@ -1,6 +1,7 @@ import type { BottomTabBarProps } from 'expo-router/tabs'; import { LinearGradient } from 'expo-linear-gradient'; -import { Pressable, Text, View } from 'react-native'; +import { Pressable, View } from 'react-native'; +import { Text } from '@/components/text'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { useCSSVariable } from 'uniwind'; diff --git a/mobile/src/components/text.tsx b/mobile/src/components/text.tsx new file mode 100644 index 0000000..3ecaa15 --- /dev/null +++ b/mobile/src/components/text.tsx @@ -0,0 +1,18 @@ +import { Children, type ReactNode } from 'react'; +import { Platform, Text as RNText, type TextProps } from 'react-native'; + +const WORD_JOINER = '\u2060'; +const HANGUL = /[\uAC00-\uD7A3]/; + +/** 안드로이드는 한글을 글자마다 끊어서, 단어 안쪽에 줄바꿈 금지 문자를 넣어 띄어쓰기에서만 줄이 바뀌게 한다 */ +function keepWords(s: string): string { + return HANGUL.test(s) ? s.replace(/\S+/g, (w) => Array.from(w).join(WORD_JOINER)) : s; +} + +function wrap(children: ReactNode): ReactNode { + return Children.map(children, (c) => (typeof c === 'string' ? keepWords(c) : c)); +} + +export function Text({ children, ...props }: TextProps) { + return {Platform.OS === 'android' ? wrap(children) : children}; +} diff --git a/mobile/src/components/today/hero.tsx b/mobile/src/components/today/hero.tsx index ede5c5f..a6b03d5 100644 --- a/mobile/src/components/today/hero.tsx +++ b/mobile/src/components/today/hero.tsx @@ -3,7 +3,8 @@ import { kindOfHour, kst, type Load, type TimeKind, WEEKDAYS } from '@nalssigak/ import { KINDS, moonPath, PREVIEW, SLOT_KEY, WANING, type Weather, WEATHER_ICON, weatherOf } from '@nalssigak/shared/lib/today'; import { deg, slotAt } from '@nalssigak/shared/lib/weatherText'; import { useEffect, useState, type ReactNode } from 'react'; -import { Pressable, Text, View, type DimensionValue, type ViewStyle } from 'react-native'; +import { Pressable, View, type DimensionValue, type ViewStyle } from 'react-native'; +import { Text } from '@/components/text'; import Animated, { cancelAnimation, Easing, useAnimatedStyle, useReducedMotion, useSharedValue, withDelay, withRepeat, withTiming } from 'react-native-reanimated'; import { LinearGradient } from 'expo-linear-gradient'; import Svg, { Defs, Path, RadialGradient, Rect, Stop } from 'react-native-svg'; diff --git a/mobile/src/components/today/rails.tsx b/mobile/src/components/today/rails.tsx index 9ad048a..ae26ac1 100644 --- a/mobile/src/components/today/rails.tsx +++ b/mobile/src/components/today/rails.tsx @@ -3,7 +3,8 @@ import { cardBg, MEDALS } from '@nalssigak/shared/lib'; import { LinearGradient } from 'expo-linear-gradient'; import { Link, type Href } from 'expo-router'; import type { ReactNode } from 'react'; -import { Pressable, Text, View } from 'react-native'; +import { Pressable, View } from 'react-native'; +import { Text } from '@/components/text'; import { Ic, Rail, Sec, Skel, Thumb } from '@/components/ui'; import { CARD_BG, BAND_BG } from '@/lib/colors'; diff --git a/mobile/src/components/top-bar.tsx b/mobile/src/components/top-bar.tsx index 0c4f79c..44ca30e 100644 --- a/mobile/src/components/top-bar.tsx +++ b/mobile/src/components/top-bar.tsx @@ -3,7 +3,8 @@ import { kst, seasonOf } from '@nalssigak/shared/lib'; import { useQuery } from '@tanstack/react-query'; import { usePathname } from 'expo-router'; import { useState } from 'react'; -import { Pressable, Text, View } from 'react-native'; +import { Pressable, View } from 'react-native'; +import { Text } from '@/components/text'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { useCSSVariable } from 'uniwind'; diff --git a/mobile/src/components/ui.tsx b/mobile/src/components/ui.tsx index 0ca625e..34f0699 100644 --- a/mobile/src/components/ui.tsx +++ b/mobile/src/components/ui.tsx @@ -4,7 +4,8 @@ import { LinearGradient } from 'expo-linear-gradient'; import { Link, type Href } from 'expo-router'; import { useEffect, useState, type ReactNode } from 'react'; import Animated, { cancelAnimation, Easing, useAnimatedStyle, useReducedMotion, useSharedValue, withRepeat, withTiming } from 'react-native-reanimated'; -import { Linking, Pressable, ScrollView, Text, View, type StyleProp, type ViewStyle } from 'react-native'; +import { Linking, Pressable, ScrollView, View, type StyleProp, type ViewStyle } from 'react-native'; +import { Text } from '@/components/text'; import { ICONS } from '@/lib/icons'; import { imageUri } from '@/lib/site'; diff --git a/mobile/src/components/week/sections.tsx b/mobile/src/components/week/sections.tsx index 0569a04..9a357ba 100644 --- a/mobile/src/components/week/sections.tsx +++ b/mobile/src/components/week/sections.tsx @@ -1,7 +1,8 @@ import type { EventData, PlaceData, WeekRankItem, DayData } from '@nalssigak/shared/api/client/types.gen'; import { cardBg, dateRange } from '@nalssigak/shared/lib'; import { LinearGradient } from 'expo-linear-gradient'; -import { Pressable, ScrollView, Text, View } from 'react-native'; +import { Pressable, ScrollView, View } from 'react-native'; +import { Text } from '@/components/text'; import { Credit, Ic, MapLink, Thumb } from '@/components/ui'; import { CARD_BG } from '@/lib/colors';