성인 라이브 입장에 본인인증 흐름 추가

라이브 지금 항목 탭을 상위에서 처리 가능하도록 노출
This commit is contained in:
Yu Sung
2026-02-02 11:48:12 +09:00
parent 9e97c301b8
commit b985af4497
4 changed files with 130 additions and 43 deletions

View File

@@ -26,7 +26,16 @@ struct HomeTabView: View {
@State private var pendingUnfollowCreatorId: Int? = nil
@State private var pendingUnfollowCreatorName = ""
var onTapPopularCharacterAllView: (() -> Void)? = nil
let onTapPopularCharacterAllView: (() -> Void)?
let onTapLiveNowItem: ((Int, Bool) -> Void)?
init(
onTapPopularCharacterAllView: (() -> Void)? = nil,
onTapLiveNowItem: ((Int, Bool) -> Void)? = nil
) {
self.onTapPopularCharacterAllView = onTapPopularCharacterAllView
self.onTapLiveNowItem = onTapLiveNowItem
}
// CharacterView
private func handleCharacterSelection(_ characterId: Int) {
@@ -45,6 +54,10 @@ struct HomeTabView: View {
}
AppState.shared.setAppStep(step: .characterDetail(characterId: characterId))
}
private func handleLiveNowItemTap(roomId: Int, isAdult: Bool) {
onTapLiveNowItem?(roomId, isAdult)
}
var body: some View {
BaseView(isLoading: $viewModel.isLoading) {
@@ -93,23 +106,12 @@ struct HomeTabView: View {
ScrollView(.horizontal, showsIndicators: false) {
LazyHStack(spacing: 16) {
ForEach(0..<viewModel.liveList.count, id: \.self) { index in
HomeLiveItemView(item: viewModel.liveList[index]) { roomId in
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
AppState.shared.setAppStep(
step: .liveDetail(
roomId: roomId,
onClickParticipant: {
AppState.shared.isShowPlayer = false
liveViewModel.enterLiveRoom(roomId: roomId)
},
onClickReservation: {},
onClickStart: {},
onClickCancel: {}
)
)
} else {
AppState.shared.setAppStep(step: .login)
}
let item = viewModel.liveList[index]
HomeLiveItemView(item: item) { roomId in
handleLiveNowItemTap(
roomId: roomId,
isAdult: item.isAdult
)
}
}
}