feat(creator): 라이브 탭 빈 상태를 추가한다

This commit is contained in:
Yu Sung
2026-07-04 03:39:41 +09:00
parent b6580e201f
commit 6600cd43c1
4 changed files with 69 additions and 25 deletions

View File

@@ -28,38 +28,56 @@ struct CreatorChannelLiveTabView: View {
private var content: some View {
VStack(spacing: 0) {
CreatorChannelSortBar(
selectedSort: viewModel.selectedSort,
onTapSort: {
isSortSheetPresented = true
}
)
LazyVStack(spacing: 0) {
CreatorChannelCurrentLiveSection(
currentLive: viewModel.response?.currentLive,
onTapLive: onTapLive
if isEmptyState {
emptyStateView
} else {
CreatorChannelSortBar(
selectedSort: viewModel.selectedSort,
onTapSort: {
isSortSheetPresented = true
}
)
.padding(.top, SodaSpacing.s14)
.padding(.bottom, SodaSpacing.s12)
ForEach(viewModel.liveReplayContents) { audioContent in
CreatorChannelAudioContentListItem(audioContent: audioContent) {
onTapContent(audioContent.audioContentId)
LazyVStack(spacing: 0) {
CreatorChannelCurrentLiveSection(
currentLive: viewModel.response?.currentLive,
onTapLive: onTapLive
)
.padding(.top, SodaSpacing.s14)
.padding(.bottom, SodaSpacing.s12)
ForEach(viewModel.liveReplayContents) { audioContent in
CreatorChannelAudioContentListItem(audioContent: audioContent) {
onTapContent(audioContent.audioContentId)
}
.onAppear {
viewModel.fetchNextPageIfNeeded(creatorId: creatorId, currentItem: audioContent)
}
}
.onAppear {
viewModel.fetchNextPageIfNeeded(creatorId: creatorId, currentItem: audioContent)
if viewModel.isLoadingNextPage {
ProgressView()
.padding(.vertical, SodaSpacing.s20)
}
}
if viewModel.isLoadingNextPage {
ProgressView()
.padding(.vertical, SodaSpacing.s20)
}
.padding(.bottom, isOwnCreatorChannel ? 70 : SodaSpacing.s20)
}
.padding(.bottom, isOwnCreatorChannel ? 70 : SodaSpacing.s20)
}
}
private var isEmptyState: Bool {
guard viewModel.hasLoaded, let response = viewModel.response else { return false }
return response.currentLive == nil && response.liveReplayContentCount == 0
}
private var emptyStateView: some View {
Text(I18n.CreatorChannelLive.emptyMessage)
.appFont(.body3)
.foregroundColor(Color.gray500)
.multilineTextAlignment(.center)
.frame(maxWidth: .infinity)
.padding(.vertical, 48)
}
}
struct CreatorChannelLiveTabView_Previews: PreviewProvider {