feat: 메인 홈 - 인기 크리에이터, 최신 콘텐츠

- 터치시 로그인이 되어 있지 않으면 로그인 페이지로 이동
This commit is contained in:
Yu Sung
2025-07-14 19:59:43 +09:00
parent 87b43bd2c2
commit 3bc42b6e01
3 changed files with 28 additions and 7 deletions

View File

@@ -68,9 +68,6 @@ struct HomeCreatorRankingItemView: View {
.padding(.leading, 10)
}
}
.onTapGesture {
AppState.shared.setAppStep(step: .creatorDetail(userId: item.id))
}
}
}

View File

@@ -94,7 +94,17 @@ struct HomeTabView: View {
ScrollView(.horizontal, showsIndicators: false) {
HStack(spacing: 16) {
ForEach(0..<viewModel.creatorRanking.count, id: \.self) {
HomeCreatorRankingItemView(rank: $0 + 1, item: viewModel.creatorRanking[$0])
let item = viewModel.creatorRanking[$0]
HomeCreatorRankingItemView(rank: $0 + 1, item: item)
.onTapGesture {
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
AppState.shared
.setAppStep(step: .creatorDetail(userId: item.id))
} else {
AppState.shared
.setAppStep(step: .login)
}
}
}
}
.padding(.horizontal, 24)
@@ -105,8 +115,13 @@ struct HomeTabView: View {
VStack(alignment: .leading, spacing: 16) {
HomeLatestContentView(
onClickMore: {
AppState.shared
.setAppStep(step: .newContentAll(isFree: false))
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
AppState.shared
.setAppStep(step: .newContentAll(isFree: false))
} else {
AppState.shared
.setAppStep(step: .login)
}
},
themeList: viewModel.latestContentThemeList,
contentList: viewModel.latestContentList