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

라이브 지금 항목 탭을 상위에서 처리 가능하도록 노출
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

@@ -14,6 +14,12 @@ struct LiveView: View {
@StateObject var appState = AppState.shared
@AppStorage("token") private var token: String = UserDefaults.string(forKey: UserDefaultsKey.token)
@AppStorage("role") private var role: String = UserDefaults.string(forKey: UserDefaultsKey.role)
let onTapLiveNowItem: (Int, Bool) -> Void
init(onTapLiveNowItem: @escaping (Int, Bool) -> Void = { _, _ in }) {
self.onTapLiveNowItem = onTapLiveNowItem
}
var body: some View {
ZStack {
@@ -61,6 +67,9 @@ struct LiveView: View {
AppState.shared.setAppStep(step: .login)
}
},
onTapItem: { item in
onTapLiveNowItem(item.roomId, item.isAdult)
},
onTapCreateLive: {
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
AppState.shared.setAppStep(step: .createLive(timeSettingMode: .NOW, onSuccess: onCreateSuccess))

View File

@@ -12,11 +12,10 @@ struct SectionLiveNowView: View {
let items: [GetRoomListResponse]
let onClickParticipant: (Int) -> Void
let onTapItem: (GetRoomListResponse) -> Void
let onTapCreateLive: () -> Void
let onClickRefresh: () -> Void
@AppStorage("token") private var token: String = UserDefaults.string(forKey: UserDefaultsKey.token)
var body: some View {
LazyVStack(spacing: 13.3) {
HStack(spacing: 0) {
@@ -43,24 +42,7 @@ struct SectionLiveNowView: View {
LiveNowItemView(item: item, itemWidth: nil)
.contentShape(Rectangle())
.onTapGesture {
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
AppState.shared.setAppStep(
step: .liveDetail(
roomId: item.roomId,
onClickParticipant: {
AppState.shared.isShowPlayer = false
onClickParticipant(item.roomId)
},
onClickReservation: {},
onClickStart: {
},
onClickCancel: {
}
)
)
} else {
AppState.shared.setAppStep(step: .login)
}
onTapItem(item)
}
}
}
@@ -114,6 +96,7 @@ struct SectionLiveNowView_Previews: PreviewProvider {
SectionLiveNowView(
items: [],
onClickParticipant: { _ in },
onTapItem: { _ in },
onTapCreateLive: {},
onClickRefresh: {}
)