feat(refresh): Lottie 새로고침 표시를 적용한다
This commit is contained in:
@@ -56,7 +56,9 @@ struct MainHomeFollowingView: View {
|
||||
} else if !viewModel.message.isEmpty {
|
||||
emptyContent(message: viewModel.message)
|
||||
} else if let response = viewModel.response {
|
||||
ScrollView(.vertical, showsIndicators: false) {
|
||||
LottieRefreshableScrollView(action: {
|
||||
await viewModel.refresh()
|
||||
}) {
|
||||
VStack(spacing: 0) {
|
||||
if !response.followingCreators.isEmpty {
|
||||
MainHomeFollowingCreatorSection(
|
||||
@@ -104,9 +106,6 @@ struct MainHomeFollowingView: View {
|
||||
.padding(.bottom, SodaSpacing.s20)
|
||||
}
|
||||
.background(Color.black)
|
||||
.refreshable {
|
||||
await viewModel.refresh()
|
||||
}
|
||||
} else {
|
||||
emptyContent(message: I18n.HomeFollowing.emptyStateMessage)
|
||||
}
|
||||
@@ -114,31 +113,29 @@ struct MainHomeFollowingView: View {
|
||||
|
||||
private var loadingContent: some View {
|
||||
GeometryReader { geometry in
|
||||
ScrollView(showsIndicators: false) {
|
||||
LottieRefreshableScrollView(action: {
|
||||
await viewModel.refresh()
|
||||
}) {
|
||||
ProgressView()
|
||||
.tint(.white)
|
||||
.frame(maxWidth: .infinity)
|
||||
.frame(minHeight: geometry.size.height)
|
||||
}
|
||||
.background(Color.black)
|
||||
.refreshable {
|
||||
await viewModel.refresh()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func emptyContent(message: String, loginAction: (() -> Void)? = nil) -> some View {
|
||||
GeometryReader { geometry in
|
||||
ScrollView(showsIndicators: false) {
|
||||
LottieRefreshableScrollView(action: {
|
||||
await viewModel.refresh()
|
||||
}) {
|
||||
MainHomeFollowingEmptyStateView(
|
||||
message: message,
|
||||
loginAction: loginAction
|
||||
)
|
||||
.frame(minHeight: geometry.size.height)
|
||||
}
|
||||
.refreshable {
|
||||
await viewModel.refresh()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user