feat(refresh): Lottie 새로고침 표시를 적용한다
This commit is contained in:
@@ -74,7 +74,9 @@ struct MainContentAllView: View {
|
||||
} else if viewModel.shouldShowEmptyState {
|
||||
emptyContent
|
||||
} else {
|
||||
ScrollView(showsIndicators: false) {
|
||||
LottieRefreshableScrollView(action: {
|
||||
await viewModel.refresh()
|
||||
}) {
|
||||
gridContent
|
||||
.padding(.horizontal, SodaSpacing.s14)
|
||||
.padding(.top, SodaSpacing.s8)
|
||||
@@ -86,36 +88,31 @@ struct MainContentAllView: View {
|
||||
.padding(.vertical, SodaSpacing.s20)
|
||||
}
|
||||
}
|
||||
.refreshable {
|
||||
await viewModel.refresh()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var loadingContent: some View {
|
||||
GeometryReader { geometry in
|
||||
ScrollView(showsIndicators: false) {
|
||||
LottieRefreshableScrollView(action: {
|
||||
await viewModel.refresh()
|
||||
}) {
|
||||
ProgressView()
|
||||
.progressViewStyle(CircularProgressViewStyle(tint: .white))
|
||||
.frame(maxWidth: .infinity)
|
||||
.frame(minHeight: geometry.size.height)
|
||||
}
|
||||
.refreshable {
|
||||
await viewModel.refresh()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var emptyContent: some View {
|
||||
GeometryReader { geometry in
|
||||
ScrollView(showsIndicators: false) {
|
||||
LottieRefreshableScrollView(action: {
|
||||
await viewModel.refresh()
|
||||
}) {
|
||||
MainContentAudioEmptyStateView(message: I18n.MainContentAll.emptyStateMessage)
|
||||
.frame(minHeight: geometry.size.height)
|
||||
}
|
||||
.refreshable {
|
||||
await viewModel.refresh()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user