From 79a099922372fe42eb72e8c0da2a1d025b2cb382 Mon Sep 17 00:00:00 2001 From: sumin0423 Date: Sat, 14 Nov 2026 15:16:30 +0900 Subject: [PATCH 1/8] =?UTF-8?q?feat:=20=EA=B2=BD=EB=A0=A5=20=ED=99=88=20?= =?UTF-8?q?=ED=99=94=EB=A9=B4=20=EB=B0=8F=20=EC=88=98=EC=97=85=20=EC=B9=B4?= =?UTF-8?q?=EB=93=9C=20=ED=83=90=EC=83=89=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/images/home-install-art.svg | 71 ++++++++++ assets/images/home-logo.svg | 76 +++++++++++ docs/home.md | 13 ++ src/app/(tabs)/home.tsx | 77 ++++++++++- src/app/dev/home-record.tsx | 34 +++++ src/features/home/HomeScreen.tsx | 167 ++++++++++++++++++++++++ src/features/home/previewData.ts | 41 ++++++ src/features/home/styles.ts | 108 +++++++++++++++ src/features/home/types.ts | 20 +++ src/features/session-record/preview.tsx | 4 +- 10 files changed, 608 insertions(+), 3 deletions(-) create mode 100644 assets/images/home-install-art.svg create mode 100644 assets/images/home-logo.svg create mode 100644 docs/home.md create mode 100644 src/app/dev/home-record.tsx create mode 100644 src/features/home/HomeScreen.tsx create mode 100644 src/features/home/previewData.ts create mode 100644 src/features/home/styles.ts create mode 100644 src/features/home/types.ts diff --git a/assets/images/home-install-art.svg b/assets/images/home-install-art.svg new file mode 100644 index 0000000..41a0932 --- /dev/null +++ b/assets/images/home-install-art.svg @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/images/home-logo.svg b/assets/images/home-logo.svg new file mode 100644 index 0000000..ce50c6c --- /dev/null +++ b/assets/images/home-logo.svg @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/home.md b/docs/home.md new file mode 100644 index 0000000..8732510 --- /dev/null +++ b/docs/home.md @@ -0,0 +1,13 @@ +# T-09 경력 홈 + +제공된 정상 SVG 기준. 기존 하단 탭을 유지하고 홈 헤더만 교체합니다. 로고·배너 일러스트는 SVG에서 영역을 분리했고, 텍스트·카드·진도·할 일은 React Native로 렌더링합니다. + +- 개발/팀 검토 빌드만 시안의 날짜·교사·학생 예시 사용. 실제 일정 조회는 미연결 +- 오늘 수업 가로 스와이프·점 선택, 교재 기록 진입, 배너 닫기, 설정·수입 이동 +- 기록하기는 선택한 예시 학생과 회차를 기존 회차 기록 미리보기에 전달. 저장은 예시 동작 +- 할 일 합계는 네 항목 개수의 합. 미기록 수업은 첫 예시 수업으로 이동 +- PWA 안내 배너는 설치·알림 완료를 판정하지 않으며 안내 창만 표시. 알림 권한·서비스워커·실제 푸시 미연동 +- 일반 빌드는 예시 학생·금액을 표시하지 않음. API 미연결 상태에서 빈 일정 표시 +- 배너 닫힘은 메모리 상태로 새로고침 시 초기화 + +홈 API·수업 목록·할 일 필터 화면과 PWA 상태 분기는 후속 연결이 필요합니다. diff --git a/src/app/(tabs)/home.tsx b/src/app/(tabs)/home.tsx index 43135d2..c0cc2ac 100644 --- a/src/app/(tabs)/home.tsx +++ b/src/app/(tabs)/home.tsx @@ -1,4 +1,77 @@ -import PlaceholderScreen from '@/features/main/PlaceholderScreen'; +import { useState } from 'react'; +import { Modal, StyleSheet, Text, View } from 'react-native'; +import { Tabs, useRouter } from 'expo-router'; +import { HomeScreen } from '@/features/home/HomeScreen'; +import { homePreviewData } from '@/features/home/previewData'; +import { CAN_PREVIEW } from '@/config/review'; +import { useOnboarding } from '@/features/onboarding/OnboardingProvider'; +import type { HomeLesson } from '@/features/home/types'; +import { ActionButton } from '@/components/ActionButton'; export default function Screen() { - return ; + const router = useRouter(); + const { profile } = useOnboarding(); + const [notice, setNotice] = useState(null); + const data = CAN_PREVIEW + ? homePreviewData + : { + teacherLabel: `${profile.name} 선생님${profile.subjects.length ? ` · ${profile.subjects.join(' · ')}` : ''}`, + dateLabel: new Intl.DateTimeFormat('ko-KR', { + month: 'long', + day: 'numeric', + weekday: 'long', + timeZone: 'Asia/Seoul', + }).format(new Date()), + lessons: [], + tasks: [], + }; + function record(lesson: HomeLesson) { + if (CAN_PREVIEW) router.push({ pathname: '/dev/home-record', params: { lessonId: lesson.id } }); + else setNotice('수업 기록 API는 아직 연결되지 않았어요.'); + } + return ( + <> + + router.push('/settings')} + onRecord={record} + onInstallInfo={() => + setNotice( + '브라우저 메뉴의 홈 화면에 추가 기능으로 이용할 수 있어요. 설치 가능 여부는 브라우저와 PWA 설정에 따라 달라요. 수업·입금 알림 수신은 아직 연결되지 않았어요.', + ) + } + onTask={(task) => { + if (task.id === 'income') router.push('/income'); + else if (task.id === 'records' && data.lessons[0]) record(data.lessons[0]); + else setNotice('해당 기능은 아직 연결되지 않았어요.'); + }} + /> + setNotice(null)} + > + + + 안내 + {notice} + setNotice(null)} /> + + + + + ); } +const s = StyleSheet.create({ + overlay: { + flex: 1, + backgroundColor: '#0006', + alignItems: 'center', + justifyContent: 'center', + padding: 24, + }, + dialog: { width: '100%', maxWidth: 342, padding: 24, backgroundColor: '#fff', borderRadius: 12 }, + title: { fontSize: 18, fontWeight: '700', marginBottom: 12 }, + body: { fontSize: 14, lineHeight: 22, marginBottom: 24 }, +}); diff --git a/src/app/dev/home-record.tsx b/src/app/dev/home-record.tsx new file mode 100644 index 0000000..06a6229 --- /dev/null +++ b/src/app/dev/home-record.tsx @@ -0,0 +1,34 @@ +import { Redirect, useLocalSearchParams } from 'expo-router'; +import { CAN_PREVIEW } from '@/config/review'; +import { homePreviewData } from '@/features/home/previewData'; +import { SessionPreview } from '@/features/session-record/preview'; +export default function Screen() { + const { lessonId } = useLocalSearchParams<{ lessonId?: string }>(); + const lesson = homePreviewData.lessons.find((item) => item.id === lessonId); + if (!CAN_PREVIEW || !lesson) return ; + return ( + + ); +} diff --git a/src/features/home/HomeScreen.tsx b/src/features/home/HomeScreen.tsx new file mode 100644 index 0000000..b8f0249 --- /dev/null +++ b/src/features/home/HomeScreen.tsx @@ -0,0 +1,167 @@ +import { useRef, useState } from 'react'; +import type { ComponentRef } from 'react'; +import { Image } from 'expo-image'; +import { Pressable, ScrollView, Text, View } from 'react-native'; +import { SafeAreaView } from 'react-native-safe-area-context'; +import { ActionButton } from '@/components/ActionButton'; +import logo from '../../../assets/images/home-logo.svg'; +import installArt from '../../../assets/images/home-install-art.svg'; +import type { HomeData, HomeLesson, HomeTask } from './types'; +import { s } from './styles'; + +type Props = { + data: HomeData; + onProfile: () => void; + onRecord: (lesson: HomeLesson) => void; + onTask: (task: HomeTask) => void; + onInstallInfo: () => void; +}; +export function HomeScreen({ data, onProfile, onRecord, onTask, onInstallInfo }: Props) { + const [bannerVisible, setBannerVisible] = useState(true); + const [activeIndex, setActiveIndex] = useState(0); + const [cardWidth, setCardWidth] = useState(342); + const carousel = useRef>(null); + const todoCount = data.tasks.reduce((sum, task) => sum + task.count, 0); + return ( + + + + + + + {data.teacherLabel} + + + + + {bannerVisible && ( + + + + + 홈 화면에 추가하고 알림 받기 + + 수업이 끝나면 기록 알림,{'\n'}입금 · 보강 답이 오면 바로 알려드려요 + + + + setBannerVisible(false)} + style={s.close} + > + × + + + )} + + + {data.dateLabel} + {data.lessons.length} + + setCardWidth(event.nativeEvent.layout.width)}> + { + const index = Math.round(event.nativeEvent.contentOffset.x / cardWidth); + setActiveIndex(Math.max(0, Math.min(data.lessons.length - 1, index))); + }} + > + {data.lessons.map((lesson) => ( + + 오늘 {lesson.sessionNumber}회차 + + + + {lesson.studentName} + {lesson.description} + + {lesson.schedule} + + onRecord(lesson)} /> + + + {Array.from({ length: lesson.totalCount }, (_, i) => ( + + ))} + + + 오늘 기록하면 정산 {Math.min(lesson.completedCount + 1, lesson.totalCount)}/ + {lesson.totalCount}회차가 돼요 + + + ))} + + + {data.lessons.length === 0 && 오늘 예정된 수업이 없어요.} + + {data.lessons.map((lesson, index) => ( + { + setActiveIndex(index); + carousel.current?.scrollTo({ x: cardWidth * index, animated: true }); + }} + > + + + ))} + + + 할 일 + {todoCount} + + + {data.tasks.map((task, index) => ( + onTask(task)} + style={[s.task, index > 0 && s.taskBorder]} + > + {task.label} + 0 && (task.id === 'income' ? s.orangeBadge : s.blueBadge), + ]} + > + 0 && s.badgeTextActive]}> + {task.count} + + + + ))} + + + + + ); +} diff --git a/src/features/home/previewData.ts b/src/features/home/previewData.ts new file mode 100644 index 0000000..23146c0 --- /dev/null +++ b/src/features/home/previewData.ts @@ -0,0 +1,41 @@ +import type { HomeData } from './types'; +/** SVG 검토용 데이터이며 실제 오늘 일정·입금 정보가 아닙니다. */ +export const homePreviewData: HomeData = { + teacherLabel: '한서윤 선생님 · 영어', + dateLabel: '10월 1일 목요일', + lessons: [ + { + id: 'preview-home-1', + studentName: '윤서아', + description: '고1 · 영어', + schedule: '월·수·금 18:00 ~ 19:30', + sessionNumber: 5, + completedCount: 4, + totalCount: 5, + }, + { + id: 'preview-home-2', + studentName: '박도윤', + description: '고2 · 영어', + schedule: '월·수·금 19:30 ~ 21:00', + sessionNumber: 2, + completedCount: 1, + totalCount: 5, + }, + { + id: 'preview-home-3', + studentName: '김나연', + description: '중3 · 영어', + schedule: '월·수·금 21:00 ~ 22:00', + sessionNumber: 3, + completedCount: 2, + totalCount: 5, + }, + ], + tasks: [ + { id: 'records', label: '미기록 수업', count: 1 }, + { id: 'messages', label: '안 보낸 카톡', count: 0 }, + { id: 'reports', label: '발송 대기 정산 리포트', count: 0 }, + { id: 'income', label: '미입금', count: 1 }, + ], +}; diff --git a/src/features/home/styles.ts b/src/features/home/styles.ts new file mode 100644 index 0000000..4b532e5 --- /dev/null +++ b/src/features/home/styles.ts @@ -0,0 +1,108 @@ +import { Platform, StyleSheet } from 'react-native'; +import { primitive } from '@/styles/colors'; +const { blue, gray, orange } = primitive; +export const s = StyleSheet.create({ + safe: { flex: 1, backgroundColor: '#fff' }, + webInset: { height: Platform.OS === 'web' ? 44 : 0 }, + header: { + height: 64, + paddingHorizontal: 24, + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'space-between', + }, + logo: { width: 112, height: 26 }, + profile: { + backgroundColor: blue[100], + paddingHorizontal: 10, + paddingVertical: 9, + borderRadius: 24, + maxWidth: 170, + }, + profileText: { fontSize: 12, fontWeight: '600', color: blue[500] }, + content: { paddingBottom: 24 }, + banner: { height: 92, backgroundColor: blue[100] }, + bannerBody: { + flex: 1, + flexDirection: 'row', + alignItems: 'center', + paddingHorizontal: 24, + paddingRight: 32, + }, + art: { width: 64, height: 64 }, + bannerCopy: { flex: 1, marginLeft: 12 }, + bannerTitle: { fontSize: 15, fontWeight: '700', color: blue[500], marginBottom: 4 }, + bannerText: { fontSize: 12, lineHeight: 17, color: blue[600] }, + close: { + position: 'absolute', + right: 8, + top: 0, + width: 40, + height: 40, + alignItems: 'center', + justifyContent: 'center', + }, + closeText: { fontSize: 16, color: gray[200] }, + section: { paddingHorizontal: 24, paddingTop: 20 }, + sectionHeader: { + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'space-between', + paddingHorizontal: 4, + marginBottom: 12, + }, + sectionTitle: { fontSize: 15, lineHeight: 22, fontWeight: '700', color: gray[550] }, + sectionCount: { fontSize: 15, fontWeight: '600', color: blue[500], paddingRight: 6 }, + lesson: { + minHeight: 168, + padding: 16, + backgroundColor: blue[50], + borderRadius: 8, + borderWidth: 1, + borderColor: blue[400], + }, + session: { fontSize: 13, fontWeight: '600', color: blue[500], marginBottom: 10 }, + lessonRow: { flexDirection: 'row', alignItems: 'center', gap: 8 }, + lessonInfo: { flex: 1 }, + studentRow: { flexDirection: 'row', alignItems: 'baseline', gap: 8, flexWrap: 'wrap' }, + student: { fontSize: 18, fontWeight: '700', color: gray[650] }, + description: { fontSize: 13, fontWeight: '600', color: gray[550] }, + schedule: { fontSize: 14, lineHeight: 20, fontWeight: '600', color: gray[550], marginTop: 8 }, + progress: { flexDirection: 'row', gap: 2, marginTop: 24 }, + segment: { height: 6, flex: 1, backgroundColor: gray[100], borderRadius: 4 }, + segmentFilled: { backgroundColor: blue[400] }, + progressText: { fontSize: 12, lineHeight: 18, color: gray[550], marginTop: 8 }, + dots: { flexDirection: 'row', alignItems: 'center', justifyContent: 'center', height: 24 }, + dotTarget: { height: 24, minWidth: 10, justifyContent: 'center', alignItems: 'center' }, + dot: { width: 4, height: 4, borderRadius: 3, backgroundColor: gray[100] }, + activeDot: { width: 16, backgroundColor: blue[400] }, + tasksHeader: { marginTop: 8 }, + tasks: { + borderWidth: 1, + borderColor: gray[100], + borderRadius: 8, + backgroundColor: gray[0], + paddingHorizontal: 13, + paddingVertical: 4, + }, + task: { + minHeight: 40, + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'space-between', + }, + taskBorder: { borderTopWidth: 1, borderTopColor: gray[50] }, + taskLabel: { fontSize: 13, fontWeight: '600', color: gray[550] }, + badge: { + minWidth: 20, + height: 20, + borderRadius: 12, + alignItems: 'center', + justifyContent: 'center', + }, + blueBadge: { backgroundColor: blue[450] }, + orangeBadge: { backgroundColor: orange[300] }, + badgeText: { fontSize: 13, fontWeight: '600', color: gray[200] }, + badgeTextActive: { color: '#fff' }, + empty: { paddingVertical: 32, textAlign: 'center', color: gray[350] }, +}); diff --git a/src/features/home/types.ts b/src/features/home/types.ts new file mode 100644 index 0000000..a264a8a --- /dev/null +++ b/src/features/home/types.ts @@ -0,0 +1,20 @@ +export type HomeLesson = { + id: string; + studentName: string; + description: string; + schedule: string; + sessionNumber: number; + completedCount: number; + totalCount: number; +}; +export type HomeTask = { + id: 'records' | 'messages' | 'reports' | 'income'; + label: string; + count: number; +}; +export type HomeData = { + teacherLabel: string; + dateLabel: string; + lessons: HomeLesson[]; + tasks: HomeTask[]; +}; diff --git a/src/features/session-record/preview.tsx b/src/features/session-record/preview.tsx index b55e469..b265b81 100644 --- a/src/features/session-record/preview.tsx +++ b/src/features/session-record/preview.tsx @@ -38,8 +38,10 @@ const reasons: Record = { }; export function SessionPreview({ screen = 'record', + lessonOverride, }: { screen?: 'record' | 'sheet' | 'complete' | 'record-complete'; + lessonOverride?: LessonContext; }) { const params = useLocalSearchParams<{ variant?: string; @@ -59,7 +61,7 @@ export function SessionPreview({ if (!CAN_PREVIEW) return ; const variant = params.variant ?? 'first'; const empty = variant === 'empty'; - const lesson: LessonContext = { + const lesson: LessonContext = lessonOverride ?? { lessonId: 'preview-lesson', studentName: screen === 'record-complete' ? '윤서아' : '박도윤', dateLabel: '10월 14일 화요일', From df5c717a9ddab4cd8d6b0e83608879390b0ad403 Mon Sep 17 00:00:00 2001 From: sumin0423 Date: Sat, 14 Nov 2026 15:16:34 +0900 Subject: [PATCH 2/8] =?UTF-8?q?fix:=20=ED=94=84=EB=A1=9C=ED=95=84=20?= =?UTF-8?q?=ED=95=84=EC=88=98=20=EC=9E=85=EB=A0=A5=20=EB=B0=8F=20=EC=9D=B4?= =?UTF-8?q?=EB=A6=84=20=EA=B8=80=EC=9E=90=20=EC=88=98=20=EA=B2=80=EC=A6=9D?= =?UTF-8?q?=20=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/profile-input.md | 6 +++--- src/features/profile/ProfileScreen.tsx | 25 +++++++++++++++++-------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/docs/profile-input.md b/docs/profile-input.md index 511e727..6334daa 100644 --- a/docs/profile-input.md +++ b/docs/profile-input.md @@ -3,9 +3,9 @@ 새 T-03 SVG 기준으로 프로필 화면을 분리했습니다. - 공통 TextInput, Chip, ActionButton, Loading 및 디자인 토큰 재사용 -- 이름: 앞뒤 공백 제거 기준 2~10자, 최대 입력 길이 10자. 빈 값·한 글자·공백만 입력 시 완료 비활성화 -- 과목: 선택 사항, 복수 선택 및 해제 가능. 390px 시안에서는 한 줄 배치, 작은 화면에서는 줄바꿈 -- 완료: 로컬 상태를 반영하고 기존 흐름대로 `/home` 이동 +- 이름: 앞뒤 공백 제거 기준 2~10자. 초과 입력도 유지하며 주황색 입력·테두리와 “글자 수가 초과되었어요” 안내를 즉시 표시. 빈 값·한 글자·공백만·10자 초과 입력 시 완료 비활성화 +- 과목: 한 개 이상 필수, 복수 선택 및 해제 가능. 이름·과목의 별표는 파란색. 390px 시안에서는 한 줄 배치, 작은 화면에서는 줄바꿈 +- 완료: 유효한 이름과 한 개 이상 과목을 모두 만족할 때만 활성화. 로컬 상태를 반영하고 기존 흐름대로 `/home` 이동 - 설정의 수정: 기존 값 표시, 저장 후 설정으로 복귀 - 저장 중: 공통 로딩 및 버튼 점 표시, 입력·과목 선택·중복 제출 차단 - 저장 실패: 입력 유지 및 재시도 안내. 완료 버튼으로 재시도 diff --git a/src/features/profile/ProfileScreen.tsx b/src/features/profile/ProfileScreen.tsx index 6c9d6fb..a96cb38 100644 --- a/src/features/profile/ProfileScreen.tsx +++ b/src/features/profile/ProfileScreen.tsx @@ -35,6 +35,8 @@ export default function ProfileScreen({ onSave, initialProfile }: Props) { const mounted = useRef(true); const controller = useRef(null); const validName = isValidProfileName(draftName); + const nameTooLong = draftName.trim().length > 10; + const canSubmit = validName && draftSubjects.length > 0; useEffect(() => { mounted.current = true; return () => { @@ -44,7 +46,7 @@ export default function ProfileScreen({ onSave, initialProfile }: Props) { }, []); async function submit() { - if (!validName || inFlight.current) return; + if (!canSubmit || inFlight.current) return; inFlight.current = true; setFailed(false); Keyboard.dismiss(); @@ -117,12 +119,13 @@ export default function ProfileScreen({ onSave, initialProfile }: Props) { 학부모님께 보일 이름을 알려 주세요 - 이름* + + 이름* + setTouched(true)} onSubmitEditing={() => { if (!validName) setTouched(true); else void submit(); }} errorMessage={ - touched && draftName.length > 0 && !validName - ? '이름은 2~10자로 입력해 주세요.' - : undefined + nameTooLong + ? '글자 수가 초과되었어요' + : touched && draftName.length > 0 && !validName + ? '이름은 2~10자로 입력해 주세요.' + : undefined } /> - 과목 (선택, 여러 개) + + 과목* (복수 선택 가능) + {profileSubjects.map((subject) => ( void submit()} /> @@ -210,6 +218,7 @@ const s = StyleSheet.create({ color: semantic.text.default.strong, marginBottom: gap[20], }, + required: { color: semantic.text.brand.assistive }, nameLabel: { ...typography.body[5].medium, color: semantic.text.default.normal, From 4709e97083b38cb98f1e1f3b3cdf785c54eafa28 Mon Sep 17 00:00:00 2001 From: sumin0423 Date: Sat, 14 Nov 2026 15:16:36 +0900 Subject: [PATCH 3/8] =?UTF-8?q?fix:=20=EC=9D=B4=EB=A6=84=20=EC=9E=90?= =?UTF-8?q?=EB=8F=99=EC=99=84=EC=84=B1=20=EB=B0=B0=EA=B2=BD=EC=83=89?= =?UTF-8?q?=EC=9D=84=20=EC=9E=85=EB=A0=A5=EC=B0=BD=20=EC=8A=A4=ED=83=80?= =?UTF-8?q?=EC=9D=BC=EC=97=90=20=EB=A7=9E=EC=B6=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/TextInput.tsx | 1 + src/components/input-autofill.css | 22 ++++++++++++++++++++++ src/components/inputAutofill.ts | 2 ++ src/components/inputAutofill.web.ts | 1 + src/types/styles.d.ts | 1 + 5 files changed, 27 insertions(+) create mode 100644 src/components/input-autofill.css create mode 100644 src/components/inputAutofill.ts create mode 100644 src/components/inputAutofill.web.ts create mode 100644 src/types/styles.d.ts diff --git a/src/components/TextInput.tsx b/src/components/TextInput.tsx index 2660bb2..694c443 100644 --- a/src/components/TextInput.tsx +++ b/src/components/TextInput.tsx @@ -1,3 +1,4 @@ +import './inputAutofill'; import { useState } from 'react'; import type { ReactNode } from 'react'; import { TextInput as RNTextInput, StyleSheet, Text, View } from 'react-native'; diff --git a/src/components/input-autofill.css b/src/components/input-autofill.css new file mode 100644 index 0000000..5f1ac1e --- /dev/null +++ b/src/components/input-autofill.css @@ -0,0 +1,22 @@ +/* 자동완성 기능은 유지하고 브라우저 기본 강조 배경만 입력창 색상에 맞춥니다. */ +input[autocomplete='name'] { + --autofill-background: #fbfbff; + --autofill-text: #2d303d; +} +input[autocomplete='name']:focus, +input[autocomplete='name'][aria-invalid='true'] { + --autofill-background: #fff; +} +input[autocomplete='name'][aria-invalid='true'] { + --autofill-text: #ff6723; +} +input[autocomplete='name']:autofill { + box-shadow: 0 0 0 1000px var(--autofill-background) inset !important; + -webkit-text-fill-color: var(--autofill-text) !important; + caret-color: var(--autofill-text); +} +input[autocomplete='name']:-webkit-autofill { + -webkit-box-shadow: 0 0 0 1000px var(--autofill-background) inset !important; + -webkit-text-fill-color: var(--autofill-text) !important; + caret-color: var(--autofill-text); +} diff --git a/src/components/inputAutofill.ts b/src/components/inputAutofill.ts new file mode 100644 index 0000000..996b3dc --- /dev/null +++ b/src/components/inputAutofill.ts @@ -0,0 +1,2 @@ +// 네이티브에서는 브라우저 자동완성 스타일이 필요하지 않습니다. +export {}; diff --git a/src/components/inputAutofill.web.ts b/src/components/inputAutofill.web.ts new file mode 100644 index 0000000..4b6bd85 --- /dev/null +++ b/src/components/inputAutofill.web.ts @@ -0,0 +1 @@ +import './input-autofill.css'; diff --git a/src/types/styles.d.ts b/src/types/styles.d.ts new file mode 100644 index 0000000..35306c6 --- /dev/null +++ b/src/types/styles.d.ts @@ -0,0 +1 @@ +declare module '*.css'; From f03519424ba9d669197c038ffa8e111f31ee1b06 Mon Sep 17 00:00:00 2001 From: sumin0423 Date: Sat, 14 Nov 2026 15:58:16 +0900 Subject: [PATCH 4/8] =?UTF-8?q?feat:=20=ED=99=88=20=EC=A7=80=EC=97=B0=20?= =?UTF-8?q?=EB=A1=9C=EB=94=A9=20=EB=B0=8F=20=EC=88=98=EC=97=85=20=EC=97=86?= =?UTF-8?q?=EC=9D=8C=20=EC=83=81=ED=83=9C=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/images/home-empty.svg | 70 ++++++++ docs/home.md | 10 ++ src/app/(tabs)/home.tsx | 27 ++- src/components/ActionButton.tsx | 11 +- src/features/home/HomeLoading.tsx | 44 +++++ src/features/home/HomeScreen.tsx | 283 ++++++++++++++++++------------ src/features/home/styles.ts | 29 +++ 7 files changed, 355 insertions(+), 119 deletions(-) create mode 100644 assets/images/home-empty.svg create mode 100644 src/features/home/HomeLoading.tsx diff --git a/assets/images/home-empty.svg b/assets/images/home-empty.svg new file mode 100644 index 0000000..9aa7faf --- /dev/null +++ b/assets/images/home-empty.svg @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/home.md b/docs/home.md index 8732510..16a3904 100644 --- a/docs/home.md +++ b/docs/home.md @@ -11,3 +11,13 @@ - 배너 닫힘은 메모리 상태로 새로고침 시 초기화 홈 API·수업 목록·할 일 필터 화면과 PWA 상태 분기는 후속 연결이 필요합니다. + +## 추가 상태 + +- `/home?preview=empty`: 수업 없음 시안, 학생 목록 바로가기 및 할 일 표시 +- `/home?preview=loading`: 3초 조회 예시. 500ms 뒤 스켈레톤 표시 후 정상 화면 전환 +- `/home?preview=fast`: 100ms 조회 예시. 스켈레톤 미표시 +- 위 조회 지연과 데이터는 개발/팀 검토 빌드에서만 적용 +- HomeScreen의 loading이 true일 때 500ms 표시 지연 적용. 입력·조회 데이터를 실제 API로 전달하는 연결은 후속 작업 +- 빈 상태 시안의 개별 할 일은 총 4건이므로 제목의 합계도 4로 계산. 원본 제목 2와 다른 것은 개별 값과 합계의 일관성을 위한 처리 +- 기존 저장 화면의 로딩은 이 변경과 별개로 처리 시작 시 바로 표시 diff --git a/src/app/(tabs)/home.tsx b/src/app/(tabs)/home.tsx index c0cc2ac..b29b337 100644 --- a/src/app/(tabs)/home.tsx +++ b/src/app/(tabs)/home.tsx @@ -1,6 +1,6 @@ -import { useState } from 'react'; +import { useEffect, useState } from 'react'; import { Modal, StyleSheet, Text, View } from 'react-native'; -import { Tabs, useRouter } from 'expo-router'; +import { Tabs, useLocalSearchParams, useRouter } from 'expo-router'; import { HomeScreen } from '@/features/home/HomeScreen'; import { homePreviewData } from '@/features/home/previewData'; import { CAN_PREVIEW } from '@/config/review'; @@ -9,10 +9,29 @@ import type { HomeLesson } from '@/features/home/types'; import { ActionButton } from '@/components/ActionButton'; export default function Screen() { const router = useRouter(); + const { preview } = useLocalSearchParams<{ preview?: string }>(); + const [finishedPreview, setFinishedPreview] = useState(null); + const previewLoading = CAN_PREVIEW && (preview === 'loading' || preview === 'fast'); + const loading = previewLoading && finishedPreview !== preview; + useEffect(() => { + if (!previewLoading) return; + const timer = setTimeout(() => setFinishedPreview(preview!), preview === 'fast' ? 100 : 3000); + return () => clearTimeout(timer); + }, [preview, previewLoading]); const { profile } = useOnboarding(); const [notice, setNotice] = useState(null); const data = CAN_PREVIEW - ? homePreviewData + ? preview === 'empty' + ? { + ...homePreviewData, + teacherLabel: 'OOO 선생님 · 영어', + lessons: [], + tasks: homePreviewData.tasks.map((task) => ({ + ...task, + count: task.id === 'income' ? 3 : task.count, + })), + } + : homePreviewData : { teacherLabel: `${profile.name} 선생님${profile.subjects.length ? ` · ${profile.subjects.join(' · ')}` : ''}`, dateLabel: new Intl.DateTimeFormat('ko-KR', { @@ -33,6 +52,8 @@ export default function Screen() { router.push('/students')} onProfile={() => router.push('/settings')} onRecord={record} onInstallInfo={() => diff --git a/src/components/ActionButton.tsx b/src/components/ActionButton.tsx index 73c0456..c3ff141 100644 --- a/src/components/ActionButton.tsx +++ b/src/components/ActionButton.tsx @@ -21,6 +21,8 @@ export type ActionButtonProps = Omit & { label: string; /** L: 가로 꽉 참, M: 96, S: 72 */ size?: ActionButtonSize; + /** 높이·글자 크기는 유지하고 부모 너비를 채웁니다. */ + fullWidth?: boolean; variant?: ActionButtonVariant; /** primary 버튼의 기본 파란색 농도. strong은 진한 파란색을 사용합니다. */ tone?: 'default' | 'strong'; @@ -54,6 +56,7 @@ const variants = { export function ActionButton({ label, size = 'L', + fullWidth = false, variant = 'primary', tone = 'default', disabled, @@ -81,7 +84,12 @@ export function ActionButton({ disabled={disabled || loading} aria-disabled={disabled || loading || undefined} aria-busy={loading || undefined} - style={({ pressed }) => [s.base, sizes[size], { backgroundColor: background(pressed) }]} + style={({ pressed }) => [ + s.base, + sizes[size], + fullWidth && s.fullWidth, + { backgroundColor: background(pressed) }, + ]} > {loading ? ( @@ -107,6 +115,7 @@ export function ActionButton({ } const s = StyleSheet.create({ + fullWidth: { width: '100%' }, base: { alignItems: 'center', justifyContent: 'center', diff --git a/src/features/home/HomeLoading.tsx b/src/features/home/HomeLoading.tsx new file mode 100644 index 0000000..72fddcd --- /dev/null +++ b/src/features/home/HomeLoading.tsx @@ -0,0 +1,44 @@ +import { useEffect, useState } from 'react'; +import { ScrollView, Text, View } from 'react-native'; +import { s } from './styles'; +import type { HomeData } from './types'; +/** 빠른 조회의 깜빡임을 줄이기 위해 500ms 이상 기다릴 때만 표시합니다. */ +export function HomeLoading({ data }: { data: HomeData }) { + const [visible, setVisible] = useState(false); + useEffect(() => { + const timer = setTimeout(() => setVisible(true), 500); + return () => clearTimeout(timer); + }, []); + return ( + + {visible && ( + + + + + {data.dateLabel} + {data.lessons.length} + + + + {[0, 1, 2].map((i) => ( + + ))} + + + 할 일 + + {data.tasks.reduce((sum, task) => sum + task.count, 0)} + + + + + + )} + + ); +} diff --git a/src/features/home/HomeScreen.tsx b/src/features/home/HomeScreen.tsx index b8f0249..84ea034 100644 --- a/src/features/home/HomeScreen.tsx +++ b/src/features/home/HomeScreen.tsx @@ -8,15 +8,27 @@ import logo from '../../../assets/images/home-logo.svg'; import installArt from '../../../assets/images/home-install-art.svg'; import type { HomeData, HomeLesson, HomeTask } from './types'; import { s } from './styles'; +import { HomeLoading } from './HomeLoading'; +import emptyArt from '../../../assets/images/home-empty.svg'; type Props = { data: HomeData; + loading?: boolean; + onStudents: () => void; onProfile: () => void; onRecord: (lesson: HomeLesson) => void; onTask: (task: HomeTask) => void; onInstallInfo: () => void; }; -export function HomeScreen({ data, onProfile, onRecord, onTask, onInstallInfo }: Props) { +export function HomeScreen({ + data, + loading = false, + onStudents, + onProfile, + onRecord, + onTask, + onInstallInfo, +}: Props) { const [bannerVisible, setBannerVisible] = useState(true); const [activeIndex, setActiveIndex] = useState(0); const [cardWidth, setCardWidth] = useState(342); @@ -38,130 +50,171 @@ export function HomeScreen({ data, onProfile, onRecord, onTask, onInstallInfo }: - - {bannerVisible && ( - - - - - 홈 화면에 추가하고 알림 받기 - - 수업이 끝나면 기록 알림,{'\n'}입금 · 보강 답이 오면 바로 알려드려요 - - - - setBannerVisible(false)} - style={s.close} - > - × - - - )} - - - {data.dateLabel} - {data.lessons.length} - - setCardWidth(event.nativeEvent.layout.width)}> - { - const index = Math.round(event.nativeEvent.contentOffset.x / cardWidth); - setActiveIndex(Math.max(0, Math.min(data.lessons.length - 1, index))); - }} - > - {data.lessons.map((lesson) => ( - - 오늘 {lesson.sessionNumber}회차 - - - - {lesson.studentName} - {lesson.description} - - {lesson.schedule} - - onRecord(lesson)} /> - - - {Array.from({ length: lesson.totalCount }, (_, i) => ( - - ))} - - - 오늘 기록하면 정산 {Math.min(lesson.completedCount + 1, lesson.totalCount)}/ - {lesson.totalCount}회차가 돼요 - - - ))} - - - {data.lessons.length === 0 && 오늘 예정된 수업이 없어요.} - - {data.lessons.map((lesson, index) => ( + {loading ? ( + + ) : ( + + {bannerVisible && ( + { - setActiveIndex(index); - carousel.current?.scrollTo({ x: cardWidth * index, animated: true }); - }} + accessibilityLabel="홈 화면 추가 및 알림 안내" + onPress={onInstallInfo} + style={s.bannerBody} > - + + + 홈 화면에 추가하고 알림 받기 + + 수업이 끝나면 기록 알림,{'\n'}입금 · 보강 답이 오면 바로 알려드려요 + + - ))} - - - 할 일 - {todoCount} - - - {data.tasks.map((task, index) => ( onTask(task)} - style={[s.task, index > 0 && s.taskBorder]} + accessibilityLabel="홈 화면 추가 안내 닫기" + onPress={() => setBannerVisible(false)} + style={s.close} > - {task.label} - 0 && (task.id === 'income' ? s.orangeBadge : s.blueBadge), - ]} + × + + + )} + + + {data.dateLabel} + {data.lessons.length} + + {data.lessons.length > 0 && ( + setCardWidth(event.nativeEvent.layout.width)}> + { + const index = Math.round(event.nativeEvent.contentOffset.x / cardWidth); + setActiveIndex(Math.max(0, Math.min(data.lessons.length - 1, index))); + }} > - 0 && s.badgeTextActive]}> - {task.count} - + {data.lessons.map((lesson) => ( + + 오늘 {lesson.sessionNumber}회차 + + + + {lesson.studentName} + {lesson.description} + + {lesson.schedule} + + onRecord(lesson)} /> + + + {Array.from({ length: lesson.totalCount }, (_, i) => ( + + ))} + + + 오늘 기록하면 정산 {Math.min(lesson.completedCount + 1, lesson.totalCount)}/ + {lesson.totalCount}회차가 돼요 + + + ))} + + + )} + {data.lessons.length === 0 && ( + + + 오늘은 수업이 없어요 + + - - ))} + + )} + {data.lessons.length > 0 && ( + + {data.lessons.map((lesson, index) => ( + { + setActiveIndex(index); + carousel.current?.scrollTo({ x: cardWidth * index, animated: true }); + }} + > + + + ))} + + )} + + 할 일 + {todoCount} + + + {data.tasks.map((task, index) => ( + onTask(task)} + style={[s.task, index > 0 && s.taskBorder]} + > + {task.label} + 0 && + task.count > 0 && + (task.id === 'income' ? s.orangeBadge : s.blueBadge), + ]} + > + 0 && s.taskCountActive] + : [s.badgeText, task.count > 0 && s.badgeTextActive] + } + > + {task.count} + {data.lessons.length === 0 ? '건' : ''} + + + + ))} + - - + + )} ); } diff --git a/src/features/home/styles.ts b/src/features/home/styles.ts index 4b532e5..b8589a2 100644 --- a/src/features/home/styles.ts +++ b/src/features/home/styles.ts @@ -93,6 +93,8 @@ export const s = StyleSheet.create({ }, taskBorder: { borderTopWidth: 1, borderTopColor: gray[50] }, taskLabel: { fontSize: 13, fontWeight: '600', color: gray[550] }, + taskCount: { fontSize: 13, color: gray[200] }, + taskCountActive: { color: orange[300] }, badge: { minWidth: 20, height: 20, @@ -104,5 +106,32 @@ export const s = StyleSheet.create({ orangeBadge: { backgroundColor: orange[300] }, badgeText: { fontSize: 13, fontWeight: '600', color: gray[200] }, badgeTextActive: { color: '#fff' }, + loadingRoot: { flex: 1 }, + skeleton: { backgroundColor: gray[100], borderRadius: 8 }, + bannerSkeleton: { height: 92, backgroundColor: gray[100] }, + lessonSkeleton: { height: 168 }, + tasksSkeleton: { height: 171 }, + skeletonDot: { marginHorizontal: 2 }, + skeletonActiveDot: { width: 16 }, + emptyCard: { + height: 234, + paddingTop: 30, + alignItems: 'center', + borderWidth: 1, + borderColor: gray[100], + backgroundColor: gray[0], + borderRadius: 8, + }, + emptyArt: { width: 100, height: 90 }, + emptyLabel: { + color: gray[350], + fontSize: 14, + lineHeight: 20, + fontWeight: '600', + marginTop: 8, + marginBottom: 18, + }, + studentsButton: { width: 140 }, + emptyTasksHeader: { marginTop: 20 }, empty: { paddingVertical: 32, textAlign: 'center', color: gray[350] }, }); From 4d2a26b23e761f096d217d5f770bfa543040ed27 Mon Sep 17 00:00:00 2001 From: sumin0423 Date: Sat, 14 Nov 2026 15:58:40 +0900 Subject: [PATCH 5/8] =?UTF-8?q?fix:=20=ED=99=88=20=EC=BA=90=EB=9F=AC?= =?UTF-8?q?=EC=85=80=EA=B3=BC=20=ED=95=A0=20=EC=9D=BC=20=EB=AA=A9=EB=A1=9D?= =?UTF-8?q?=EC=9D=84=20=EC=B5=9C=EC=8B=A0=20=EC=8B=9C=EC=95=88=EC=97=90=20?= =?UTF-8?q?=EB=A7=9E=EC=B6=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/home.md | 4 ++++ src/features/home/HomeScreen.tsx | 37 +++++++++++--------------------- src/features/home/styles.ts | 16 +++----------- 3 files changed, 20 insertions(+), 37 deletions(-) diff --git a/docs/home.md b/docs/home.md index 16a3904..7ea4425 100644 --- a/docs/home.md +++ b/docs/home.md @@ -21,3 +21,7 @@ - HomeScreen의 loading이 true일 때 500ms 표시 지연 적용. 입력·조회 데이터를 실제 API로 전달하는 연결은 후속 작업 - 빈 상태 시안의 개별 할 일은 총 4건이므로 제목의 합계도 4로 계산. 원본 제목 2와 다른 것은 개별 값과 합계의 일관성을 위한 처리 - 기존 저장 화면의 로딩은 이 변경과 별개로 처리 시작 시 바로 표시 + +## 정상 홈 시안 갱신 + +캐러셀1.svg에 맞춰 다음 카드 일부를 오른쪽에 노출하고 카드 사이 간격 16을 적용합니다. 페이지 표시는 카드 너비와 간격을 합친 이동 거리로 계산합니다. 정상 할 일 목록의 외곽 테두리·동그란 배지를 제거하고, 1건 이상은 주황색, 0건은 회색 텍스트로 표시합니다. 수업 없음 상태의 목록 테두리는 기존 시안을 유지합니다. diff --git a/src/features/home/HomeScreen.tsx b/src/features/home/HomeScreen.tsx index 84ea034..df89953 100644 --- a/src/features/home/HomeScreen.tsx +++ b/src/features/home/HomeScreen.tsx @@ -32,6 +32,7 @@ export function HomeScreen({ const [bannerVisible, setBannerVisible] = useState(true); const [activeIndex, setActiveIndex] = useState(0); const [cardWidth, setCardWidth] = useState(342); + const cardStride = cardWidth + 16; const carousel = useRef>(null); const todoCount = data.tasks.reduce((sum, task) => sum + task.count, 0); return ( @@ -86,20 +87,24 @@ export function HomeScreen({ {data.lessons.length} {data.lessons.length > 0 && ( - setCardWidth(event.nativeEvent.layout.width)}> + setCardWidth(Math.max(1, event.nativeEvent.layout.width - 24))} + > { - const index = Math.round(event.nativeEvent.contentOffset.x / cardWidth); + const index = Math.round(event.nativeEvent.contentOffset.x / cardStride); setActiveIndex(Math.max(0, Math.min(data.lessons.length - 1, index))); }} > {data.lessons.map((lesson) => ( - + 오늘 {lesson.sessionNumber}회차 @@ -161,7 +166,7 @@ export function HomeScreen({ style={s.dotTarget} onPress={() => { setActiveIndex(index); - carousel.current?.scrollTo({ x: cardWidth * index, animated: true }); + carousel.current?.scrollTo({ x: cardStride * index, animated: true }); }} > @@ -179,7 +184,7 @@ export function HomeScreen({ 할 일 {todoCount} - + {data.tasks.map((task, index) => ( 0 && s.taskBorder]} > {task.label} - 0 && - task.count > 0 && - (task.id === 'income' ? s.orangeBadge : s.blueBadge), - ]} - > - 0 && s.taskCountActive] - : [s.badgeText, task.count > 0 && s.badgeTextActive] - } - > - {task.count} - {data.lessons.length === 0 ? '건' : ''} - - + 0 && s.taskCountActive]}> + {task.count}건 + ))} diff --git a/src/features/home/styles.ts b/src/features/home/styles.ts index b8589a2..954506a 100644 --- a/src/features/home/styles.ts +++ b/src/features/home/styles.ts @@ -53,6 +53,8 @@ export const s = StyleSheet.create({ }, sectionTitle: { fontSize: 15, lineHeight: 22, fontWeight: '700', color: gray[550] }, sectionCount: { fontSize: 15, fontWeight: '600', color: blue[500], paddingRight: 6 }, + carouselViewport: { marginRight: -24 }, + carouselContent: { paddingRight: 8 }, lesson: { minHeight: 168, padding: 16, @@ -78,8 +80,6 @@ export const s = StyleSheet.create({ activeDot: { width: 16, backgroundColor: blue[400] }, tasksHeader: { marginTop: 8 }, tasks: { - borderWidth: 1, - borderColor: gray[100], borderRadius: 8, backgroundColor: gray[0], paddingHorizontal: 13, @@ -95,17 +95,7 @@ export const s = StyleSheet.create({ taskLabel: { fontSize: 13, fontWeight: '600', color: gray[550] }, taskCount: { fontSize: 13, color: gray[200] }, taskCountActive: { color: orange[300] }, - badge: { - minWidth: 20, - height: 20, - borderRadius: 12, - alignItems: 'center', - justifyContent: 'center', - }, - blueBadge: { backgroundColor: blue[450] }, - orangeBadge: { backgroundColor: orange[300] }, - badgeText: { fontSize: 13, fontWeight: '600', color: gray[200] }, - badgeTextActive: { color: '#fff' }, + emptyTasks: { borderWidth: 1, borderColor: gray[100] }, loadingRoot: { flex: 1 }, skeleton: { backgroundColor: gray[100], borderRadius: 8 }, bannerSkeleton: { height: 92, backgroundColor: gray[100] }, From a38f5286b55df8aca08bcb08c99f5189123fc177 Mon Sep 17 00:00:00 2001 From: sumin0423 Date: Sat, 14 Nov 2026 15:58:42 +0900 Subject: [PATCH 6/8] =?UTF-8?q?fix:=20=EB=AA=A8=EB=B0=94=EC=9D=BC=20?= =?UTF-8?q?=EC=9B=B9=20=EC=9E=85=EB=A0=A5=20=EC=8B=9C=20=EC=9E=90=EB=8F=99?= =?UTF-8?q?=20=ED=99=95=EB=8C=80=20=EB=B0=A9=EC=A7=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/_layout.tsx | 1 + src/styles/mobile-input.css | 9 +++++++++ src/styles/webInputStyles.ts | 2 ++ src/styles/webInputStyles.web.ts | 1 + 4 files changed, 13 insertions(+) create mode 100644 src/styles/mobile-input.css create mode 100644 src/styles/webInputStyles.ts create mode 100644 src/styles/webInputStyles.web.ts diff --git a/src/app/_layout.tsx b/src/app/_layout.tsx index 1df1185..8243a43 100644 --- a/src/app/_layout.tsx +++ b/src/app/_layout.tsx @@ -1,3 +1,4 @@ +import '@/styles/webInputStyles'; import { Stack } from 'expo-router'; import { StatusBar } from 'expo-status-bar'; import { SafeAreaProvider } from 'react-native-safe-area-context'; diff --git a/src/styles/mobile-input.css b/src/styles/mobile-input.css new file mode 100644 index 0000000..e77f9b8 --- /dev/null +++ b/src/styles/mobile-input.css @@ -0,0 +1,9 @@ +/* iOS의 작은 입력 글자 자동 확대 방지. 사용자의 핀치 확대는 유지합니다. */ +@media (hover: none) and (pointer: coarse) { + input, + textarea, + select { + font-size: 16px !important; + line-height: 24px !important; + } +} diff --git a/src/styles/webInputStyles.ts b/src/styles/webInputStyles.ts new file mode 100644 index 0000000..0e6820b --- /dev/null +++ b/src/styles/webInputStyles.ts @@ -0,0 +1,2 @@ +// 모바일 웹 입력 스타일은 네이티브 앱에는 적용하지 않습니다. +export {}; diff --git a/src/styles/webInputStyles.web.ts b/src/styles/webInputStyles.web.ts new file mode 100644 index 0000000..87fe3d7 --- /dev/null +++ b/src/styles/webInputStyles.web.ts @@ -0,0 +1 @@ +import './mobile-input.css'; From 54fa8595e82db014ad190ce6dd48805b3064de9a Mon Sep 17 00:00:00 2001 From: sumin0423 Date: Sat, 14 Nov 2026 16:09:14 +0900 Subject: [PATCH 7/8] =?UTF-8?q?feat:=20=EC=B2=AB=20=EA=B3=BC=EC=99=B8=20?= =?UTF-8?q?=EC=A4=80=EB=B9=84=20=ED=99=88=20=ED=99=94=EB=A9=B4=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/home.md | 5 + src/app/(tabs)/home.tsx | 16 +- src/features/home/FirstTutoring.tsx | 95 ++++++++++++ src/features/home/HomeScreen.tsx | 232 +++++++++++++++------------- 4 files changed, 237 insertions(+), 111 deletions(-) create mode 100644 src/features/home/FirstTutoring.tsx diff --git a/docs/home.md b/docs/home.md index 7ea4425..b5236e8 100644 --- a/docs/home.md +++ b/docs/home.md @@ -25,3 +25,8 @@ ## 정상 홈 시안 갱신 캐러셀1.svg에 맞춰 다음 카드 일부를 오른쪽에 노출하고 카드 사이 간격 16을 적용합니다. 페이지 표시는 카드 너비와 간격을 합친 이동 거리로 계산합니다. 정상 할 일 목록의 외곽 테두리·동그란 배지를 제거하고, 1건 이상은 주황색, 0건은 회색 텍스트로 표시합니다. 수업 없음 상태의 목록 테두리는 기존 시안을 유지합니다. + +## 첫 과외 홈 + +- `/home?preview=first`: 첫 과외 준비 0/4 단계 표시. 실제 완료 상태 조회는 미연결이며 단순 클릭으로 완료 수를 올리지 않음 +- 학생 정보 넣기·바로 과외 만들기는 현재 구현된 `/tutoring/student`로 연결. 소개서·커리큘럼 경로는 미구현 안내 diff --git a/src/app/(tabs)/home.tsx b/src/app/(tabs)/home.tsx index b29b337..e086e2b 100644 --- a/src/app/(tabs)/home.tsx +++ b/src/app/(tabs)/home.tsx @@ -53,14 +53,20 @@ export default function Screen() { { + if (step === 'student' || step === 'tutoring') router.push('/tutoring/student'); + else + setNotice( + step === 'introduction' + ? '소개서 만들기는 준비 중이에요.' + : '커리큘럼 받기는 준비 중이에요.', + ); + }} onStudents={() => router.push('/students')} onProfile={() => router.push('/settings')} onRecord={record} - onInstallInfo={() => - setNotice( - '브라우저 메뉴의 홈 화면에 추가 기능으로 이용할 수 있어요. 설치 가능 여부는 브라우저와 PWA 설정에 따라 달라요. 수업·입금 알림 수신은 아직 연결되지 않았어요.', - ) - } + onInstallInfo={() => setNotice('홈 화면 추가 및 알림 안내는 준비 중이에요.')} onTask={(task) => { if (task.id === 'income') router.push('/income'); else if (task.id === 'records' && data.lessons[0]) record(data.lessons[0]); diff --git a/src/features/home/FirstTutoring.tsx b/src/features/home/FirstTutoring.tsx new file mode 100644 index 0000000..0cbcbd3 --- /dev/null +++ b/src/features/home/FirstTutoring.tsx @@ -0,0 +1,95 @@ +import { Pressable, StyleSheet, Text, View } from 'react-native'; +import { primitive } from '@/styles/colors'; +export const preparationSteps = [ + { id: 'introduction', title: '소개서 만들기', description: '무료 진단과 미리보기부터' }, + { id: 'student', title: '학생 정보 넣기', description: '학생을 찾으며 상담에서 들은 내용으로' }, + { id: 'curriculum', title: '커리큘럼 받기', description: '교재, 수업 횟수, 기간별 진도' }, + { id: 'tutoring', title: '과외 만들기', description: '운영 방식·유형 확인, 학부모님 초대' }, +] as const; +export type PreparationStep = (typeof preparationSteps)[number]['id']; +export function FirstTutoring({ + onStep, + completed = [], +}: { + onStep: (step: PreparationStep) => void; + completed?: PreparationStep[]; +}) { + return ( + + + 첫 과외 준비를 함께 시작해요 + + 네 단계를 마치고 과외를 만들면 기록 · 일정 · 정산이 열려요 + + 첫 과외 준비 {completed.length}/4 + + + {preparationSteps.map((step, index) => ( + onStep(step.id)} + style={[s.row, index > 0 && s.border]} + > + + {completed.includes(step.id) ? '✓' : index + 1} + + + {step.title} + {step.description} + + › + + ))} + + onStep('tutoring')} + style={s.shortcut} + > + 이미 학생이 있어요 · 바로 과외 만들기 + + + ); +} +const { gray, blue } = primitive; +const s = StyleSheet.create({ + root: { paddingHorizontal: 24, paddingTop: 24, paddingBottom: 24 }, + title: { fontSize: 18, lineHeight: 26, fontWeight: '700', color: gray[650] }, + description: { fontSize: 12, lineHeight: 18, color: gray[350], marginTop: 8 }, + progress: { + fontSize: 15, + lineHeight: 22, + fontWeight: '700', + color: gray[650], + marginTop: 30, + marginBottom: 8, + }, + count: { color: blue[500] }, + list: { backgroundColor: gray[0], borderRadius: 8, overflow: 'hidden' }, + row: { + minHeight: 73, + flexDirection: 'row', + alignItems: 'center', + paddingHorizontal: 16, + gap: 16, + }, + border: { borderTopWidth: 1, borderTopColor: gray[100] }, + number: { + width: 24, + height: 24, + borderRadius: 12, + backgroundColor: blue[100], + alignItems: 'center', + justifyContent: 'center', + }, + numberText: { fontSize: 12, color: blue[500] }, + copy: { flex: 1 }, + stepTitle: { fontSize: 14, lineHeight: 20, fontWeight: '700', color: gray[650] }, + stepDescription: { fontSize: 12, lineHeight: 18, color: gray[550], marginTop: 4 }, + chevron: { fontSize: 28, color: gray[500] }, + shortcut: { minHeight: 48, alignItems: 'center', justifyContent: 'center', marginTop: 12 }, + link: { fontSize: 12, lineHeight: 18, color: gray[350], textDecorationLine: 'underline' }, +}); diff --git a/src/features/home/HomeScreen.tsx b/src/features/home/HomeScreen.tsx index df89953..acddc8c 100644 --- a/src/features/home/HomeScreen.tsx +++ b/src/features/home/HomeScreen.tsx @@ -9,11 +9,15 @@ import installArt from '../../../assets/images/home-install-art.svg'; import type { HomeData, HomeLesson, HomeTask } from './types'; import { s } from './styles'; import { HomeLoading } from './HomeLoading'; +import { FirstTutoring } from './FirstTutoring'; +import type { PreparationStep } from './FirstTutoring'; import emptyArt from '../../../assets/images/home-empty.svg'; type Props = { data: HomeData; loading?: boolean; + firstTutoring?: boolean; + onPreparationStep: (step: PreparationStep) => void; onStudents: () => void; onProfile: () => void; onRecord: (lesson: HomeLesson) => void; @@ -23,6 +27,8 @@ type Props = { export function HomeScreen({ data, loading = false, + firstTutoring = false, + onPreparationStep, onStudents, onProfile, onRecord, @@ -81,127 +87,141 @@ export function HomeScreen({ )} - - - {data.dateLabel} - {data.lessons.length} - - {data.lessons.length > 0 && ( - setCardWidth(Math.max(1, event.nativeEvent.layout.width - 24))} - > - { - const index = Math.round(event.nativeEvent.contentOffset.x / cardStride); - setActiveIndex(Math.max(0, Math.min(data.lessons.length - 1, index))); - }} + {firstTutoring ? ( + + ) : ( + + + {data.dateLabel} + {data.lessons.length} + + {data.lessons.length > 0 && ( + + setCardWidth(Math.max(1, event.nativeEvent.layout.width - 24)) + } > - {data.lessons.map((lesson) => ( - - 오늘 {lesson.sessionNumber}회차 - - - - {lesson.studentName} - {lesson.description} - - {lesson.schedule} - - onRecord(lesson)} /> - + { + const index = Math.round(event.nativeEvent.contentOffset.x / cardStride); + setActiveIndex(Math.max(0, Math.min(data.lessons.length - 1, index))); + }} + > + {data.lessons.map((lesson) => ( - {Array.from({ length: lesson.totalCount }, (_, i) => ( - 오늘 {lesson.sessionNumber}회차 + + + + {lesson.studentName} + {lesson.description} + + {lesson.schedule} + + onRecord(lesson)} /> - ))} + + + {Array.from({ length: lesson.totalCount }, (_, i) => ( + + ))} + + + 오늘 기록하면 정산{' '} + {Math.min(lesson.completedCount + 1, lesson.totalCount)}/ + {lesson.totalCount}회차가 돼요 + - - 오늘 기록하면 정산 {Math.min(lesson.completedCount + 1, lesson.totalCount)}/ - {lesson.totalCount}회차가 돼요 - - - ))} - - - )} - {data.lessons.length === 0 && ( - - - 오늘은 수업이 없어요 - - + + )} + {data.lessons.length === 0 && ( + + + 오늘은 수업이 없어요 + + + + )} + {data.lessons.length > 0 && ( + + {data.lessons.map((lesson, index) => ( + { + setActiveIndex(index); + carousel.current?.scrollTo({ x: cardStride * index, animated: true }); + }} + > + + + ))} + + )} + + 할 일 + {todoCount} - )} - {data.lessons.length > 0 && ( - - {data.lessons.map((lesson, index) => ( + + {data.tasks.map((task, index) => ( { - setActiveIndex(index); - carousel.current?.scrollTo({ x: cardStride * index, animated: true }); - }} + accessibilityLabel={`${task.label} ${task.count}건`} + disabled={task.count === 0} + onPress={() => onTask(task)} + style={[s.task, index > 0 && s.taskBorder]} > - + {task.label} + 0 && s.taskCountActive]}> + {task.count}건 + ))} - )} - - 할 일 - {todoCount} - - - {data.tasks.map((task, index) => ( - onTask(task)} - style={[s.task, index > 0 && s.taskBorder]} - > - {task.label} - 0 && s.taskCountActive]}> - {task.count}건 - - - ))} - + )} )} From 071c42bf3e17578f7536a3250199c09b9c217ca2 Mon Sep 17 00:00:00 2001 From: sumin0423 Date: Sat, 14 Nov 2026 16:09:35 +0900 Subject: [PATCH 8/8] =?UTF-8?q?feat:=20=ED=99=88=20=ED=99=94=EB=A9=B4=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20=EB=B0=8F=20=EC=95=8C=EB=A6=BC=20=EC=95=88?= =?UTF-8?q?=EB=82=B4=20=EB=B0=94=ED=85=80=EC=8B=9C=ED=8A=B8=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/home.md | 5 +- src/app/(tabs)/home.tsx | 5 +- src/features/home/InstallSheet.tsx | 111 +++++++++++++++++++++++++++++ 3 files changed, 119 insertions(+), 2 deletions(-) create mode 100644 src/features/home/InstallSheet.tsx diff --git a/docs/home.md b/docs/home.md index b5236e8..7fcb83a 100644 --- a/docs/home.md +++ b/docs/home.md @@ -26,7 +26,10 @@ 캐러셀1.svg에 맞춰 다음 카드 일부를 오른쪽에 노출하고 카드 사이 간격 16을 적용합니다. 페이지 표시는 카드 너비와 간격을 합친 이동 거리로 계산합니다. 정상 할 일 목록의 외곽 테두리·동그란 배지를 제거하고, 1건 이상은 주황색, 0건은 회색 텍스트로 표시합니다. 수업 없음 상태의 목록 테두리는 기존 시안을 유지합니다. -## 첫 과외 홈 +## 첫 과외 홈 및 설치 안내 - `/home?preview=first`: 첫 과외 준비 0/4 단계 표시. 실제 완료 상태 조회는 미연결이며 단순 클릭으로 완료 수를 올리지 않음 - 학생 정보 넣기·바로 과외 만들기는 현재 구현된 `/tutoring/student`로 연결. 소개서·커리큘럼 경로는 미구현 안내 +- 홈 배너에서 설치 안내 바텀시트 표시. 배경 탭·뒤로 가기·나중에로 닫기 +- 알림 허용하기는 준비 중 안내만 표시. 실제 알림 권한 요청·Web Push 구독·설치 여부 판정은 미연결이며 허용 완료로 표시하지 않음 +- 시안의 iOS 조건은 설치 안내 문구이며 현재 배포가 푸시를 지원한다는 의미가 아님 diff --git a/src/app/(tabs)/home.tsx b/src/app/(tabs)/home.tsx index e086e2b..fed9eb8 100644 --- a/src/app/(tabs)/home.tsx +++ b/src/app/(tabs)/home.tsx @@ -7,6 +7,7 @@ import { CAN_PREVIEW } from '@/config/review'; import { useOnboarding } from '@/features/onboarding/OnboardingProvider'; import type { HomeLesson } from '@/features/home/types'; import { ActionButton } from '@/components/ActionButton'; +import { InstallSheet } from '@/features/home/InstallSheet'; export default function Screen() { const router = useRouter(); const { preview } = useLocalSearchParams<{ preview?: string }>(); @@ -19,6 +20,7 @@ export default function Screen() { return () => clearTimeout(timer); }, [preview, previewLoading]); const { profile } = useOnboarding(); + const [installOpen, setInstallOpen] = useState(false); const [notice, setNotice] = useState(null); const data = CAN_PREVIEW ? preview === 'empty' @@ -66,13 +68,14 @@ export default function Screen() { onStudents={() => router.push('/students')} onProfile={() => router.push('/settings')} onRecord={record} - onInstallInfo={() => setNotice('홈 화면 추가 및 알림 안내는 준비 중이에요.')} + onInstallInfo={() => setInstallOpen(true)} onTask={(task) => { if (task.id === 'income') router.push('/income'); else if (task.id === 'records' && data.lessons[0]) record(data.lessons[0]); else setNotice('해당 기능은 아직 연결되지 않았어요.'); }} /> + {installOpen && setInstallOpen(false)} />} void }) { + const insets = useSafeAreaInsets(); + const [notice, setNotice] = useState(false); + return ( + + + + + + + + 홈 화면 수담 추가하기 + + + 앱처럼 열리고 알림을 받을 수 있어요. 아이폰은 홈 화면에 추가해야 알림이 와요.(iOS 16.4 + 이상) + + + + 아이폰 Safari + 공유 버튼 → 홈 화면에 추가 + + + 안드로이드 Chrome + ⋮ 더보기 버튼 → 홈 화면에 추가 + + + 추가한 뒤 알림 허용하기 버튼을 누르세요 + {notice && ( + + 알림 설정을 준비 중이에요. 이용 가능해지면 안내해 드릴게요. + + )} + setNotice(true)} /> + + + + + + + + ); +} +const { gray, blue } = primitive; +const s = StyleSheet.create({ + overlay: { + flex: 1, + backgroundColor: '#0f111773', + justifyContent: 'flex-end', + alignItems: 'center', + }, + sheet: { + width: '100%', + maxWidth: 390, + maxHeight: '90%', + borderTopLeftRadius: 18, + borderTopRightRadius: 18, + backgroundColor: gray[0], + }, + handle: { + width: 56, + height: 4, + borderRadius: 2, + backgroundColor: gray[100], + alignSelf: 'center', + marginTop: 12, + marginBottom: 24, + }, + content: { paddingHorizontal: 24 }, + title: { fontSize: 18, lineHeight: 26, fontWeight: '700', color: gray[650] }, + description: { fontSize: 13, lineHeight: 18, color: gray[350], marginTop: 8 }, + instructions: { backgroundColor: gray[50], marginTop: 16, paddingHorizontal: 12 }, + instructionRow: { + minHeight: 54, + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'space-between', + gap: 8, + flexWrap: 'wrap', + paddingVertical: 12, + }, + divider: { borderTopWidth: 1, borderTopColor: gray[100] }, + browser: { fontSize: 13, lineHeight: 18, color: gray[650] }, + direction: { fontSize: 12, lineHeight: 18, color: gray[600] }, + hint: { + fontSize: 12, + lineHeight: 18, + color: gray[350], + textAlign: 'center', + marginTop: 32, + marginBottom: 8, + }, + notice: { fontSize: 12, lineHeight: 18, color: blue[550], marginBottom: 12 }, + later: { marginTop: 8 }, +});