-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat/#15] 공통 하단 탭 바 UI 구현 및 라우팅 연결 #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
561d2e9
fc15490
1a5ba42
8f1a7c3
0135061
72263c0
6466b55
0106994
863d46b
172c599
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,3 @@ | ||
| { | ||
| "recommendations": [ | ||
| "expo.vscode-expo-tools", | ||
| "bradlc.vscode-tailwindcss" | ||
| ] | ||
| "recommendations": ["expo.vscode-expo-tools", "bradlc.vscode-tailwindcss"] | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,11 +1,171 @@ | ||||||||||||||||||||||||||||||||||||||||
| import { Text } from "react-native"; | ||||||||||||||||||||||||||||||||||||||||
| import { useMemo, useState } from "react"; | ||||||||||||||||||||||||||||||||||||||||
| import { Pressable, ScrollView, Text, View } from "react-native"; | ||||||||||||||||||||||||||||||||||||||||
| import { useSafeAreaInsets } from "react-native-safe-area-context"; | ||||||||||||||||||||||||||||||||||||||||
| import { router } from "expo-router"; | ||||||||||||||||||||||||||||||||||||||||
| import { AddScheduleButton } from "@/src/components/common/AddScheduleButton"; | ||||||||||||||||||||||||||||||||||||||||
| import { ScheduleCheckItem } from "@/src/components/common/ScheduleCheckItem"; | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| import { ScreenContainer } from "@/src/components/common"; | ||||||||||||||||||||||||||||||||||||||||
| type Schedule = { | ||||||||||||||||||||||||||||||||||||||||
| id: string; | ||||||||||||||||||||||||||||||||||||||||
| categoryLabel: string; | ||||||||||||||||||||||||||||||||||||||||
| categoryColor: string; | ||||||||||||||||||||||||||||||||||||||||
| description: string; | ||||||||||||||||||||||||||||||||||||||||
| checked: boolean; | ||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| const MOCK_SCHEDULES: Schedule[] = [ | ||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||
| id: "1", | ||||||||||||||||||||||||||||||||||||||||
| categoryLabel: "CATEGORY", | ||||||||||||||||||||||||||||||||||||||||
| categoryColor: "#5B8FD9", | ||||||||||||||||||||||||||||||||||||||||
| description: "Lorem ipsum dolor sit amet consectetur.", | ||||||||||||||||||||||||||||||||||||||||
| checked: false, | ||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||
| id: "2", | ||||||||||||||||||||||||||||||||||||||||
| categoryLabel: "CATEGORY", | ||||||||||||||||||||||||||||||||||||||||
| categoryColor: "#D9A05B", | ||||||||||||||||||||||||||||||||||||||||
| description: "Lorem ipsum dolor sit amet consectetur.", | ||||||||||||||||||||||||||||||||||||||||
| checked: false, | ||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||
| id: "3", | ||||||||||||||||||||||||||||||||||||||||
| categoryLabel: "CATEGORY", | ||||||||||||||||||||||||||||||||||||||||
| categoryColor: "#5FAE72", | ||||||||||||||||||||||||||||||||||||||||
| description: "Lorem ipsum dolor sit amet consectetur.", | ||||||||||||||||||||||||||||||||||||||||
| checked: false, | ||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||
| id: "4", | ||||||||||||||||||||||||||||||||||||||||
| categoryLabel: "CATEGORY", | ||||||||||||||||||||||||||||||||||||||||
| categoryColor: "#9B7ED9", | ||||||||||||||||||||||||||||||||||||||||
| description: "Lorem ipsum dolor sit amet consectetur.", | ||||||||||||||||||||||||||||||||||||||||
| checked: false, | ||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||
| id: "5", | ||||||||||||||||||||||||||||||||||||||||
| categoryLabel: "CATEGORY", | ||||||||||||||||||||||||||||||||||||||||
| categoryColor: "#D95B8F", | ||||||||||||||||||||||||||||||||||||||||
| description: "Lorem ipsum dolor sit amet consectetur.", | ||||||||||||||||||||||||||||||||||||||||
| checked: false, | ||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||
| ]; | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| function useFormattedDate() { | ||||||||||||||||||||||||||||||||||||||||
| return useMemo(() => { | ||||||||||||||||||||||||||||||||||||||||
| const days = ["일", "월", "화", "수", "목", "금", "토"]; | ||||||||||||||||||||||||||||||||||||||||
| const now = new Date(); | ||||||||||||||||||||||||||||||||||||||||
| return `${now.getMonth() + 1}월 ${now.getDate()}일 ${days[now.getDay()]}요일`; | ||||||||||||||||||||||||||||||||||||||||
| }, []); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| export default function HomeScreen() { | ||||||||||||||||||||||||||||||||||||||||
| const insets = useSafeAreaInsets(); | ||||||||||||||||||||||||||||||||||||||||
| const dateLabel = useFormattedDate(); | ||||||||||||||||||||||||||||||||||||||||
| const [schedules, setSchedules] = useState<Schedule[]>(MOCK_SCHEDULES); | ||||||||||||||||||||||||||||||||||||||||
| const hasSchedules = schedules.length > 0; | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| const toggleSchedule = (id: string) => { | ||||||||||||||||||||||||||||||||||||||||
| setSchedules((prev) => | ||||||||||||||||||||||||||||||||||||||||
| prev.map((s) => (s.id === id ? { ...s, checked: !s.checked } : s)) | ||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||||||||||||
| <ScreenContainer> | ||||||||||||||||||||||||||||||||||||||||
| <Text>홈</Text> | ||||||||||||||||||||||||||||||||||||||||
| </ScreenContainer> | ||||||||||||||||||||||||||||||||||||||||
| <View | ||||||||||||||||||||||||||||||||||||||||
| className="flex-1" | ||||||||||||||||||||||||||||||||||||||||
| style={{ | ||||||||||||||||||||||||||||||||||||||||
| backgroundColor: "#F5F9F6", | ||||||||||||||||||||||||||||||||||||||||
| paddingTop: insets.top + 20, | ||||||||||||||||||||||||||||||||||||||||
| paddingHorizontal: 16, | ||||||||||||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||
| <ScrollView showsVerticalScrollIndicator={false}> | ||||||||||||||||||||||||||||||||||||||||
| {/* 로고 영역 */} | ||||||||||||||||||||||||||||||||||||||||
| <View className="mb-2 h-[32px] items-start justify-center"> | ||||||||||||||||||||||||||||||||||||||||
| <Text style={{ fontSize: 22, fontWeight: "700", color: "#4D826C" }}> | ||||||||||||||||||||||||||||||||||||||||
| DA·LOG | ||||||||||||||||||||||||||||||||||||||||
| </Text> | ||||||||||||||||||||||||||||||||||||||||
| </View> | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| {/* 날짜 */} | ||||||||||||||||||||||||||||||||||||||||
| <Text | ||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 날짜 로 되어 있는 부분에 style에 값을 직접 작성해주었는데, 사용하는 부분마다 매번 작성하는 것을 방지하기 위해 디자인 토큰으로 정의해두었습니다 ! 다음과 같이 수정해주세요
|
||||||||||||||||||||||||||||||||||||||||
| className="mb-3" | ||||||||||||||||||||||||||||||||||||||||
| style={{ | ||||||||||||||||||||||||||||||||||||||||
| fontFamily: "SUIT-SemiBold", | ||||||||||||||||||||||||||||||||||||||||
| fontWeight: "600", | ||||||||||||||||||||||||||||||||||||||||
| fontSize: 20, | ||||||||||||||||||||||||||||||||||||||||
| lineHeight: 30, // 20 * 150% | ||||||||||||||||||||||||||||||||||||||||
| letterSpacing: -0.4, // 20 * -2% | ||||||||||||||||||||||||||||||||||||||||
| color: "#15231D", | ||||||||||||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||
| {dateLabel} | ||||||||||||||||||||||||||||||||||||||||
| </Text> | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| {/* 일정 카드 */} | ||||||||||||||||||||||||||||||||||||||||
| <View className="w-full rounded-2xl bg-white px-4 py-4"> | ||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||||||||||||||||||||
| <Text | ||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 여기도 토큰으로 스타일을 정의해 두어서 토큰으로 스타일 적용해주세요 !
|
||||||||||||||||||||||||||||||||||||||||
| className="mb-2" | ||||||||||||||||||||||||||||||||||||||||
| style={{ | ||||||||||||||||||||||||||||||||||||||||
| fontFamily: "SUIT-Regular", | ||||||||||||||||||||||||||||||||||||||||
| fontWeight: "400", | ||||||||||||||||||||||||||||||||||||||||
| fontSize: 16, | ||||||||||||||||||||||||||||||||||||||||
| lineHeight: 24, // 16 * 150% | ||||||||||||||||||||||||||||||||||||||||
| letterSpacing: -0.32, // 16 * -2% | ||||||||||||||||||||||||||||||||||||||||
| color: "#020303", | ||||||||||||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||
| {hasSchedules | ||||||||||||||||||||||||||||||||||||||||
| ? "오늘 계획한 일정은 모두 마치셨나요?" | ||||||||||||||||||||||||||||||||||||||||
| : "오늘 계획된 일정이 없어요."} | ||||||||||||||||||||||||||||||||||||||||
| </Text> | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| {hasSchedules && | ||||||||||||||||||||||||||||||||||||||||
| schedules.map((s) => ( | ||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||||||||||||||||||||
| <ScheduleCheckItem | ||||||||||||||||||||||||||||||||||||||||
| key={s.id} | ||||||||||||||||||||||||||||||||||||||||
| categoryLabel={s.categoryLabel} | ||||||||||||||||||||||||||||||||||||||||
| categoryColor={s.categoryColor} | ||||||||||||||||||||||||||||||||||||||||
| description={s.description} | ||||||||||||||||||||||||||||||||||||||||
| checked={s.checked} | ||||||||||||||||||||||||||||||||||||||||
| onToggle={() => toggleSchedule(s.id)} | ||||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||||
| ))} | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| <View className={hasSchedules ? "mt-2" : ""}> | ||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 위에 gap-3 추가한것과 관련하여 상단에서 간격을 이미 처리했기 때문에 mt로 간격 추가한건 지워주세요
|
||||||||||||||||||||||||||||||||||||||||
| <AddScheduleButton onPress={() => router.push("/schedule")} /> | ||||||||||||||||||||||||||||||||||||||||
| </View> | ||||||||||||||||||||||||||||||||||||||||
| </View> | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| {/* 오늘의 질문 */} | ||||||||||||||||||||||||||||||||||||||||
| <View className="mt-6"> | ||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||||||||||||||||||||
| <Text | ||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||||||||||||||||||||
| className="mb-3" | ||||||||||||||||||||||||||||||||||||||||
| style={{ | ||||||||||||||||||||||||||||||||||||||||
| fontFamily: "SUIT-Medium", | ||||||||||||||||||||||||||||||||||||||||
| fontWeight: "500", | ||||||||||||||||||||||||||||||||||||||||
| fontSize: 18, | ||||||||||||||||||||||||||||||||||||||||
| lineHeight: 27, // 18 * 150% | ||||||||||||||||||||||||||||||||||||||||
| letterSpacing: -0.36, // 18 * -2% | ||||||||||||||||||||||||||||||||||||||||
| color: "#15231D", | ||||||||||||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||
| 오늘의 질문 | ||||||||||||||||||||||||||||||||||||||||
| </Text> | ||||||||||||||||||||||||||||||||||||||||
| <Pressable | ||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 버튼은 공통 컴포넌트로 제작해두었습니다 ! 제 PR 확인하시면 사용하는 방법 정리해두어서 확인해주세요 ! 여기는 다음과 같이 적용해주시면 됩니다 |
||||||||||||||||||||||||||||||||||||||||
| className="w-full items-center justify-center rounded-2xl py-4" | ||||||||||||||||||||||||||||||||||||||||
| style={{ backgroundColor: "#4D826C", outlineStyle: "none" } as any} | ||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||
| <Text | ||||||||||||||||||||||||||||||||||||||||
| className="text-white" | ||||||||||||||||||||||||||||||||||||||||
| style={{ fontSize: 16, fontWeight: "600" }} | ||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||
| 질문 받기 | ||||||||||||||||||||||||||||||||||||||||
| </Text> | ||||||||||||||||||||||||||||||||||||||||
| </Pressable> | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+156
to
+166
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win "질문 받기" 버튼에 새로 추가된 "오늘의 질문" 섹션의 💡 예시 수정 <Pressable
className="w-full items-center justify-center rounded-2xl py-4"
style={{ backgroundColor: "`#4D826C`", outlineStyle: "none" } as any}
+ onPress={() => {
+ // TODO: 오늘의 질문 기능 연결
+ }}
>📝 Committable suggestion
Suggested change
🧰 Tools🪛 ESLint[error] 130-130: Replace (prettier/prettier) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||
| </View> | ||||||||||||||||||||||||||||||||||||||||
| </ScrollView> | ||||||||||||||||||||||||||||||||||||||||
| </View> | ||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||




There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
로고 영역으로 되어 있는 부분은 제가 별도로 헤더 컴포넌트를 구현해두었습니다! 해당 부분은 제거하고, 구현된 헤더 컴포넌트를 불러와 적용해주시면 될 것 같습니다!