오디션 - 오디오 재생기능 추가
This commit is contained in:
@@ -14,6 +14,7 @@ struct AuditionRoleDetailView: View {
|
||||
|
||||
@StateObject var viewModel = AuditionRoleDetailViewModel()
|
||||
@StateObject var keyboardHandler = KeyboardHandler()
|
||||
@StateObject var soundManager = AuditionSoundManager.shared
|
||||
|
||||
@State private var isShowApplyMethodView = false
|
||||
@State private var isShowSelectAudioView = false
|
||||
@@ -123,10 +124,28 @@ struct AuditionRoleDetailView: View {
|
||||
Spacer()
|
||||
}
|
||||
}
|
||||
.popup(isPresented: $soundManager.isShowPopup, type: .toast, position: .bottom, autohideIn: 2) {
|
||||
HStack {
|
||||
Spacer()
|
||||
Text(soundManager.errorMessage)
|
||||
.padding(.vertical, 13.3)
|
||||
.frame(width: screenSize().width - 66.7, alignment: .center)
|
||||
.font(.custom(Font.medium.rawValue, size: 12))
|
||||
.background(Color.button)
|
||||
.foregroundColor(Color.white)
|
||||
.multilineTextAlignment(.leading)
|
||||
.cornerRadius(20)
|
||||
.padding(.bottom, 66.7)
|
||||
Spacer()
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
viewModel.onFailure = { AppState.shared.back() }
|
||||
viewModel.auditionRoleId = roleId
|
||||
}
|
||||
.onDisappear {
|
||||
soundManager.resetPlayer()
|
||||
}
|
||||
|
||||
if let roleDetail = viewModel.auditionRoleDetail {
|
||||
Text(roleDetail.isAlreadyApplicant ? "오디션 재지원" : "오디션 지원")
|
||||
@@ -208,6 +227,10 @@ struct AuditionRoleDetailView: View {
|
||||
viewModel.isShowNotifyVote = false
|
||||
}
|
||||
}
|
||||
|
||||
if soundManager.isLoading {
|
||||
LoadingView()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user