Skip to content

[UI/#8] 공통 컴포넌트 1차 제작 및 기타 설정#11

Merged
Hyochan02 merged 13 commits into
mainfrom
ui/8-common-ui
Jul 5, 2026
Merged

[UI/#8] 공통 컴포넌트 1차 제작 및 기타 설정#11
Hyochan02 merged 13 commits into
mainfrom
ui/8-common-ui

Conversation

@yewon20804

@yewon20804 yewon20804 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

📌 관련 이슈번호

📌 PR 유형

어떤 변경 사항이 있나요?

  • 새 기능 추가
  • 버그 수정
  • 리팩토링

📌 PR 요약

  • cn 유틸함수 추가
  • 폰트 weight 적용 문제 수정
  • NativeWind가 src/ 하위 파일도 스캔하도록 content 경로 추가
  • 공통 UI 컴포넌트(Button, AddButton, AddScheduleButton, Toggle)를 추가
  • SVG 아이콘을 컴포넌트로 import해서 쓸 수 있도록 설정

📌 작업 세부 내용

1. cn 유틸 함수 추가 (clsx + tailwind-merge)

  • 커스텀 폰트 토큰 인식을 위해 classGroups 확장

2. SUIT 폰트 굵기별 family 매핑 수정

  • 기존 ios로 확인헀을때 font-weight:600에 대해 semiBold 매핑이 동작하지 않음
  • fontSize를 plugin 기반 유틸로 수정하여 굵기별로 직접 매핑 -> text-b-02-sb 이런식으로 작성하면 바로 적용됨

3. 피그마에서 추출한 아이콘.svg를 컴포넌트처럼 import해서 쓰도록 metro/타입 설정 추가

  • react-native-svg, react-native-svg-transformer 추가
  • .svg 확장자는 이미지처럼 취급하는 파일목록에서 제거하고 스크립트처럼 읽을 목록에 추가하여 컴포넌트 처럼 사용 가능
  • 아이콘은 stroke="currentColor"로 처리해 사용처에서 색상 지정 가능
  1. 공통 Button 컴포넌트 추가 (fill-green / fill-gray / stroke-green variant, disabled 상태 지원)
// 사용 예시
<Button label="LABEL" variant="fill-green" />
<Button label="LABEL" variant="fill-gray" />
<Button label="LABEL" variant="stroke-green" />
<Button label="LABEL" variant="fill-green" disabled />
  1. 공통 AddButton, AddScheduleButton 컴포넌트 추가
  2. 공통 Toggle 컴포넌트 추가
  • Reanimated로 노브 위치 애니메이션

📸 스크린샷 (선택)

2026-07-05.10.35.22.mov

🔗 기타 공지

  • UI 제작에 있어서 폰트, 아이콘 등 세팅한 내용이 있어서 받고 진행하면 좋을 것 같습니다 !
  • 앱바랑 모달 부분은 새로 이슈 파서 진행하겠습니다리

@yewon20804 yewon20804 requested a review from Hyochan02 July 5, 2026 12:09
@yewon20804 yewon20804 self-assigned this Jul 5, 2026
@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

SVG 임포트, Tailwind 텍스트 유틸리티, 앱 시작 폰트 로딩을 위한 설정이 추가되었고, 공통 버튼·토글·추가 버튼 컴포넌트와 cn 유틸이 새로 구현되었다.

Changes

SVG 및 스타일링 인프라 구성

Layer / File(s) Summary
의존성 추가
package.json
clsx, react-native-svg, tailwind-merge, react-native-svg-transformer가 추가됨.
SVG 임포트 지원 설정
metro.config.js, svg-env.d.ts, tsconfig.json
SVG를 source 확장자로 다루도록 Metro를 조정하고, *.svg 모듈 선언과 TypeScript 포함 경로를 추가함.
Tailwind 텍스트 유틸리티
tailwind.config.js
content 경로를 넓히고, 정적 fontSize 정의를 plugin 기반 .text-{name} 생성으로 바꾸며, fontFamily 구성을 확장함.
폰트 로딩 전환
app.json, app/_layout.tsx
expo-font 설정을 제거하고, useFontsSplashScreen으로 초기 렌더링을 제어하도록 변경함.

공통 UI 컴포넌트

Layer / File(s) Summary
클래스명 병합 유틸
src/lib/cn.ts
clsx와 tailwind-merge로 클래스 문자열을 병합하는 cn 함수를 추가함.
Button 컴포넌트
src/components/common/Button.tsx
variant와 disabled 상태를 지원하는 Pressable 기반 Button을 추가함.
Toggle 컴포넌트
src/components/common/Toggle.tsx
Reanimated로 knob 이동을 애니메이션하는 Toggle을 추가함.
AddButton / AddScheduleButton 컴포넌트
src/components/common/AddButton.tsx, src/components/common/AddScheduleButton.tsx
PlusIcon과 라벨을 표시하는 두 개의 추가 버튼 컴포넌트를 추가함.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Related issues: #8 [UI] 공통 컴포넌트 제작

Suggested labels: enhancement, ui, dependencies

Suggested reviewers: 프론트엔드 리뷰어

Poem

SVG가 길을 찾고
폰트는 로딩 뒤에 피어나며
버튼과 토글이 자리를 잡고
클래스들은 cn 아래서 하나로 묶인다

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning 이슈 #8의 버튼·토글은 반영했지만 앱바 컴포넌트가 없어 직접 이슈의 전체 요구를 충족하지 못합니다. 앱바 컴포넌트를 추가하거나, 별도 이슈로 분리된 사유를 명확히 남겨 직접 이슈 요구를 충족시키세요.
✅ Passed checks (4 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed 폰트, SVG, cn, NativeWind 설정은 공통 UI 컴포넌트 제작을 위한 지원 작업으로 보여 범위 밖 변경은 아닙니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed 공통 UI 컴포넌트와 관련 설정 추가라는 PR의 핵심 변경을 잘 요약합니다.
Description check ✅ Passed cn 유틸, 폰트/NativeWind/SVG 설정, 공통 컴포넌트 추가 등 변경사항과 일치합니다.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ui/8-common-ui

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (4)
tailwind.config.js (1)

63-115: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

SUIT 폰트 패밀리 문자열 중복 정의

theme.extend.fontFamily와 플러그인 내부 FONT_FAMILY_BY_WEIGHT가 동일한 폰트 문자열("SUIT-Regular", "SUIT-Medium" 등)을 각각 하드코딩하고 있습니다. 추후 폰트 파일명이 바뀌거나 체급이 추가될 때 한쪽만 갱신되면 .text-{name} 유틸리티와 font-suit-* 클래스 간 불일치가 발생할 수 있습니다.

♻️ 제안: 단일 소스로 통합
+const FONT_FAMILY = {
+  regular: ["SUIT-Regular"],
+  medium: ["SUIT-Medium"],
+  semibold: ["SUIT-SemiBold"],
+  bold: ["SUIT-Bold"],
+};
+
 module.exports = {
   theme: {
     extend: {
       fontFamily: {
-        suit: ["SUIT-Regular"],
-        "suit-medium": ["SUIT-Medium"],
-        "suit-semibold": ["SUIT-SemiBold"],
-        "suit-bold": ["SUIT-Bold"],
+        suit: FONT_FAMILY.regular,
+        "suit-medium": FONT_FAMILY.medium,
+        "suit-semibold": FONT_FAMILY.semibold,
+        "suit-bold": FONT_FAMILY.bold,
       },
     },
   },
   plugins: [
     require("tailwindcss/plugin")(function ({ addUtilities }) {
       const FONT_FAMILY_BY_WEIGHT = {
-        400: "SUIT-Regular",
-        500: "SUIT-Medium",
-        600: "SUIT-SemiBold",
-        700: "SUIT-Bold",
+        400: FONT_FAMILY.regular[0],
+        500: FONT_FAMILY.medium[0],
+        600: FONT_FAMILY.semibold[0],
+        700: FONT_FAMILY.bold[0],
       };
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tailwind.config.js` around lines 63 - 115, The SUIT font family values are
duplicated between theme.extend.fontFamily and the plugin’s
FONT_FAMILY_BY_WEIGHT mapping, so keep them in a single source of truth. Update
the Tailwind config so the .text-{name} utilities in the plugin reuse the same
font family definitions as the font-suit-* classes, using the existing
fontFamily keys or a shared constant referenced by both the theme and the
plugin.
svg-env.d.ts (1)

1-6: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

공식 템플릿과 다르게 React import 누락

react-native-svg-transformer 공식 README 예시는 다음과 같이 React를 명시적으로 import합니다: "declare module "*.svg" { import React from "react"; import { SvgProps } from "react-native-svg"; const content: React.FC; export default content; }"

현재 파일은 최상위에 import/export가 없어 global script로 처리되어 @types/react의 UMD global React를 통해 대부분 정상 동작할 가능성이 높지만, tsconfig의 isolatedModules/모듈 처리 방식에 따라 타입 해석이 달라질 수 있습니다. 공식 예시와 동일하게 명시적으로 import하는 것이 안전합니다.

🔧 제안
 declare module "*.svg" {
+  import type React from "react";
   import type { SvgProps } from "react-native-svg";

   const content: React.FC<SvgProps>;
   export default content;
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@svg-env.d.ts` around lines 1 - 6, The SVG module declaration is missing the
explicit React import used by the official react-native-svg-transformer
template, which can make type resolution depend on ambient UMD globals. Update
the `declare module "*.svg"` block to match the official pattern by importing
`React` alongside `SvgProps`, so the `content: React.FC<SvgProps>` declaration
is treated as a proper module and works consistently with `isolatedModules` and
different tsconfig module settings.
src/components/common/Toggle.tsx (1)

36-44: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

switch 시맨틱 접근성 속성 추가 권장.

PressableaccessibilityRole="switch"accessibilityState={{ checked: value }}를 추가하면 스크린리더 사용자가 on/off 상태를 인지할 수 있습니다.

♻️ 제안 diff
     <Pressable
       className={cn(
         "w-12 flex-row items-center justify-start rounded-[100px] p-1",
         value ? "bg-green-100" : "bg-gray-200",
         className
       )}
       onPress={() => onValueChange?.(!value)}
+      accessibilityRole="switch"
+      accessibilityState={{ checked: value }}
       {...rest}
     >
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/common/Toggle.tsx` around lines 36 - 44, The Toggle
component’s Pressable is missing switch accessibility semantics, so screen
readers can’t reliably announce its on/off state. Update the Pressable in
Toggle.tsx to expose switch behavior by adding accessibilityRole="switch" and
accessibilityState with checked bound to value, while keeping the existing
onPress/onValueChange wiring and other props intact.
src/components/common/Button.tsx (1)

41-56: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

접근성 속성 보완 권장.

PressableaccessibilityRole="button"accessibilityLabel={label}(또는 accessibilityState={{ disabled }})을 추가하면 스크린리더 사용자에게 버튼임을 명확히 전달할 수 있습니다.

♻️ 제안 diff
     <Pressable
       className={cn(
         "h-12 w-full items-center justify-center rounded-lg px-2.5",
         disabled ? "bg-gray-200" : container,
         className
       )}
       disabled={disabled}
+      accessibilityRole="button"
+      accessibilityLabel={label}
+      accessibilityState={{ disabled }}
       {...rest}
     >
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/common/Button.tsx` around lines 41 - 56, The Button
component’s Pressable is missing accessibility metadata, so update the Pressable
in Button to explicitly declare its role and state. Add
accessibilityRole="button" and an appropriate accessibilityLabel derived from
label, and include accessibilityState with disabled status so screen readers can
identify the control correctly. Keep the change localized to the Button
component’s Pressable wrapper and preserve the existing disabled behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Around line 43-46: The package dependency for tailwind-merge is on an
incompatible major version for the current Tailwind setup; update the
tailwind-merge entry in package.json from v3.6.0 to ^2.6.0 so cn() class merging
stays aligned with tailwindcss v3.4.19.

In `@src/components/common/Toggle.tsx`:
- Around line 17-33: The Toggle knob travel distance is too short for the
current sizing, so update the KNOB_TRANSLATE_X value in Toggle so the on-state
knob reaches the far right edge with no leftover gap. Also add default
accessibility props on the Pressable used by Toggle, specifically
accessibilityRole set to switch and accessibilityState reflecting the current
value via checked, so the component is properly announced as a switch.

---

Nitpick comments:
In `@src/components/common/Button.tsx`:
- Around line 41-56: The Button component’s Pressable is missing accessibility
metadata, so update the Pressable in Button to explicitly declare its role and
state. Add accessibilityRole="button" and an appropriate accessibilityLabel
derived from label, and include accessibilityState with disabled status so
screen readers can identify the control correctly. Keep the change localized to
the Button component’s Pressable wrapper and preserve the existing disabled
behavior.

In `@src/components/common/Toggle.tsx`:
- Around line 36-44: The Toggle component’s Pressable is missing switch
accessibility semantics, so screen readers can’t reliably announce its on/off
state. Update the Pressable in Toggle.tsx to expose switch behavior by adding
accessibilityRole="switch" and accessibilityState with checked bound to value,
while keeping the existing onPress/onValueChange wiring and other props intact.

In `@svg-env.d.ts`:
- Around line 1-6: The SVG module declaration is missing the explicit React
import used by the official react-native-svg-transformer template, which can
make type resolution depend on ambient UMD globals. Update the `declare module
"*.svg"` block to match the official pattern by importing `React` alongside
`SvgProps`, so the `content: React.FC<SvgProps>` declaration is treated as a
proper module and works consistently with `isolatedModules` and different
tsconfig module settings.

In `@tailwind.config.js`:
- Around line 63-115: The SUIT font family values are duplicated between
theme.extend.fontFamily and the plugin’s FONT_FAMILY_BY_WEIGHT mapping, so keep
them in a single source of truth. Update the Tailwind config so the .text-{name}
utilities in the plugin reuse the same font family definitions as the
font-suit-* classes, using the existing fontFamily keys or a shared constant
referenced by both the theme and the plugin.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 0dc5ea8c-6715-47f4-b87b-2cffe55c1272

📥 Commits

Reviewing files that changed from the base of the PR and between 38c55bd and 1a37427.

⛔ Files ignored due to path filters (2)
  • assets/icons/plus.svg is excluded by !**/*.svg, !**/assets/**
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (10)
  • metro.config.js
  • package.json
  • src/components/common/AddButton.tsx
  • src/components/common/AddScheduleButton.tsx
  • src/components/common/Button.tsx
  • src/components/common/Toggle.tsx
  • src/lib/cn.ts
  • svg-env.d.ts
  • tailwind.config.js
  • tsconfig.json

Comment thread package.json Outdated
Comment on lines +17 to +33
const KNOB_TRANSLATE_X = 20;

export function Toggle({
value,
onValueChange,
className,
...rest
}: ToggleProps) {
const progress = useSharedValue(value ? 1 : 0);

useEffect(() => {
progress.value = withTiming(value ? 1 : 0, { duration: 150 });
}, [progress, value]);

const knobTranslateStyle = useAnimatedStyle(() => ({
transform: [{ translateX: progress.value * KNOB_TRANSLATE_X }],
}));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== src/components/common/Toggle.tsx =="
nl -ba src/components/common/Toggle.tsx | sed -n '1,220p'

echo
echo "== Search for Toggle usage and related accessibility props =="
rg -n "accessibilityRole|accessibilityState|role=|ToggleProps|KNOB_TRANSLATE_X|translateX|size-4|w-12|p-1" src -g '!**/node_modules/**'

echo
echo "== Tailwind/theme config or spacing scale references =="
fd -a 'tailwind.config.*|tailwind.*.config.*|theme.*|tokens.*|spacing.*' . 2>/dev/null | head -n 50

Repository: TEAM-DAILOG/FE

Length of output: 231


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== src/components/common/Toggle.tsx =="
sed -n '1,220p' src/components/common/Toggle.tsx | cat -n

echo
echo "== Related references in src =="
rg -n "KNOB_TRANSLATE_X|accessibilityRole|accessibilityState|size-4|w-12|p-1|translateX|ToggleProps" src -g '!**/node_modules/**'

echo
echo "== Tailwind config / design tokens files =="
fd -a 'tailwind.config.*' .
fd -a 'tailwind.*.config.*' .
fd -a '*token*' src .

Repository: TEAM-DAILOG/FE

Length of output: 2949


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== tailwind.config.js =="
sed -n '1,260p' tailwind.config.js | cat -n

echo
echo "== Search for custom spacing / size utilities / NativeWind config =="
rg -n "spacing|fontSize|size-4|w-12|p-1|nativewind|tailwind" . -g '!**/node_modules/**' -g '!**/.git/**'

Repository: TEAM-DAILOG/FE

Length of output: 8615


노브 이동 거리 수정 필요

w-12 / p-1 / size-4 조합이면 최종 이동값은 24px입니다. 지금 20px이면 on 상태에서 노브가 오른쪽 끝까지 가지 않아 4px 여백이 남습니다.
PressableaccessibilityRole="switch"accessibilityState={{ checked: value }}도 기본으로 넣어주세요.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/common/Toggle.tsx` around lines 17 - 33, The Toggle knob
travel distance is too short for the current sizing, so update the
KNOB_TRANSLATE_X value in Toggle so the on-state knob reaches the far right edge
with no leftover gap. Also add default accessibility props on the Pressable used
by Toggle, specifically accessibilityRole set to switch and accessibilityState
reflecting the current value via checked, so the component is properly announced
as a switch.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이동하는 값이니까 여백이 남아야 해서 20px로 한거다.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/_layout.tsx`:
- Around line 22-39: `RootLayout`의 `useFonts` 처리에서 로딩 실패 시 스플래시가 영구 대기할 수 있습니다.
`useFonts`가 반환하는 두 번째 값인 `error`를 함께 받아서, `fontsLoaded || error`일 때
`SplashScreen.hideAsync()`가 실행되도록 `useEffect`와 초기 반환 분기를 조정하세요. `RootLayout`,
`useFonts`, `SplashScreen.hideAsync`를 기준으로 로직을 수정하면 됩니다.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: ab14c4b0-54d6-44e7-b2e3-492487a30ba9

📥 Commits

Reviewing files that changed from the base of the PR and between 67dfc0f and 4d1f9f1.

📒 Files selected for processing (2)
  • app.json
  • app/_layout.tsx
💤 Files with no reviewable changes (1)
  • app.json

Comment thread app/_layout.tsx
Comment on lines 22 to +39
export default function RootLayout() {
const colorScheme = useColorScheme();
const [fontsLoaded] = useFonts({
"SUIT-Regular": require("@/assets/fonts/SUIT-Regular.otf"),
"SUIT-Medium": require("@/assets/fonts/SUIT-Medium.otf"),
"SUIT-SemiBold": require("@/assets/fonts/SUIT-SemiBold.otf"),
"SUIT-Bold": require("@/assets/fonts/SUIT-Bold.otf"),
});

useEffect(() => {
if (fontsLoaded) {
SplashScreen.hideAsync();
}
}, [fontsLoaded]);

if (!fontsLoaded) {
return null;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

expo-font useFonts hook return value error handling latest documentation

💡 Result:

The useFonts hook from expo-font is designed to load a map of fonts at runtime [1][2]. It returns an array containing two values: [loaded, error] [1][2]. Return Value Breakdown: 1. loaded (boolean): Indicates whether the provided font map has finished loading [2]. 2. error (Error | null): Contains an error object if the font loading process failed, or null if the operation was successful [2]. Error Handling and Best Practices: According to the official Expo documentation, the error return value is primarily intended for use during development to help identify issues with font loading [1][3]. To implement robust error handling and prevent common issues (such as the app hanging on a splash screen), developers should monitor both loaded and error states [4]. A standard pattern is to use the useEffect hook to hide the splash screen once the loading process has either finished successfully or encountered an error [1][2]. Example Implementation: import { useFonts } from 'expo-font'; import * as SplashScreen from 'expo-splash-screen'; import { useEffect } from 'react'; // Keep the splash screen visible while fonts are loading SplashScreen.preventAutoHideAsync; export default function App { const [loaded, error] = useFonts({ 'My-Custom-Font': require('./assets/fonts/my-font.ttf'), }); useEffect( => { // Hide the splash screen once loading is complete or an error occurs if (loaded || error) { SplashScreen.hideAsync; } }, [loaded, error]); // Optionally render null or a fallback while loading if (!loaded &&!error) { return null; } // Render your app content return ; } Important Considerations: - Behavior Inconsistency: Some community reports indicate potential inconsistencies in how the error state behaves on different native platforms [5]. Always ensure you are testing font loading behavior across all target environments. - Configuration Plugins: If possible, use the Expo config plugin approach to include fonts, as this is preferred over runtime loading via useFonts [1]. Runtime loading should generally be reserved for scenarios where configuration plugins cannot be used [1]. - Type Safety: Recent updates to the expo-font package have improved type safety for the useFonts hook, turning some former runtime errors into build-time type errors when incorrect arguments are passed [6]. - Font Names: On Android, ensure you are referencing the fontFamily name as defined in the key of the object passed to useFonts, rather than relying solely on the filename, to avoid display issues [7].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Locate and inspect the layout file with line numbers
if [ -f app/_layout.tsx ]; then
  sed -n '1,120p' app/_layout.tsx | cat -n
else
  echo "app/_layout.tsx not found"
fi

# Gather package metadata relevant to expo-font if available
for f in package.json app/package.json; do
  if [ -f "$f" ]; then
    echo "===== $f ====="
    sed -n '1,220p' "$f"
  fi
done

Repository: TEAM-DAILOG/FE

Length of output: 3806


useFontserror도 함께 처리하세요. expo-fontuseFonts[loaded, error]를 반환하므로, 로딩 실패 시에도 SplashScreen.hideAsync()가 실행되도록 loaded || error 기준으로 분기해야 합니다. 지금처럼 fontsLoaded만 보면 실패 상황에서 스플래시 화면이 계속 남을 수 있습니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/_layout.tsx` around lines 22 - 39, `RootLayout`의 `useFonts` 처리에서 로딩 실패 시
스플래시가 영구 대기할 수 있습니다. `useFonts`가 반환하는 두 번째 값인 `error`를 함께 받아서, `fontsLoaded ||
error`일 때 `SplashScreen.hideAsync()`가 실행되도록 `useEffect`와 초기 반환 분기를 조정하세요.
`RootLayout`, `useFonts`, `SplashScreen.hideAsync`를 기준으로 로직을 수정하면 됩니다.

@Hyochan02 Hyochan02 merged commit 814465b into main Jul 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UI] 공통 컴포넌트 제작

2 participants