Skip to content

Commit

Permalink
[fix] #120 페이지네이션 액션 애니메이션 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
ShapeKim98 committed Sep 15, 2024
1 parent c771ccc commit 636e6dd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@ public struct PokitSearchFeature {
guard let startDate = domain.condition.startDate else {
return nil
}
let formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd"

return formatter.string(from: startDate)
return DateFormat.searchCondition.formatter.string(from: startDate)
}
var hasNext: Bool {
get { domain.contentList.hasNext }
Expand Down Expand Up @@ -335,7 +332,7 @@ private extension PokitSearchFeature {
state.shareSheetItem = nil
return .none
case .로딩_isPresented:
return .send(.async(.컨텐츠_검색_결과_페이징_조회), animation: .pokitDissolve)
return .send(.async(.컨텐츠_검색_결과_페이징_조회))
}
}

Expand All @@ -350,9 +347,6 @@ private extension PokitSearchFeature {
state.domain.contentList.data = []
return .none
case .updateDateFilter(startDate: let startDate, endDate: let endDate):
let formatter = DateFormatter()
formatter.dateFormat = "yy.MM.dd"

state.domain.condition.startDate = startDate
state.domain.condition.endDate = endDate

Expand All @@ -362,11 +356,13 @@ private extension PokitSearchFeature {
return .none
}

let startDateString = DateFormat.dateFilter.formatter.string(from: startDate)
if startDate == endDate {
/// - 날짜 필터를 하루만 선택했을 경우
state.dateFilterText = "\(formatter.string(from: startDate))"
state.dateFilterText = startDateString
} else {
state.dateFilterText = "\(formatter.string(from: startDate))~\(formatter.string(from: endDate))"
let endDateString = DateFormat.dateFilter.formatter.string(from: endDate)
state.dateFilterText = "\(startDateString)~\(endDateString)"
}

return .none
Expand Down Expand Up @@ -525,7 +521,7 @@ private extension PokitSearchFeature {
endDate: endDateString
)
).toDomain()
await send(.inner(.컨텐츠_검색_결과_페이징_갱신(contentList)), animation: .pokitDissolve)
await send(.inner(.컨텐츠_검색_결과_페이징_갱신(contentList)))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public struct PokitSearchView: View {
@Perception.Bindable
public var store: StoreOf<PokitSearchFeature>
@FocusState
private var focused: Bool
private var focused: Bool

/// - Initializer
public init(store: StoreOf<PokitSearchFeature>) {
Expand All @@ -35,9 +35,12 @@ public extension PokitSearchView {
PokitDivider()
.padding(.top, 28)

resultList

Spacer()
if store.isSearching {
resultList
} else {

Spacer()
}
}
.background(.pokit(.bg(.base)))
.ignoresSafeArea(edges: .bottom)
Expand Down Expand Up @@ -307,16 +310,17 @@ private extension PokitSearchView {

if store.hasNext {
PokitLoading()
.task { await send(.로딩_isPresented, animation: .pokitDissolve).finish() }
.task { await send(.로딩_isPresented).finish() }
}
}
.padding(.horizontal, 20)
.padding(.bottom, store.hasNext ? 0 : 36)
}
} else {
PokitLoading()
}
}
.padding(.vertical, 24)
.padding(.top, 24)
}
}
//MARK: - Preview
Expand Down

0 comments on commit 636e6dd

Please sign in to comment.