feat(refresh): Lottie 새로고침 표시를 적용한다

This commit is contained in:
Yu Sung
2026-08-26 01:21:26 +09:00
parent fc0f7e2b50
commit e46198f87a
14 changed files with 1046 additions and 297 deletions

View File

@@ -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()
}
}
}
}