// // 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 = "" private var placeholder: String { I18n.LiveCancel.reasonPlaceholder } var body: some View { VStack(spacing: 0) { Text("예약취소") .appFont(size: 18.3, weight: .bold) .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: "3bb9f1"), lineWidth: 1.3) ) .padding(.top, 13.3) HStack(spacing: 13.3) { Text("취소") .appFont(size: 18.3, weight: .bold) .foregroundColor(Color(hex: "3bb9f1")) .padding(.vertical, 16) .padding(.horizontal, 48) .background(Color(hex: "13181b")) .cornerRadius(10) .overlay( RoundedRectangle(cornerRadius: 10) .stroke(Color(hex: "3bb9f1"), lineWidth: 1.3) ) .onTapGesture { isShowCancelPopup = false } Text("확인") .appFont(size: 18.3, weight: .bold) .foregroundColor(.white) .padding(.vertical, 16) .padding(.horizontal, 48) .background(Color(hex: "3bb9f1")) .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 } } }