Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions Projects/Feature/Home/Sources/Goal/AddGoalListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ struct AddGoalListView: View {
headerView
.padding(.horizontal, 20)
categoryListView
.padding(.top, 20)
.padding(.horizontal, 20)
.padding(.bottom, 80)
}
.padding(.top, 28)
}
Expand All @@ -54,10 +51,15 @@ private extension AddGoalListView {
}

var categoryListView: some View {
VStack(spacing: 16) {
ForEach(items, id: \.self) { item in
categoryCardView(for: item)
ScrollView {
VStack(spacing: 16) {
ForEach(items, id: \.self) { item in
categoryCardView(for: item)
}
}
.padding(.top, 20)
.padding(.bottom, 80)
.padding(.horizontal, 20)
}
}

Expand Down
31 changes: 19 additions & 12 deletions Projects/Feature/Home/Sources/Home/HomeReducer+Impl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,10 @@ extension HomeReducer {
case let .myCardTapped(card):
let verificationDate = TXCalendarUtil.apiDateString(for: state.calendarDate)
return .send(.delegate(.goToGoalDetail(id: card.id, owner: .mySelf, verificationDate: verificationDate)))

case let .headerTapped(card):
return .send(.delegate(.goToStatsDetail(id: card.id)))

case .floatingButtonTapped:
state.isAddGoalPresented = true
return .none
Expand Down Expand Up @@ -267,24 +267,31 @@ extension HomeReducer {
state.cards = items
}
return .none

case .fetchGoalsFailed:
state.isLoading = false
return .send(.showToast(.warning(message: "λͺ©ν‘œ μ‘°νšŒμ— μ‹€νŒ¨ν–ˆμ–΄μš”")))

case let .setCalendarDate(date):
let now = state.nowDate
if date == state.calendarDate {
return .none
}
guard date != state.calendarDate else { return .none }

let today = TXCalendarDate()
let calendar = Calendar(identifier: .gregorian)

state.calendarDate = date
state.calendarMonthTitle = "\(date.month)μ›” \(date.year)"
state.calendarWeeks = TXCalendarDataGenerator.generateWeekData(for: date)
state.isRefreshHidden = (
date.year == now.year &&
date.month == now.month &&
date.day == now.day
)

if let selectedDate = date.date,
let todayDate = today.date {
let isThisWeek = calendar.isDate(
selectedDate,
equalTo: todayDate,
toGranularity: .weekOfYear
)
state.isRefreshHidden = isThisWeek
}

state.isLoading = true
return .send(.fetchGoals)

Expand Down
57 changes: 35 additions & 22 deletions Projects/Feature/Home/Sources/Home/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,23 @@ public struct HomeView: View {
headerRow
.padding(.horizontal, 20)
.padding(.top, 16)
goalEmptyView
}
Spacer()
}
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .top)
.overlay {
if store.isLoading {
ProgressView()
.frame(maxWidth: .infinity, maxHeight: .infinity)
}

if !store.hasCards {
goalEmptyView
}
}
.overlay(alignment: .bottomTrailing) {
if !store.hasCards {
emptyArrow
}
}
.onAppear {
store.send(.onAppear)
Expand Down Expand Up @@ -106,7 +114,6 @@ public struct HomeView: View {
isPresented: $store.isCameraPermissionAlertPresented,
onDismiss: { store.send(.cameraPermissionAlertDismissed) }
)
.frame(alignment: .center)
.toolbar(.hidden, for: .navigationBar)
}
}
Expand All @@ -132,6 +139,9 @@ private extension HomeView {
TXCalendar(
mode: .weekly,
weeks: store.calendarWeeks,
config: .init(
dateStyle: .init(lastDateTextColor: Color.Gray.gray500)
),
onSelect: { item in
store.send(.calendarDateSelected(item))
},
Expand Down Expand Up @@ -212,25 +222,28 @@ private extension HomeView {
}

var goalEmptyView: some View {
GeometryReader { geometry in
VStack(alignment: .center, spacing: 0) {
Image.Illustration.emptyPoke

Text("첫 λͺ©ν‘œλ₯Ό μ„Έμ›Œλ³ΌκΉŒμš”?")
.typography(.t2_16b)
.foregroundStyle(Color.Gray.gray400)

Text("+ λ²„νŠΌμ„ 눌러 λͺ©ν‘œλ₯Ό μΆ”κ°€ν•΄λ³΄μ„Έμš”")
.typography(.c1_12r)
.foregroundStyle(Color.Gray.gray300)
.padding(.top, 5)
}
.frame(width: geometry.size.width, height: geometry.size.height)
.overlay(alignment: .bottomTrailing) {
Image.Illustration.arrow
.padding(.bottom, 63)
.padding(.trailing, 86)
}
VStack(spacing: 0) {
Image.Illustration.emptyPoke
.frame(height: 116)

Text("첫 λͺ©ν‘œλ₯Ό μ„Έμ›Œλ³ΌκΉŒμš”?")
.typography(.t2_16b)
.foregroundStyle(Color.Gray.gray400)
.padding(.top, 16)

Text("+ λ²„νŠΌμ„ 눌러 λͺ©ν‘œλ₯Ό μΆ”κ°€ν•΄λ³΄μ„Έμš”")
.typography(.c1_12r)
.foregroundStyle(Color.Gray.gray300)
.padding(.top, 4)
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.ignoresSafeArea()
}

var emptyArrow: some View {
Image.Illustration.arrow
.padding(.bottom, 71)
.padding(.trailing, 86)
.ignoresSafeArea()
}
}
2 changes: 1 addition & 1 deletion Projects/Feature/MainTab/Sources/View/MainTabView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private extension MainTabView {
TXCircleButton(config: .plus()) {
store.send(.home(.home(.floatingButtonTapped)))
}
.insideBorder(
.outsideBorder(
Color.Gray.gray300,
shape: .circle,
lineWidth: LineWidth.m
Expand Down
2 changes: 1 addition & 1 deletion Projects/Feature/MakeGoal/Sources/MakeGoalView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ private extension MakeGoalView {
.padding(.vertical, 8)
}
.padding(.top, 36)
.padding(.bottom, TXSafeArea.inset(.bottom) + 16)
.padding(.bottom, 16)
}

var periodTabButtons: some View {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ private extension OnboardingConnectView {
.padding(.horizontal, 30)
}
.padding(.top, 28)
.padding(.bottom, TXSafeArea.inset(.bottom) + Spacing.spacing7)
.padding(.bottom, Spacing.spacing7)
}

func bulletItem(_ text: String) -> some View {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading