콘텐츠 메인, 라이브 메인, 오디션 메인, 마이페이지
- 로그인 하지 않고 페이지 조회가 되도록 수정
This commit is contained in:
@@ -12,6 +12,7 @@ struct LiveView: View {
|
||||
|
||||
@StateObject var viewModel = LiveViewModel()
|
||||
@StateObject var appState = AppState.shared
|
||||
@AppStorage("token") private var token: String = UserDefaults.string(forKey: UserDefaultsKey.token)
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
@@ -44,9 +45,13 @@ struct LiveView: View {
|
||||
}
|
||||
.padding(.horizontal, 13.3)
|
||||
.onTapGesture {
|
||||
AppState.shared.setAppStep(
|
||||
step: .contentAllByTheme(themeId: 7)
|
||||
)
|
||||
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
|
||||
AppState.shared.setAppStep(
|
||||
step: .contentAllByTheme(themeId: 7)
|
||||
)
|
||||
} else {
|
||||
AppState.shared.setAppStep(step: .login)
|
||||
}
|
||||
}
|
||||
|
||||
if viewModel.recommendChannelItems.count > 0 {
|
||||
@@ -61,10 +66,18 @@ struct LiveView: View {
|
||||
SectionLiveNowView(
|
||||
items: viewModel.liveNowItems,
|
||||
onClickParticipant: {
|
||||
viewModel.enterLiveRoom(roomId: $0)
|
||||
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
|
||||
viewModel.enterLiveRoom(roomId: $0)
|
||||
} else {
|
||||
AppState.shared.setAppStep(step: .login)
|
||||
}
|
||||
},
|
||||
onTapCreateLive: {
|
||||
AppState.shared.setAppStep(step: .createLive(timeSettingMode: .NOW, onSuccess: onCreateSuccess))
|
||||
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
|
||||
AppState.shared.setAppStep(step: .createLive(timeSettingMode: .NOW, onSuccess: onCreateSuccess))
|
||||
} else {
|
||||
AppState.shared.setAppStep(step: .login)
|
||||
}
|
||||
},
|
||||
onClickRefresh: {
|
||||
viewModel.getSummary()
|
||||
@@ -82,12 +95,26 @@ struct LiveView: View {
|
||||
SectionLiveReservationView(
|
||||
items: viewModel.liveReservationItems,
|
||||
onClickCancel: { viewModel.getSummary() },
|
||||
onClickStart: { roomId in processStart(roomId: roomId) },
|
||||
onClickStart: { roomId in
|
||||
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
|
||||
processStart(roomId: roomId)
|
||||
} else {
|
||||
AppState.shared.setAppStep(step: .login)
|
||||
}
|
||||
},
|
||||
onClickReservation: { roomId in
|
||||
viewModel.reservationLiveRoom(roomId: roomId)
|
||||
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
|
||||
viewModel.reservationLiveRoom(roomId: roomId)
|
||||
} else {
|
||||
AppState.shared.setAppStep(step: .login)
|
||||
}
|
||||
},
|
||||
onTapCreateLive: {
|
||||
AppState.shared.setAppStep(step: .createLive(timeSettingMode: .RESERVATION, onSuccess: onCreateSuccess))
|
||||
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
|
||||
AppState.shared.setAppStep(step: .createLive(timeSettingMode: .RESERVATION, onSuccess: onCreateSuccess))
|
||||
} else {
|
||||
AppState.shared.setAppStep(step: .login)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -102,7 +129,11 @@ struct LiveView: View {
|
||||
.padding(.trailing, 16)
|
||||
.padding(.bottom, 16)
|
||||
.onTapGesture {
|
||||
AppState.shared.setAppStep(step: .createLive(timeSettingMode: .NOW, onSuccess: onCreateSuccess))
|
||||
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
|
||||
AppState.shared.setAppStep(step: .createLive(timeSettingMode: .NOW, onSuccess: onCreateSuccess))
|
||||
} else {
|
||||
AppState.shared.setAppStep(step: .login)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user