성인 라이브 입장에 본인인증 흐름 추가
라이브 지금 항목 탭을 상위에서 처리 가능하도록 노출
This commit is contained in:
@@ -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
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user