라이브 상세 페이지 추가

This commit is contained in:
Yu Sung
2023-08-14 19:22:23 +09:00
parent e0a5fb733d
commit 634f50d4f2
37 changed files with 2767 additions and 49 deletions

View File

@@ -0,0 +1,13 @@
//
// CancelLiveRequest.swift
// SodaLive
//
// Created by klaus on 2023/08/14.
//
import Foundation
struct CancelLiveRequest: Encodable {
let roomId: Int
let reason: String
}

View File

@@ -0,0 +1,77 @@
//
// LiveCancelDialog.swift
// SodaLive
//
// Created by klaus on 2023/08/14.
//
import SwiftUI
struct LiveCancelDialog: View {
@Binding var isShowCancelPopup: Bool
let confirmAction: (String) -> Void
@State var reason: String = ""
var placeholder = "취소사유를 입력하세요"
var body: some View {
VStack(spacing: 0) {
Text("예약취소")
.font(.custom(Font.bold.rawValue, size: 18.3))
.foregroundColor(Color(hex: "bbbbbb"))
.padding(.top, 40)
TextViewWrapper(
text: $reason,
placeholder: placeholder,
textColorHex: "eeeeee",
backgroundColorHex: "333333"
)
.frame(width: screenSize().width - 53.4, height: 150)
.cornerRadius(6.7)
.overlay(
RoundedRectangle(cornerRadius: 6.7)
.stroke(Color(hex: "9970ff"), lineWidth: 1.3)
)
.padding(.top, 13.3)
HStack(spacing: 13.3) {
Text("취소")
.font(.custom(Font.bold.rawValue, size: 18.3))
.foregroundColor(Color(hex: "9970ff"))
.padding(.vertical, 16)
.padding(.horizontal, 48)
.background(Color(hex: "9970ff").opacity(0.2))
.cornerRadius(10)
.overlay(
RoundedRectangle(cornerRadius: 10)
.stroke(Color(hex: "9970ff"), lineWidth: 1.3)
)
.onTapGesture {
isShowCancelPopup = false
}
Text("확인")
.font(.custom(Font.bold.rawValue, size: 18.3))
.foregroundColor(.white)
.padding(.vertical, 16)
.padding(.horizontal, 48)
.background(Color(hex: "9970ff"))
.cornerRadius(10)
.onTapGesture {
confirmAction(reason.trimmingCharacters(in: .whitespacesAndNewlines) != placeholder ? reason : "")
isShowCancelPopup = false
}
}
.padding(.top, 45)
.padding(.bottom, 16.7)
}
.frame(width: screenSize().width - 26.7)
.background(Color(hex: "222222"))
.cornerRadius(10)
.onAppear {
UITextView.appearance().backgroundColor = .clear
}
}
}