105 lines
3.7 KiB
Swift
105 lines
3.7 KiB
Swift
//
|
|
// LivePaymentDialog.swift
|
|
// SodaLive
|
|
//
|
|
// Created by klaus on 1/21/24.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct LivePaymentDialog: View {
|
|
|
|
let title: String
|
|
let desc: String
|
|
let confirmButtonTitle: String
|
|
let confirmButtonAction: () -> Void
|
|
let cancelButtonTitle: String
|
|
let cancelButtonAction: () -> Void
|
|
|
|
let startDateTime: String?
|
|
let nowDateTime: String?
|
|
|
|
var body: some View {
|
|
VStack {
|
|
Text(title)
|
|
.font(.custom(Font.bold.rawValue, size: 18.3))
|
|
.foregroundColor(Color.graybb)
|
|
|
|
if let startDateTime = startDateTime, let nowDateTime = nowDateTime {
|
|
HStack(spacing: 0) {
|
|
VStack(alignment: .leading, spacing: 13.3) {
|
|
Text("시작 시각")
|
|
.font(.custom(Font.medium.rawValue, size: 13.3))
|
|
.foregroundColor(Color.graybb)
|
|
|
|
Text("현재 시각")
|
|
.font(.custom(Font.medium.rawValue, size: 13.3))
|
|
.foregroundColor(Color.graybb)
|
|
}
|
|
.frame(maxWidth: .infinity)
|
|
|
|
VStack(alignment: .leading, spacing: 13.3) {
|
|
Text(startDateTime)
|
|
.font(.custom(Font.medium.rawValue, size: 13.3))
|
|
.foregroundColor(Color.graybb)
|
|
|
|
Text(nowDateTime)
|
|
.font(.custom(Font.medium.rawValue, size: 13.3))
|
|
.foregroundColor(Color.graybb)
|
|
}
|
|
.frame(maxWidth: .infinity)
|
|
}
|
|
.padding(13.3)
|
|
.background(Color.gray30)
|
|
.cornerRadius(13.3)
|
|
.padding(.top, 21.3)
|
|
}
|
|
|
|
Text(desc)
|
|
.font(.custom(Font.medium.rawValue, size: 15))
|
|
.foregroundColor(Color.graybb)
|
|
.padding(.top, startDateTime != nil && nowDateTime != nil ? 16.7 : 21.3)
|
|
|
|
HStack(spacing: 13.3) {
|
|
Text("취소")
|
|
.font(.custom(Font.bold.rawValue, size: 18.3))
|
|
.foregroundColor(Color.button)
|
|
.padding(.vertical, 16)
|
|
.frame(maxWidth: .infinity)
|
|
.background(Color.bg)
|
|
.cornerRadius(10)
|
|
.overlay(
|
|
RoundedRectangle(cornerRadius: 8)
|
|
.stroke(Color(hex: "3bb9f1"), lineWidth: 1)
|
|
)
|
|
|
|
Text("결제 후 입장")
|
|
.font(.custom(Font.bold.rawValue, size: 18.3))
|
|
.padding(.vertical, 16)
|
|
.frame(maxWidth: .infinity)
|
|
.background(Color.button)
|
|
.cornerRadius(10)
|
|
}
|
|
.padding(.top, 45)
|
|
}
|
|
.padding(.horizontal, 16.7)
|
|
.padding(.bottom, 16.7)
|
|
.padding(.top, 40)
|
|
.background(Color(hex: "222222"))
|
|
.cornerRadius(10)
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
LivePaymentDialog(
|
|
title: "100캔으로 입장",
|
|
desc: "'테스트' 라이브에 참여하기 위해 결제합니다.'테스트' 라이브에 참여하기 위해 결제합니다.'테스트' 라이브에 참여하기 위해 결제합니다.",
|
|
confirmButtonTitle: "",
|
|
confirmButtonAction: {},
|
|
cancelButtonTitle: "",
|
|
cancelButtonAction: {},
|
|
startDateTime: "2024-01-01 15:00",
|
|
nowDateTime: "2024-01-02 15:00"
|
|
)
|
|
}
|