룰렛 프리뷰 다이얼로그 추가

This commit is contained in:
Yu Sung
2023-12-06 21:18:57 +09:00
parent ff7144f708
commit a22e2e7a51
4 changed files with 194 additions and 0 deletions

View File

@@ -121,6 +121,7 @@ struct RouletteSettingsView: View {
.foregroundColor(Color(hex: "3bb9f1"))
)
.onTapGesture {
viewModel.onClickPreview()
}
Text("설정완료")
@@ -143,6 +144,32 @@ struct RouletteSettingsView: View {
.frame(width: screenSize().width, height: 15.3)
}
}
if let preview = viewModel.previewData, viewModel.isShowPreview {
RoulettePreviewDialog(
isShowing: $viewModel.isShowPreview,
title: "룰렛 미리보기",
onClickSpin: nil,
preview: preview
)
}
}
.popup(isPresented: $viewModel.isShowErrorPopup, type: .toast, position: .top, autohideIn: 1.3) {
GeometryReader { geo in
HStack {
Spacer()
Text(viewModel.errorMessage)
.padding(.vertical, 13.3)
.frame(width: geo.size.width - 66.7, alignment: .center)
.font(.custom(Font.medium.rawValue, size: 12))
.background(Color(hex: "9970ff"))
.foregroundColor(Color.white)
.multilineTextAlignment(.center)
.cornerRadius(20)
.padding(.top, 66.7)
Spacer()
}
}
}
.onAppear {
viewModel.getRoulette(creatorId: UserDefaults.int(forKey: .userId))